I have an Ubuntu 18.04 server with Postfix configured to send through a local network mail relay.
Only when a message is generated by cron
does it include the following in the From:
header:
From: [email protected] (Cron Daemon)
All other messages from the server are as expected:
From: [email protected]
This is causing an issue for the relay DKIM signing and seems out of conformance with RFC 5322. My reading of 3.4 and Appendix A.5 is that the address most likely should be:
From: <[email protected]> (Cron Daemon)
However, I may be misunderstanding the RFC and there is some other problem.
Here is the current configuration, which is pretty much just the default "satellite" configuration created by the postfix
package:
postconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = loopback-only
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = $myhostname, relayclient.example.com, localhost.example.com, localhost
myhostname = relayclient.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 192.0.2.85
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
cat /etc/aliases
:
# See man 5 aliases for format
postmaster: root
root: [email protected]
cat /etc/mailname
:
relayclient.example.com
Notice the spec also includes comments:
EBNF (I ommited non-relevant tokens):
Notice
comment
token includes literal parenthesis, and the CFWS could be this comment (with whitespace around) or the whitespace itself. This part in the parethesis appears right at the end of theangle-addr
token, where comment is allowed. So this(Cron Daemon)
is aCFWS
, "comment or folding white space" token, and therefore the address as spelled fully conforms with the spec.Also there is a special note about naked
addr-spec
with thecomment
: