Red Hat Bugzilla – Bug 1303422
satellite sync hard coded email FROM does not allow customization for email addresses
Last modified: 2017-06-21 08:17:18 EDT
Description of problem:
satellite-sync currently does not support a default_mail_from address similar to the webui. rather the address is hard coded to root@host which can produce issues for customers when the server uses a short name and mail relays require fqdn. A patch will be included for review to use a config variable, default_mail_from, in the satellite.server CFG namespace to overcome this issue.
Created attachment 1119915 [details]
patch to add default_mail_from support to satsync
In the attached patch, if parseaddr fails, then sndr ends up as ''. Can we instead notice this, log an error, and default back to root@host_label? Otherwise, the emails arrive with no From line, and it makes it much harder for the customer to figure out what machine has a cfg-problem.
Grant, I'll take a look when I am back in the office but good catch. Will fix it up.
Created attachment 1120892 [details]
sat sync patch for default mail
this patch removes the need for the parse address lib
1) modify rhn.conf and break the sat sync by modifying parent with a bogus name
server.satellite.rhn_parent = ssatellite.rhn.redhat.com
2) Add a new config var for the default email address for satellite.server namespace in rhn.conf
server.satellite.default_mail_from = user@fqdn
3) run satsync with email option, tail the /var/log/maillog file
satellite-sync -l --email
4) confirm mail from address shows up in /var/log/maillog
5) now comment out the server.satellite.default_mail_from config var. rerun sat sync. Confirm the mail from address is now root@hostname in /var/log/maillog
NOTE: use the included patch when applying to Satellite, the pune-to-puny namechange will get in the way of cherry-picking the SW commit
The patch can be found here -
But according to Comment 6, there may be more changes needed.
VERIFIED on spacewalk-backend-2.5.3-137 (SAT5.8_20170529)
1. Add "default_mail_from" into rhn.conf
> echo "server.satellite.default_mail_from = email@example.com" >> /etc/rhn/rhn.conf
2. Sync some channel
> cdn-sync -c rhn-tools-rhel-x86_64-server-5 --email
3. Check mailbox
N 11 firstname.lastname@example.org Thu Jun 1 07:28 661/46162 "CDN sync. report from host-8-179-109.host.centralc"