diff options
| author | fukachan <fukachan> | 2002-04-24 03:59:14 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-24 03:59:14 +0000 |
| commit | 7e7532704084193ca042ab8f307b19b7a28ec75a (patch) | |
| tree | abe0894d46ee1ba5810290dfbce240cb573571f8 /fml/lib | |
| parent | 8c488107c3518bf9e15e79aa833afc6e10e85676 (diff) | |
| download | fml8-7e7532704084193ca042ab8f307b19b7a28ec75a.tar.gz fml8-7e7532704084193ca042ab8f307b19b7a28ec75a.tar.bz2 fml8-7e7532704084193ca042ab8f307b19b7a28ec75a.zip | |
FML::Command::PostfixControl -> FML::MTAControl
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Command/Admin/newml.pm | 7 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/rmml.pm | 7 | ||||
| -rw-r--r-- | fml/lib/FML/MTAControl.pm | 97 |
3 files changed, 105 insertions, 6 deletions
diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm index c2411d1a..243f14f2 100644 --- a/fml/lib/FML/Command/Admin/newml.pm +++ b/fml/lib/FML/Command/Admin/newml.pm @@ -4,7 +4,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: newml.pm,v 1.26 2002/04/23 09:30:22 fukachan Exp $ +# $FML: newml.pm,v 1.27 2002/04/24 03:50:00 fukachan Exp $ # package FML::Command::Admin::newml; @@ -191,9 +191,10 @@ sub _update_aliases append($dst, $alias); unlink $dst; - use FML::Command::PostfixControl; - my $postfix = new FML::Command::PostfixControl; + use FML::MTAControl; + my $postfix = new FML::MTAControl; $postfix->update_alias($curproc, { + mta_type => 'postfix', alias_maps => [ $alias ], }); }; diff --git a/fml/lib/FML/Command/Admin/rmml.pm b/fml/lib/FML/Command/Admin/rmml.pm index 0a86c66f..20723568 100644 --- a/fml/lib/FML/Command/Admin/rmml.pm +++ b/fml/lib/FML/Command/Admin/rmml.pm @@ -4,7 +4,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: rmml.pm,v 1.1 2002/04/23 09:31:08 fukachan Exp $ +# $FML: rmml.pm,v 1.2 2002/04/24 03:50:01 fukachan Exp $ # package FML::Command::Admin::rmml; @@ -165,9 +165,10 @@ sub _update_aliases if ($self->_alias_has_ml_entry($alias, $ml_name)) { $self->_remove_alias_entry($alias, $ml_name); eval q{ - use FML::Command::PostfixControl; - my $postfix = new FML::Command::PostfixControl; + use FML::MTAControl; + my $postfix = new FML::MTAControl; $postfix->update_alias($curproc, { + mta_type => 'postfix', alias_maps => [ $alias ], }); }; diff --git a/fml/lib/FML/MTAControl.pm b/fml/lib/FML/MTAControl.pm new file mode 100644 index 00000000..b76b664a --- /dev/null +++ b/fml/lib/FML/MTAControl.pm @@ -0,0 +1,97 @@ +#-*- perl -*- +# +# Copyright (C) 2002 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: PostfixControl.pm,v 1.3 2001/12/23 03:50:26 fukachan Exp $ +# + +package FML::MTAControl; +use strict; +use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); +use Carp; + +=head1 NAME + +FML::MTAControl - postfix utilities + +=head1 SYNOPSIS + + nothing implemented yet. + +=head1 DESCRIPTION + +=head1 METHODS + +=cut + + +# Descriptions: standard 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: update alias +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: OBJ +sub update_alias +{ + my ($self, $curproc, $optargs) = @_; + my $mta_type = $optargs->{ mta_type }; + + if ($mta_type eq 'postfix') { + $self->postfix_update_alias($curproc, $optargs); + } + else { + croak("unknown MTA"); + } +} + + +# Descriptions: update alias +# Arguments: OBJ($self) +# Side Effects: none +# Return Value: OBJ +sub postfix_update_alias +{ + my ($self, $curproc, $optargs) = @_; + my $config = $curproc->{ config }; + my $prog = $config->{ path_postalias }; + my $maps = $optargs->{ alias_maps }; + + for my $alias (@$maps) { + system "$prog $alias"; + } +} + + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2002 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::MTAControl appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + +1; |
