[lug] SMTP Headers, from perl module

Elyse Grasso emgrasso at data-raptors.com
Tue Jul 8 16:54:06 MDT 2003


On Tuesday 08 July 2003 04:47 pm, Scotty Allen wrote:
> On Tue, 2003-07-08 at 14:32, Elyse Grasso wrote:
> > Does anyone have any experience using the Net::SMTP perl module?
> > 
> > My messages seem to be being sent without dates, and my message body 
> > seems to be being seen as a malformed header when talking to a qmail 
> > server on a linux host. (The script is running on a Windows client 
> > machine.)
> > 
> > I've used the same email subroutine before without seeing the date 
> > problem.
> [snip]
> 
> Net::SMTP doesn't really handle much header functionality.  To have
> fields like subject and date, you need to make your own header.  This 
is
> simply a matter of adding the various necessary header fields, one per
> line, to the top of the message, seperated from the main body by a
> newline.  I usually add To:, From:, Subject:, and Date:.  For the 
date,
> I usually just use the string output from localtime().
> 
> It looks like your script might be trying to add a date field, but is
> doing so in the wrong format.  It should be in the form "Date: Sun, 6
> Jul 2003 11:01:49 -0600" and not have any newlines between it and the
> rest of the header.
> 
> Also, looks like SpamAssassin is the one complaining about the lack of 
a
> date field.  I think qmail doesn't really care, since it timestamps it
> itself anyway.
> 
> HTH,
> 
> Scotty

I got it fixed, thanks... the SpamAssassin complaints weren't the 
problem, messages coming in with display dates in December 1969 were 
the main problem.

-- 
Elyse Grasso

http://www.data-raptors.com    Computers and Technology
http://www.astraltrading.com   Divination and Science Fiction



More information about the LUG mailing list