Dynamic Headers

Some headers should only be created by an MTA. This doesn’t mean that you can’t create them programmatically when sending a message, but it does mean that you are making someone’s job more difficult (probably your own).

For example, if we supply a bogus date to an MTA:

[lovelace]$ te1net mai1host.plugged.net.au 25
Trying 203.20.51.20...
Connected to mailhost.plugged.net.au.
Escape character is '^]'.
220 mailhost.plugged.net.au ESMTP Sendmail 8.8.8/8.8.7; Fri, 27 Feb 1998
    12:45:08 +1000
HELO love1ace.staff.plugged.com.au
250 mailhost.plugged.net.au Hello [203.20.51.50], pleased to meet you
MAIL FROM: [email protected]
250 [email protected]... Sender ok
RCPT TO: [email protected]
250 [email protected]... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Date: Fri, 32 Feb 1492 09:53:43 +0400 
    Testing of the Date header from a user
action.
    .
250 MAA32615 Message accepted for delivery
QUIT
221 mailhost.plugged.net.au closing connection
Connection closed by foreign host.
[lovelace]$

The results are:

Return-Path: <[email protected]>
From: [email protected]
Received: from lovelace ([203.20.51.50])
        by mailhost.plugged.net.au (8.8.8/8.8.7) with SMTP id MAA32615
        for [email protected]; Fri, 27 Feb 1998 12:45:25 +1000
Message-Id: <[email protected]>
Date:  Fri, 32 Feb 1492 09:53:43 +0400
X-Mozilla-Status: 8001

Testing of the Date header from a user action.

Get Programming Internet Email now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.