Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Sender CPAN distribution.

Report information
The Basics
Id: 106008
Status: open
Priority: 0/
Queue: Mail-Sender

People
Owner: cwhitener [...] gmail.com
Requestors: se456 [...] rohan.id.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Mail::Sender incorrectly extracts From address when using SMTP auth
Date: Wed, 22 Jul 2015 15:31:54 +0800
To: bug-Mail-Sender [...] rt.cpan.org
From: se456 [...] rohan.id.au
In some circumstances Mail::Sender doesn't correctly deal with "from" addresses like the following:
    Realname <local@dompart.com>

I'm also explicitly defining auth=>"PLAIN",tls_required=>1,authid=>"xxx",authpwd=>"yyy"

It ends up sending this during the SMTP transaction:
   MAIL FROM:<local@dompart.com >
Notice the extra space before the end of the line, which is rejected by strict mail servers.

I suspect it's something to do with line 1366 in Sender.pm, but I don't understand what it's trying to do:
$_ = send_cmd $s, "MAIL FROM:<$self->{'fromaddr'}>$self->{esmtp}{_MAIL_FROM}";
And also line 227:
$self->{esmtp}{_MAIL_FROM} .= " $_=$self->{esmtp}{$_}"
                if $self->{esmtp}{$_} ne '';

However it handles "to" addresses like "Realname <local@dompart.com>" fine.


My workaround is to pre-process the 'from' address in the caller, like this:

use Mail::Address;
my @a = Mail::Address->parse($from);
$smtp_from = return $a[0]->address;

I supply $smtp_from as the "from" value, and $from as the "fake_from" value.


Thanks,

Rohan Carly.
Download (untitled) / with headers
text/plain 105b
Hi Rohan, Thanks! I'll look into this as soon as I can get some more tests generated. Thanks, Chase


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.