AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  Change "from address" in mail command?

    Posted Tue June 14, 2011 10:54 AM

    Originally posted by: CHPrjohnso


    We often send e-mail messages from different scripts which run on the AIX servers to our own e-mail addresses. The Messaging group tells us that there is a problem with the the source address coming up as user@machine.domain.org instead of user@domain.org.

    I send e-mail with this syntax: echo Message | mail -s Subject user@domain.com

    Is there an EASY way to change the source address? I've been playing with sendmail -f option but it's giving error messages, not liking the subject, missing the target address in the message, etc.


  • 2.  Re: Change "from address" in mail command?

    Posted Tue June 14, 2011 01:57 PM

    Originally posted by: shargus


    Try changing /etc/mail/sendmail.cf. I think you can change the Dj option to:

    Djdomain.com

    Also try looking at the DM option to masquerade your server.

    Use the -v option with mail to see the SMTP dialog. That may help diagnosing the problem.


  • 3.  Re: Change "from address" in mail command?

    Posted Thu June 16, 2011 08:44 AM

    Originally posted by: CHPrjohnso


    Thanks, I see some improvement with the Dj suggestion - the from address seems to be what I need it to be. I don't know yetif it will make our messaging team happy...

    I also used the sendmail -f option.

    Changing from the mail command to sendmail, I lost the -s option for subject. Any work-around for that?

    Also, when the addressee gets the message, besides not having a subject, there is no "To" address listed. I did try using the -t option which didn't seem to do anything.


  • 4.  Re: Change "from address" in mail command?

    Posted Thu June 16, 2011 09:13 AM

    Originally posted by: armink


    The -f option is your "only" choice... and it's easy:

    Your example always works, if you correctly quote the subject and use the right option sequence e.g.
    echo "Testing..."|mail -f <sender@domain.whatever> -s "this is a subject" <recipent@another.domain>


  • 5.  Re: Change "from address" in mail command?

    Posted Fri June 17, 2011 04:28 AM

    Originally posted by: jjtuinc


    SINOYIN SOLARES CO.,LTD is specialized in manfacturing solar thermal collector ([url=http://www.sinoyin.com/china-flat-plate-solar-collector/][B]China Flat Plate Solar Collector[/B][/url]), flat panel solar water heater( with solar keymark, SRCC) , at Suzhou city in China


  • 6.  Re: Change "from address" in mail command?

    Posted Fri June 17, 2011 04:29 AM

    Originally posted by: jjtuinc


    SINOYIN SOLARES CO.,LTD is specialized in manfacturing solar thermal collector (China Flat Plate Solar Collector), flat panel solar water heater( with solar keymark, SRCC) , at Suzhou city in China