[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] Problem with msmtp date headers



On 09/04/08 10:26:26, liberte@...37... wrote:
> Hello.  I am running msmtp 1.4.13 on a Red Hat 4
> Linux server.
> 
> It seems that emails which are received when sent
> by calling either the
> 
> php mail() or
> perl mail()
> 
> functions results in a missing 'Sent:' field -- or
> a 'Sent:' field with the value of 'None'.  See below:

I use msmtp in a script. I do not insert the date as I leave that to my 
upstream SMTP server (my ISP's mail server) -- which it **should** do 
if there is no Date header.

However, I have found that if all lines in the "body" of the email 
message down to the first blank line are, in fact, headers then msmtp 
will interpret them accordingly. As I understand it, this is in 
accordance with RFC[2]821 and RFC[2]822 protocols.

I have found this very convenient for adding "additional" headers and 
for expanding the To and From headers from "recipient@...45..." and 
"sender@...138..." to the more modern "John Doe 
<recipient@...45...>" and "Richard Roe <sender@...138...>".

Perhaps you can hack your scripts to include a date header (see man 
date for the -R --rfc-2822 switch) before the first blank line in what 
would otherwise be the body of the message.

HTH,
Robert Thorsby
There are two ways of constructing a software design: one way is to
make it so simple that there are obviously no deficiencies; the other
is to make it so complicated that there are no obvious deficiencies.
		-- C. A. R. Hoare