Improve error messages from the Postfix module (Erik I. Bols�,
<knan at mo.himolde.no>) make the maildir plugin record who the message was to (needs some improvements still) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@277 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
154ca2e617
commit
e27534048c
3
Changes
3
Changes
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
[ many changes from cvs logs, gah ]
|
[ many changes from cvs logs, gah ]
|
||||||
|
|
||||||
|
Improve error messages from the Postfix module (Erik I. Bolsø,
|
||||||
|
<knan at mo.himolde.no>)
|
||||||
|
|
||||||
Mail::Address does RFC822 addresses, we need SMTP addresses.
|
Mail::Address does RFC822 addresses, we need SMTP addresses.
|
||||||
Replace Mail::Address with Peter J. Holzer's Qpsmtpd::Address module.
|
Replace Mail::Address with Peter J. Holzer's Qpsmtpd::Address module.
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ sub open_cleanup {
|
|||||||
my ($class) = @_;
|
my ($class) = @_;
|
||||||
my $self = IO::Socket::UNIX->new(Type => SOCK_STREAM,
|
my $self = IO::Socket::UNIX->new(Type => SOCK_STREAM,
|
||||||
Peer => "/var/spool/postfix/public/cleanup");
|
Peer => "/var/spool/postfix/public/cleanup");
|
||||||
|
die qq[Couldn't open unix socket "/var/spool/postfix/public/cleanup": $!] unless ref $self;
|
||||||
bless ($self, $class);
|
bless ($self, $class);
|
||||||
$self->init();
|
$self->init();
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -19,6 +19,8 @@ use Time::HiRes qw(gettimeofday);
|
|||||||
sub register {
|
sub register {
|
||||||
my ($self, $qp, @args) = @_;
|
my ($self, $qp, @args) = @_;
|
||||||
|
|
||||||
|
# TODO: support per user/domain/? maildirs
|
||||||
|
|
||||||
if (@args > 0) {
|
if (@args > 0) {
|
||||||
($self->{_maildir}) = ($args[0] =~ m!([/\w\.]+)!);
|
($self->{_maildir}) = ($args[0] =~ m!([/\w\.]+)!);
|
||||||
}
|
}
|
||||||
@ -51,6 +53,10 @@ sub queue_handler {
|
|||||||
my $file = join ".", $time, $unique, $self->{_hostname};
|
my $file = join ".", $time, $unique, $self->{_hostname};
|
||||||
my $maildir = $self->{_maildir};
|
my $maildir = $self->{_maildir};
|
||||||
|
|
||||||
|
# TODO: deliver the mail once per recipient instead
|
||||||
|
$transaction->header->add('Delivered-To', $_->address, 0)
|
||||||
|
for $transaction->recipients;
|
||||||
|
|
||||||
open (MF, ">$maildir/tmp/$file") or
|
open (MF, ">$maildir/tmp/$file") or
|
||||||
$self->log(LOGWARN, "could not open $maildir/tmp/$file: $!"),
|
$self->log(LOGWARN, "could not open $maildir/tmp/$file: $!"),
|
||||||
return(DECLINED, "queue error (open)");
|
return(DECLINED, "queue error (open)");
|
||||||
|
Loading…
Reference in New Issue
Block a user