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: stalled
Priority: 0/
Queue: Mail-Sender

Owner: cwhitener [...]
Requestors: se456 [...]

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 [...]
From: se456 [...]
In some circumstances Mail::Sender doesn't correctly deal with "from" addresses like the following:
    Realname <>

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:< >
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, 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 <>" 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.


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 infrastructure.

Please report any issues with to