diff options
| author | fukachan <fukachan> | 2003-03-14 03:44:14 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-03-14 03:44:14 +0000 |
| commit | 8a6721908daa3154cbe9c4bc95a7fd158eb36810 (patch) | |
| tree | 860473f0d8cca2a7c11440f32da0e6b95ca0abe0 | |
| parent | 0f6cc50e32bfcf4bd0d1d9dc29bf4d34e129a497 (diff) | |
| download | fml8-8a6721908daa3154cbe9c4bc95a7fd158eb36810.tar.gz fml8-8a6721908daa3154cbe9c4bc95a7fd158eb36810.tar.bz2 fml8-8a6721908daa3154cbe9c4bc95a7fd158eb36810.zip | |
fmlsuper is obsolete.
use "makefml mailq $ml" instead of fmlsuper to show outgoing mail queue.
| -rw-r--r-- | configure.in | 3 | ||||
| -rwxr-xr-x | fml/bin/fmlsuper.in | 17 | ||||
| -rw-r--r-- | fml/etc/command_line_options | 3 | ||||
| -rw-r--r-- | fml/etc/install.cf.in | 3 | ||||
| -rw-r--r-- | fml/etc/modules | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/MANIFEST.euc-jp | 4 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/mailq.pm | 115 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Super.pm | 230 |
8 files changed, 123 insertions, 256 deletions
diff --git a/configure.in b/configure.in index 4c39654a..2772de85 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl -dnl $FML: configure.in,v 1.31 2003/01/05 05:13:49 fukachan Exp $ +dnl $FML: configure.in,v 1.32 2003/01/28 04:13:32 fukachan Exp $ dnl AC_REVISION($Revision$) @@ -135,7 +135,6 @@ AC_OUTPUT(\ fml/bin/fmlsummary \ fml/bin/fmlthread \ fml/bin/fmlspool \ - fml/bin/fmlsuper \ fml/bin/fml \ fml/bin/makefml \ ) diff --git a/fml/bin/fmlsuper.in b/fml/bin/fmlsuper.in deleted file mode 100755 index 45853b53..00000000 --- a/fml/bin/fmlsuper.in +++ /dev/null @@ -1,17 +0,0 @@ -#! @SHELL@ -# -# Copyright (C) 2003 Ken'ichi Fukamachi -# All rights reserved. This program is free software; you can -# redistribute it and/or modify it under the same terms as Perl itself. -# -# $FML$ -# - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libexec_dir=@libexecdir@/fml - -exec $libexec_dir/fmlsuper $* - -echo 'not reach here' -exit 0; diff --git a/fml/etc/command_line_options b/fml/etc/command_line_options index 9a3318ce..3e7f7e88 100644 --- a/fml/etc/command_line_options +++ b/fml/etc/command_line_options @@ -1,5 +1,5 @@ # -# $FML$ +# $FML: command_line_options,v 1.1 2003/03/06 12:34:23 fukachan Exp $ # # map between programs and options # @@ -25,7 +25,6 @@ fmlerror debug! help! fmlhtmlify debug! help! -I=s fmlspool debug! help! -I=s convert! style=s srcdir=s fmlsummary debug! help! -c=s n! -fmlsuper debug! help! fmlthread debug! help! article_id_max=i spool_dir=s base_url=s msg_base_url=s reverse! params=s -f=s -c=s makefml debug! help! force! params=s -c=s diff --git a/fml/etc/install.cf.in b/fml/etc/install.cf.in index 375bb497..ca6abbea 100644 --- a/fml/etc/install.cf.in +++ b/fml/etc/install.cf.in @@ -3,7 +3,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: install.cf.in,v 1.5 2003/03/06 12:33:25 fukachan Exp $ +# $FML: install.cf.in,v 1.6 2003/03/11 06:20:51 fukachan Exp $ # @@ -96,7 +96,6 @@ bin_programs = fml fmlhtmlify fmlspool fmlsummary - fmlsuper libexec_programs = fml.pl diff --git a/fml/etc/modules b/fml/etc/modules index 2fbb2438..0eec37ad 100644 --- a/fml/etc/modules +++ b/fml/etc/modules @@ -1,5 +1,5 @@ # -# $FML$ +# $FML: modules,v 1.1 2003/03/06 11:29:11 fukachan Exp $ # # map between programs and modules (like /etc/name_to_sysnum on solaris ?) # @@ -26,7 +26,7 @@ fmlerror FML::Process::ErrorViewer $ml fmlhtmlify FML::Process::HTMLify $ml fmlspool FML::Process::Spool $ml fmlsummary FML::Process::Summary $ml -fmlsuper FML::Process::Super $ml +fmlsuper FML::Process::Obsolete $ml fmlthread FML::Process::ThreadTrack $ml makefml FML::Process::Configure $command $ml $opts diff --git a/fml/lib/FML/Command/Admin/MANIFEST.euc-jp b/fml/lib/FML/Command/Admin/MANIFEST.euc-jp index b117c56a..ecebbbf9 100644 --- a/fml/lib/FML/Command/Admin/MANIFEST.euc-jp +++ b/fml/lib/FML/Command/Admin/MANIFEST.euc-jp @@ -58,6 +58,8 @@ changepassword パスワードの変更 addmoderator モデレータの追加 delmoderator モデレータの削除 +mailq 配送予定のメールキュー + ○ 未実装 @@ -72,4 +74,4 @@ moderatormod 属性を変更するコマンドは必要だろうか? help admin のヘルプファイルを取り寄せる -$FML: MANIFEST.euc-jp,v 1.10 2003/02/01 13:53:55 fukachan Exp $ +$FML: MANIFEST.euc-jp,v 1.11 2003/03/11 14:44:49 fukachan Exp $ diff --git a/fml/lib/FML/Command/Admin/mailq.pm b/fml/lib/FML/Command/Admin/mailq.pm new file mode 100644 index 00000000..8d30c018 --- /dev/null +++ b/fml/lib/FML/Command/Admin/mailq.pm @@ -0,0 +1,115 @@ +#-*- perl -*- +# +# Copyright (C) 2003 MURASHITA Takuya +# All rights reserved. This program is free software; you can +# redistribute it and/or modify it under the same terms as Perl itself. +# +# $FML: mailq.pm,v 1.8 2003/02/13 14:06:13 fukachan Exp $ +# + +package FML::Command::Admin::mailq; +use strict; +use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); +use Carp; + + +=head1 NAME + +FML::Command::Admin::mailq - show outgoing mail queue. + +=head1 SYNOPSIS + +See C<FML::Command> for more details. + +=head1 DESCRIPTION + +change delivery mode from real time to digest. + +=head1 METHODS + +=head2 C<process($curproc, $command_args)> + +=cut + + +# Descriptions: constructor. +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: OBJ +sub new +{ + my ($self) = @_; + my ($type) = ref($self) || $self; + my $me = {}; + return bless $me, $type; +} + + +# Descriptions: need lock or not +# Arguments: none +# Side Effects: none +# Return Value: NUM( 1 or 0) +sub need_lock { 1;} + + +# Descriptions: change delivery mode from real time to digest. +# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) +# Side Effects: update $recipient_map +# Return Value: none +sub process +{ + my ($self, $curproc, $command_args) = @_; + + $self->_queue($curproc); +} + + +# Descriptions: open mail queue and list up. +# Arguments: OBJ($self) OBJ($curproc) +# Side Effects: none +# Return Value: none +sub _queue +{ + my ($self, $curproc) = @_; + my $config = $curproc->config(); + my $queue_dir = $config->{ mail_queue_dir }; + my $count = 0; + + use Mail::Delivery::Queue; + my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; + my $ra = $queue->list(); + + for my $qid (@$ra) { + print $qid, "\n"; + $count++; + } + + unless ($count) { + print STDERR "Mail queue is empty\n"; + } +} + + +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +MURASHITA Takuya + +=head1 COPYRIGHT + +Copyright (C) 2002,2003 MURASHITA Takuya + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +FML::Command::Admin::mailq first appeared in fml8 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + +1; diff --git a/fml/lib/FML/Process/Super.pm b/fml/lib/FML/Process/Super.pm deleted file mode 100644 index 89604320..00000000 --- a/fml/lib/FML/Process/Super.pm +++ /dev/null @@ -1,230 +0,0 @@ -#-*- perl -*- -# -# Copyright (C) 2003 Ken'ichi Fukamachi -# All rights reserved. -# -# $FML: Super.pm,v 1.3 2003/01/25 12:11:20 fukachan Exp $ -# - -package FML::Process::Super; - -use strict; -use Carp; -use vars qw($debug @ISA @EXPORT @EXPORT_OK); -use FML::Log qw(Log LogWarn LogError); -use FML::Config; - -use FML::Process::Kernel; -@ISA = qw(FML::Process::Kernel); - -my $debug = 0; - - -=head1 NAME - -FML::Process::Super -- small maintenance jobs on the queue spool - -=head1 SYNOPSIS - -=head1 DESCRIPTION - -This class drives provides utility funtions for the ML queue. - -=head1 METHODS - -=head2 C<new($args)> - -create a C<FML::Process::Kernel> object and return it. - -=head2 C<prepare($args)> - -ajdust ml_* variables, load config files and fix @INC. - -=head2 C<verify_request($args)> - -show help. - -=cut - - -# Descriptions: standard constructor -# Arguments: OBJ($self) HASH_REF($args) -# Side Effects: inherit FML::Process::Kernel -# Return Value: OBJ -sub new -{ - my ($self, $args) = @_; - my $type = ref($self) || $self; - my $curproc = new FML::Process::Kernel $args; - return bless $curproc, $type; -} - - -# Descriptions: fix ml_*, load config and fix @INC. -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: fix @INC -# Return Value: none -sub prepare -{ - my ($curproc, $args) = @_; - my $config = $curproc->{ config }; - - my $eval = $config->get_hook( 'fmlsuper_prepare_start_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } - - $curproc->resolve_ml_specific_variables( $args ); - $curproc->load_config_files( $args->{ cf_list } ); - $curproc->fix_perl_include_path(); - - $eval = $config->get_hook( 'fmlsuper_prepare_end_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } -} - - -# Descriptions: dummy to avoid to take data from STDIN -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: none -# Return Value: none -sub verify_request -{ - my ($curproc, $args) = @_; - my $argv = $curproc->command_line_argv(); - my $config = $curproc->{ config }; - - my $eval = $config->get_hook( 'fmlsuper_verify_request_start_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } - - if (length(@$argv) == 0 || (not $argv->[0])) { - $curproc->help(); - exit(0); - } - - $eval = $config->get_hook( 'fmlsuper_verify_request_end_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } -} - - -=head2 C<run($args)> - -small jobs on the queue maintenance. - -=cut - -# -# XXX-TODO: clean up run() more. -# - - -# Descriptions: convert text format article to HTML by Mail::Message::ToHTML -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: load modules, create HTML files and directories -# Return Value: none -sub run -{ - my ($curproc, $args) = @_; - my $config = $curproc->{ config }; - my $options = $curproc->command_line_options(); - - my $eval = $config->get_hook( 'fmlsuper_run_start_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } - - # if -p specified, run _purge(); - # if not, run _check(); - $curproc->_queue($args); - - $eval = $config->get_hook( 'fmlsuper_run_end_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } -} - - -# Descriptions: show help -# Arguments: none -# Side Effects: none -# Return Value: none -sub help -{ - use File::Basename; - my $name = basename($0); - -print <<"_EOF_"; - -Usage: $name [-p] ML - -options: - --p purge stale files. - -ML ml_name. Example: elena, rudo\@nuinui.net - -_EOF_ -} - - -# Descriptions: dummy to avoid to take data from STDIN -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: none -# Return Value: none -sub finish -{ - my ($curproc, $args) = @_; - my $config = $curproc->{ config }; - - my $eval = $config->get_hook( 'fmlsuper_finish_start_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } - - $eval = $config->get_hook( 'fmlsuper_finish_end_hook' ); - if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } -} - - -# Descriptions: dummy to avoid to take data from STDIN -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: none -# Return Value: none -sub DESTROY {} - - -# Descriptions: open mail queue and list up. -# Arguments: OBJ($curproc) HASH_REF($args) -# Side Effects: none -# Return Value: none -sub _queue -{ - my ($curproc, $args) = @_; - my $config = $curproc->config(); - my $queue_dir = $config->{ mail_queue_dir }; - - use Mail::Delivery::Queue; - my $queue = new Mail::Delivery::Queue { directory => $queue_dir }; - my $ra = $queue->list(); - - for my $qid (@$ra) { - print $qid, "\n"; - } -} - - -=head1 CODING STYLE - -See C<http://www.fml.org/software/FNF/> on fml coding style guide. - -=head1 AUTHOR - -Ken'ichi Fukamachi - -=head1 COPYRIGHT - -Copyright (C) 2003 Ken'ichi Fukamachi - -All rights reserved. This program is free software; you can -redistribute it and/or modify it under the same terms as Perl itself. - -=head1 HISTORY - -FML::Process::Super first appeared in fml8 mailing list driver package. -See C<http://www.fml.org/> for more details. - -=cut - - -1; |
