90 |
debug => 1, |
debug => 1, |
91 |
verbose => 1, |
verbose => 1, |
92 |
hash_len => 8, |
hash_len => 8, |
93 |
|
full_hostname_in_aliases => 0, |
94 |
); |
); |
95 |
|
|
96 |
Parametar C<hash_len> defines length of hash which will be added to each |
Parametar C<hash_len> defines length of hash which will be added to each |
97 |
outgoing e-mail message to ensure that replies can be linked with sent e-mails. |
outgoing e-mail message to ensure that replies can be linked with sent e-mails. |
98 |
|
|
99 |
|
C<full_hostname_in_aliases> will turn on old behaviour (not supported by Postfix |
100 |
|
postalias) to include full hostname in aliases file. |
101 |
|
|
102 |
|
|
103 |
=cut |
=cut |
104 |
|
|
105 |
sub new { |
sub new { |
106 |
my $class = shift; |
my $class = shift; |
107 |
my $self = {@_}; |
my $self = {@_}; |
108 |
bless($self, $class); |
bless($self, $class); |
109 |
|
|
110 |
croak "need at least dsn" unless ($self->{'dsn'}); |
croak "need at least dsn" unless ($self->{'dsn'}); |
871 |
$target .= qq#"| cd $self_path && ./sender.pl --inbox='$list'"#; |
$target .= qq#"| cd $self_path && ./sender.pl --inbox='$list'"#; |
872 |
|
|
873 |
# remove hostname from email to make Postfix's postalias happy |
# remove hostname from email to make Postfix's postalias happy |
874 |
$email =~ s/@.+//; |
$email =~ s/@.+// if (not $self->{full_hostname_in_aliases}); |
875 |
|
|
876 |
if ($a->exists($email)) { |
if ($a->exists($email)) { |
877 |
$a->update($email, $target) or croak "can't update alias ".$a->error_check; |
$a->update($email, $target) or croak "can't update alias ".$a->error_check; |
879 |
$a->append($email, $target) or croak "can't add alias ".$a->error_check; |
$a->append($email, $target) or croak "can't add alias ".$a->error_check; |
880 |
} |
} |
881 |
|
|
882 |
#$a->write($aliases) or croak "can't save aliases $aliases ".$a->error_check; |
# $a->write($aliases) or croak "can't save aliases $aliases ".$a->error_check; |
883 |
|
|
884 |
return 1; |
return 1; |
885 |
} |
} |
1043 |
=cut |
=cut |
1044 |
|
|
1045 |
sub new { |
sub new { |
1046 |
my $class = shift; |
my $class = shift; |
1047 |
my $self = {@_}; |
my $self = {@_}; |
1048 |
|
|
1049 |
croak "need aliases parametar" unless ($self->{'aliases'}); |
croak "need aliases parametar" unless ($self->{'aliases'}); |
1050 |
|
|
1241 |
seems that SOAP::Lite client thinks that it has array with one element which |
seems that SOAP::Lite client thinks that it has array with one element which |
1242 |
is array of hashes with data. |
is array of hashes with data. |
1243 |
|
|
1244 |
|
=head1 PRIVATE METHODS |
1245 |
|
|
1246 |
|
Documented here because tests use them |
1247 |
|
|
1248 |
|
=head2 _nos_object |
1249 |
|
|
1250 |
|
my $nos = $nos->_nos_object; |
1251 |
|
|
1252 |
|
=cut |
1253 |
|
|
1254 |
|
sub _nos_object { |
1255 |
|
return $nos; |
1256 |
|
} |
1257 |
|
|
1258 |
=head1 EXPORT |
=head1 EXPORT |
1259 |
|
|
1260 |
Nothing. |
Nothing. |