#1076141 apticron: When using CUSTOM_FROM with bsd-mailx, -r should be used instead of -a to override from

#1076141#5
Date:
2024-07-11 11:39:18 UTC
From:
To:
In the Mailx() function of apticron, if the mailx binary is neither heirloom-mailx/s-nail, then mailx is used with the -a option to override the email sender address.
At least with bsd-mailx doing so will only change the From in the mail header but not the From of the enveloppe. Using -r in needed to override the envelope
On systems with a minimal mta configuration to send outgoing emails, this is likely to cause email delivery problem as the enveloppe will be root@hostname.fqdn and might be rejected by the remote mta if hostname.fqdn doesn't actualy exists.

Extract from bsd-mailx man page:

     -r from-addr
             Use from-addr as the from address in the message and envelope.  Overrides any from options in the startup files.

So I would suggest to use -r instead of -a when bsd-mailx is the mailx binary, as it's done when it's heirloom-mailx/s-nail, to improve deliverability.