On Wed, 14 Jul 2004 17:01:25 -0700
Ask Bj�rn Hansen <[EMAIL PROTECTED]> wrote:
> On Jun 18, 2004, at 4:01 AM, Peter J. Holzer wrote:
>
> > On 2004-06-17 12:57:20 -0700, Ask Bj�rn Hansen wrote:
> >> The solution is to implement an object (Qpsmtpd::MailAddress for
> >> example) to handle the SMTP envelope addresses. Patches welcome!
> >:-)
> >
> > I wrote this a few weeks ago (but didn't post it because it croaked
> > on certain malformed addresses - that should be fixed now).
>
> I just added your Qpsmtpd::Address module to CVS (with a tiny change
> to suppress a use of uninitialized value warning).
Err... it's not in CVS on cvs.perl.org. The change in Qpsmtpd::SMTPD
is, but not the lib/Qpsmtpd/Address.pm.
But this doesn't fix the issue in Qpsmtpd::SMTPD::mail().
my ($from) = ($from_parameter =~ m/^from:\s*(\S+)/i)[0];
It get's just a partial address (i.e. everything up to the first space).
IMO the best thing would be to get the full line and then strip any
service parameters -> /BODY=(7|8)BIT(MIME)?/ or a possible /SIZE=(\d+)/.
See attached diff for example.
Hanno
--- lib/Qpsmtpd/SMTP.pm.orig Thu Jul 15 01:58:47 2004
+++ lib/Qpsmtpd/SMTP.pm Thu Jul 15 17:55:18 2004
@@ -226,7 +226,9 @@
else {
my $from_parameter = join " ", @_;
$self->log(LOGINFO, "full from_parameter: $from_parameter");
- my ($from) = ($from_parameter =~ m/^from:\s*(\S+)/i)[0];
+ my ($from) = ($from_parameter =~ m/^from:\s*(.*)/i)[0];
+ ### we offer 8BITMIME on EHLO:
+ $from =~ s/\s+BODY=(7|8)BIT(MIME)?//;
warn "$$ from email address : [$from]\n";
if ($from eq "<>" or $from =~ m/\[undefined\]/) {
$from = Qpsmtpd::Address->new("<>");