Change email alert return address

Is there a way to change the return address on email alerts from STOR2RRD? Our alerting system requires a specific return address. 

Comments

  • Hi,

    it is hardcoded, you can change it here:
    bin/AlertStor2rrd.pm lines 1691 and 140
      my $mailfrom = "stor2rrd";


    Bad thing is that you have to do it again after next upgrade.
    We will think about parametrisation for the future ...





  • Thank you.
  • Looks like there is a hard coded email from "lpar2rrd" somewhere. On hardware failures I am getting a "rejected" email from this from address. Where might this be in the code?
    Thanks,
  • if you use the latest code 2.01 then there is definitelly user stor2rrd for HW alerting:

    bin/Xorux_lib.pm line 211
      my $mailfrom = "stor2rrd";



  • Running the latest code 2.01, and that location "mailfrom" was changed. But receiving hardware errors  "from": "lpar2rrd@xxx.com" in my alert system. 
  • Found a solution to my issue, so thought I would share. Used postfix to resolve. 

    Added the following to last line of /etc/postfix/main.cf file
    smtp_generic_maps = hash:/etc/postfix/generic

    Added the following to the last line of /etc/postfix/generic
    lpar2rrd user@fqdn
    stor2rrd user@fqdn

    Ran
    postmap /etc/postfix/generic

    Restarted postfix
    service postfix restart

    With this I still needed to change the mailfrom in AlertStor2rrd.pm and Xorux_lib.pm files, but it is now sending from the address I needed.
  • ok, I tested actual solution and sendmail ignores "from:" item and places there actuall Unix user name.

    how did you change mailfrom variable in AlertStor2rrd.pm and Xorux_lib.pm?



  • I changed the mailfrom variable in the code as per your instructions above. 
Sign In or Register to comment.