Bug 1303422 - satellite sync hard coded email FROM does not allow customization for email addresses
Summary: satellite sync hard coded email FROM does not allow customization for email a...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization
Version: 580
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Grant Gainey
QA Contact: Martin Korbel
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2016-01-31 16:04 UTC by Shannon Hughes
Modified: 2019-11-14 07:23 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:17:18 UTC
Target Upstream Version:


Attachments (Terms of Use)
patch to add default_mail_from support to satsync (1.64 KB, application/mbox)
2016-01-31 16:32 UTC, Shannon Hughes
no flags Details
sat sync patch for default mail (1.34 KB, application/mbox)
2016-02-03 19:13 UTC, Shannon Hughes
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1278443 0 None None None 2016-02-03 17:09:23 UTC

Description Shannon Hughes 2016-01-31 16:04:43 UTC
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.

Comment 1 Shannon Hughes 2016-01-31 16:32:07 UTC
Created attachment 1119915 [details]
patch to add default_mail_from support to satsync

Comment 2 Grant Gainey 2016-02-02 12:55:17 UTC
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.

Comment 3 Shannon Hughes 2016-02-02 15:36:37 UTC
Grant, I'll take a look when I am back in the office but good catch. Will fix it up.

Comment 4 Shannon Hughes 2016-02-03 19:13:40 UTC
Created attachment 1120892 [details]
sat sync patch for default mail

this patch removes the need for the parse address lib

Comment 5 Shannon Hughes 2016-02-03 19:17:12 UTC
test plan: 

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

Comment 6 Grant Gainey 2016-02-19 19:38:18 UTC
spacewalk.github c6369d1f57b352e49b116e677f5d2fbc5831d703

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

Comment 13 Tomas Lestach 2016-04-06 08:18:11 UTC
The patch can be found here - 
https://github.com/spacewalkproject/spacewalk/commit/c6369d1f57b352e49b116e677f5d2fbc5831d703
But according to Comment 6, there may be more changes needed.

Comment 15 Martin Korbel 2017-06-01 11:34:28 UTC
VERIFIED on spacewalk-backend-2.5.3-137  (SAT5.8_20170529)

Reproducer:
1. Add "default_mail_from" into rhn.conf
 > echo "server.satellite.default_mail_from = tester" >> /etc/rhn/rhn.conf
2. Sync some channel
 >  cdn-sync -c rhn-tools-rhel-x86_64-server-5  --email
3. Check mailbox
 > mail
  ...
  N 11 tester    Thu Jun  1 07:28 661/46162 "CDN sync. report from host-8-179-109.host.centralc"


Note You need to log in before you can comment on or make changes to this bug.