--- trunk/Nos.pm 2006/09/21 10:49:00 87 +++ jifty-dbi/Nos.pm 2006/12/18 19:38:50 91 @@ -90,16 +90,21 @@ debug => 1, verbose => 1, hash_len => 8, + full_hostname_in_aliases => 0, ); Parametar C defines length of hash which will be added to each outgoing e-mail message to ensure that replies can be linked with sent e-mails. +C will turn on old behaviour (not supported by Postfix +postalias) to include full hostname in aliases file. + + =cut sub new { - my $class = shift; - my $self = {@_}; + my $class = shift; + my $self = {@_}; bless($self, $class); croak "need at least dsn" unless ($self->{'dsn'}); @@ -866,7 +871,7 @@ $target .= qq#"| cd $self_path && ./sender.pl --inbox='$list'"#; # remove hostname from email to make Postfix's postalias happy - $email =~ s/@.+//; + $email =~ s/@.+// if (not $self->{full_hostname_in_aliases}); if ($a->exists($email)) { $a->update($email, $target) or croak "can't update alias ".$a->error_check; @@ -874,7 +879,7 @@ $a->append($email, $target) or croak "can't add alias ".$a->error_check; } - #$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; return 1; } @@ -1038,8 +1043,8 @@ =cut sub new { - my $class = shift; - my $self = {@_}; + my $class = shift; + my $self = {@_}; croak "need aliases parametar" unless ($self->{'aliases'}); @@ -1236,6 +1241,20 @@ seems that SOAP::Lite client thinks that it has array with one element which is array of hashes with data. +=head1 PRIVATE METHODS + +Documented here because tests use them + +=head2 _nos_object + + my $nos = $nos->_nos_object; + +=cut + +sub _nos_object { + return $nos; +} + =head1 EXPORT Nothing.