On 5/11/20 8:14 AM, Tim via users wrote:
On Mon, 2020-05-11 at 17:43 +0800, Ed Greshko wrote:
I also think it is a good idea to see the format of what procmail is
getting from cron and comparing it to what ends up delivered by an
MTA such as postfix.
From egreshko ..... is missing along with
Return-Path:
Delivered-To:
Received: by
Message-Id:
Date:
The MTA modifies the From: and To: lines to add a FQDN.
And, yes, not all of those are "required".
I was of the understanding that a "From line" is a MBOX thing,
different from the From: header of an email.
I knew Message-Id isn't required to be supplied from the authoring
program, though having a unique ID right from the start would make it
easier to identify all messages from start to finish (identify on the
originator's archive of their sent messages before it went out to a
SMTP server, with its return and replies, etc).
Many of the other possible headers are also part of the mail delivery
system, so wouldn't actually come from the message authoring program.
I'd (logically) expect the SMTP server to fill in return-path, etc.
Here is a sample of the headers provided by cron:
From: "(Cron Daemon)" <rgm>
To: rgm
Subject: Cron <rgm@lx140e> rsync -tvz
rsync.tools.ietf.org::tools.id/*-hip-*.xml
/home/common/ietf/drafts/xml
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=270>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/1000>
X-Cron-Env: <DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus>
X-Cron-Env: <XDG_SESSION_TYPE=unspecified>
X-Cron-Env: <XDG_SESSION_CLASS=background>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=rgm>
X-Cron-Env: <HOME=/home/rgm>
X-Cron-Env: <LOGNAME=rgm>
X-Cron-Env: <USER=rgm>
Status: RO
Content-Length: 101
Lines: 3
The biggie is no DATE: header. And the MTA can only apply a DATE:
header for the time it received the cron output. The time the cron task
started is lost. This is a bug in cron from day 1, it seems and I will
be submitting this whole shebang as a bug. :)
The FROM: header could be better as <$USER@$HOSTNAME>, but HOSTNAME is
not one of the env variable know to cron. Yet another bug. ;)
The TO: header is the same concern. Would be better, but it works as is.
No DATE: really is a problem.
MESSAGE-ID: would be a nice addition. All improvements that SHOULD be
provided by cron, not a post-processor.
I am sure I could fix my script to do all of these, other than the
datetime cron started the task. I might still....
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx