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 /fml/lib | |
| 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.
Diffstat (limited to 'fml/lib')
| -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 |
3 files changed, 118 insertions, 231 deletions
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; |
