]> source.dussan.org Git - rspamd.git/commitdiff
Honor deliver_to argument in Mail::Rspamd::Client
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 21 Oct 2010 16:05:24 +0000 (20:05 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 21 Oct 2010 16:05:24 +0000 (20:05 +0400)
perl/lib/Mail/Rspamd/Client.pm

index cbafcec8f5a12745db6f6a48ed3112c1c743fd9b..6cc316b2fc8998e8d62d2c6ec1ef3644d87be7d3 100644 (file)
@@ -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";