Subject: | End data with <CR><LF>.<CR><LF> Messages |
We are using MIME-Lite to send around 500 messages to 1000 subscribers
every day via postfix using sending via smtp.
This is a redhat enterprise server: 2.6.9-55.ELsmp #1 SMP Fri Apr 20
17:03:35 EDT 2007 i686 athlon i386 GNU/Linux
Perl is: This is perl, v5.8.8 built for i686-linux
postfix: mail_version = 2.2.10
The messages and the people to send to come from a database. We have a
program that merges up the subscribers and the messages and creates a
single message for each. The program can easily repeat any combination
of message or subscriber from it's command line.
I am sending using smtp:
MIME::Lite->send('smtp', 'localhost', Timeout=>10, SkipBad => 1);
I start a message like this:
my $msg = MIME::Lite->new(
'To' => $customerEmail,
'From' => 'yyyyyyyy@yyyyyyyyy.com',
'Subject' => $subject,
'Return-Path' => 'bounce@yyyyyyy.com',
'Reply-To' => $return,
'Type' => 'multipart/related',
'Sender'
=> 'bounce@yyyyyyyy.com',
'Comments' => "Cust: $customer->{'id'} Msg: $entry->
{'id'}",
);
To keep the send from aborting the program I run it in an eval:
eval {
$msg->send();
};
if ($@) {
print STDERR "Error: Broadcast_log $entry->{'id'} customer
$customer->{'id'}:$customer->{'email'} \n";
print STDERR "Email: $customerEmail\n";
print STDERR "Subject: $subject\n";
print STDERR "$@\n";
}
Out of several hundred recipients on any run, I get a few message that
look like:
Error: Broadcast_log 268915 customer 45:xxx@xxxxxxxxx.com
Email: xxx xxxxxx <xxx@xxxxxxxxx.com>
Subject: [yyy-yyyyyy] WTS: 40K1028 IBM HDD
Net::CMD (Net::SMTP) DATAEND command failed.
Last server message was:End data with <CR><LF>.<CR><LF>
This probably represents a problem with newline encoding
at /var/lib/Broadcaster/broadcastCron.pl line 108
If I re-run this combination of message and subscriber again I get no
error at all.
I have tried to match up the exact maillog entries against these errors
but it is made tougher by the fact that at any give minute there can be
as many a 7 copies of this program running at one time sending
different messages to the same person.
Initially I am wondering if you can help me gather some better
diagnostics about what is actually failing.
Thanks.