PDA

View Full Version : problem with Perl MIME::Lite and bounced eMail



wschutz
02-17-2010, 09:09 AM
i tried searching for "subvert", but no hits, so I'm creating this thread.

I have a Perl cgi program that sends eMail via MIME::Lite. When it sends the email I get the following back in the inBox "From" field:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

erielackman@aol.com
This message has been rejected because it has
an overlength date field which can be used
to subvert Microsoft mail programs
The following URL has further information
http://www.securityfocus.com/frames/?content=/templates/article.html%3Fid%3D61

------ This is a copy of the message, including all the headers. ------

Return-path: <webmaster@streethealthproviders.com>
Received: from host392.hostmonster.com ([66.147.240.192] helo=localhost.localdomain)
by host392.hostmonster.com with esmtpa (Exim 4.69)
(envelope-from <webmaster@streethealthproviders.com>)
id 1Nhkkw-0008P0-QG
for erielackman@aol.com; Wed, 17 Feb 2010 07:19:58 -0700
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Date: Wed, 17 Feb 2010 07:19:58 -0700
From: webmaster@streethealthproviders.com
....

Any thoughts? What Perl Mod to others use to send eMail from hostmonster?
:eek:

shadmego
02-17-2010, 11:30 AM
The only thing I can think of here is that the return characters for the date field are incorrect.

It's very difficult to guess because the security focus link you provided hasn't seemed to work since about 2002. Plus we don't have the code that created the email in the first place.

I do know that this problem might be related to return characters. Email should have "\r\n" at the end of every line.

Any other information you can provide?

wschutz
02-18-2010, 07:31 AM
MIME::Lite->send('smtp', $smtpServer, Timeout=>30);

my $msg = MIME::Lite->new(
From =>$smtpSelfId,
Data =>$mailTextRef->{Body}
);

$msg -> build ( 'To' => $mailTextRef->{'To'} ) ;

$msg -> build ( 'Subject' => $mailTextRef->{'Subject'} ) if $mailTextRef->{'Subject'};
$msg -> build ( 'Reply-To' => $mailTextRef->{'Reply-To'} ) if $mailTextRef->{'Reply-To'};
$msg -> build ( 'Disposition-Notification-To:' => $mailTextRef->{'Disposition-Notification-To'} )
if $mailTextRef->{'Disposition-Notification-To'};

$msg->send("smtp", $smtpServer,
To=>$toAddrRef, Debug=>$smtpDebug, AuthUser=>$smtpSelfId, AuthPass=>$smtpPassword);


For the time being I'm just using raw Net::SMTP, which works, but I'd prefer to use MIME.

shadmego
02-18-2010, 10:32 AM
I just found this link that while not software related to your problem, it seems to be error-related.

Let me know if this helps you pinpoint the problem:

http://www.ecommy.com/web-development/overlength-date-field-error-in-prestashop