aboutsummaryrefslogtreecommitdiffstats
path: root/perl/lib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-21 20:05:24 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-21 20:05:24 +0400
commit8c7ee775ff127e018ebb5d8768b652e7c1d539f1 (patch)
tree9cf68a97775d3e2ccb019a4826b17eb2142c4ebf /perl/lib
parent7a09c641f8caaefa697013540166f0a7f3857321 (diff)
downloadrspamd-8c7ee775ff127e018ebb5d8768b652e7c1d539f1.tar.gz
rspamd-8c7ee775ff127e018ebb5d8768b652e7c1d539f1.zip
Honor deliver_to argument in Mail::Rspamd::Client
Diffstat (limited to 'perl/lib')
-rw-r--r--perl/lib/Mail/Rspamd/Client.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/perl/lib/Mail/Rspamd/Client.pm b/perl/lib/Mail/Rspamd/Client.pm
index cbafcec8f..6cc316b2f 100644
--- a/perl/lib/Mail/Rspamd/Client.pm
+++ b/perl/lib/Mail/Rspamd/Client.pm
@@ -76,6 +76,9 @@ sub new {
if ($args->{rcpt}) {
$self->{rcpt} = $args->{rcpt};
}
+ if ($args->{deliver_to}) {
+ $self->{deliver_to} = $args->{deliver_to};
+ }
if ($args->{timeout}) {
$self->{timeout} = $args->{timeout};
}
@@ -879,11 +882,12 @@ sub _do_rspamc_command {
return \%r;
}
syswrite $remote, "Content-length: $msgsize$EOL";
- syswrite $remote, "User: $self->{username}$EOL" if ($self->{username});
- syswrite $remote, "From: $self->{from}$EOL" if ($self->{from});
- syswrite $remote, "IP: $self->{ip}$EOL" if ($self->{ip});
- syswrite $remote, "Subject: $self->{subject}$EOL" if ($self->{subject});
- syswrite $remote, "Pass: all$EOL" if ($self->{pass_all});
+ syswrite $remote, "User: $self->{username}$EOL" if (exists($self->{username}));
+ syswrite $remote, "From: $self->{from}$EOL" if (exists($self->{from}));
+ syswrite $remote, "IP: $self->{ip}$EOL" if (exists($self->{ip}));
+ syswrite $remote, "Deliver-To: $self->{deliver_to}$EOL" if (exists($self->{deliver_to}));
+ syswrite $remote, "Subject: $self->{subject}$EOL" if (exists($self->{subject}));
+ syswrite $remote, "Pass: all$EOL" if (exists($self->{pass_all}) && $self->{pass_all});
if (ref $self->{rcpt} eq "ARRAY") {
foreach ($self->{rcpt}) {
syswrite $remote, "Rcpt: $_ $EOL";