Bug 569745 - NOCpulse npBootstrap.pl needs 'From' and 'Reply-To' fields added to email configuration
Summary: NOCpulse npBootstrap.pl needs 'From' and 'Reply-To' fields added to email con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 0.8
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space09
TreeView+ depends on / blocked
 
Reported: 2010-03-02 09:26 UTC by Miroslav Suchý
Modified: 2010-07-12 16:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 484612
Environment:
Last Closed: 2010-05-05 14:57:02 UTC
Embargoed:


Attachments (Terms of Use)

Description Miroslav Suchý 2010-03-02 09:26:21 UTC
+++ This bug was initially created as a clone of Bug #484612 +++

This problem has to do with the mechanism for sending mail inside the MonitoringScout service when it starts up. We wants that email to be sent with a custom "from" and "reply-to" section.  Right now, the email is sent from a static HTTPS-MX email address.  There are many configuration directives that could be used to satisfy this from the config files, however they are never called.

Here's the program flow for the start up script to the email being sent:
/home/nocpulse/bin/npBootstrap.pl
-> populates $gritchMsg with output string found in email that needs to be changed.
-> Line 116:  $soapbox->gritch("Email subject", $gritchMsg);  # called to send message

/usr/lib/perl5/site_perl/5.8.5/NOCpulse/Gritch.pm
-> Line 64:  $self->mx gets populated from the "targetMX" config directive "gritch" section of /etc/NOCpulse.ini
-> Line 211: $self->sendmail($subject,$message); # sends the mail
-> Line 385: Starts to create a LWP request to https://satellite/cgi-bin/https_mx.cgi
-> Line 400: Makes HTTPS request to itself on /cgi-bin/https_mx.cgi

/etc/httpd/conf/rhn/rhn_monitoring.conf
-> Line 34:  Creates a handler for /cgi-bin/https_mx.cgi to be NOCpulse::HttpsMX

/usr/lib/perl5/site_perl/5.8.5/NOCpulse/HttpsMX.pm
-> Line 32:  Sends a mail message from to, subject and body parameters passed to cgi.

There is nothing in this process that configures the "from" field in the email.  That value is statically set to HTTPS-MX in the invocation of the sendmail command.  In order for this to work, there would need to be a configuration directive placed into the /etc/NOCpulse.ini file (replyToEmail maybe?) which Gritch.pm would need to use to send the mail.  Then, a corresponding POST parameter in HttpsMX.pm to accept another parameter for from/reply-to.  

In all honesty, the HttpsMx.pm module should be beefed up substantially to handle advanced configurations.  It would take minimal changes and provide much more flexible notifications.

Comment 1 Miroslav Suchý 2010-03-02 10:28:48 UTC
The From header is added using commit 1980d499ed844cbe13d3c2d49ce10a39db4a69c4
When I was in that part code I removed all manual and naive calling like 'open "| sendmail"' and start using Mail::Send - commit ae8275b5435a56e322387c060ca5d91c5dc79ab1

Comment 2 Miroslav Suchý 2010-05-05 14:57:02 UTC
This bug has been fixed in Spacewalk 1.0.
Closing.


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