From 8c7ee775ff127e018ebb5d8768b652e7c1d539f1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 21 Oct 2010 20:05:24 +0400 Subject: [PATCH] Honor deliver_to argument in Mail::Rspamd::Client --- perl/lib/Mail/Rspamd/Client.pm | 14 +++++++++----- 1 file 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"; -- 2.39.5