<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Mailx Doubt RHEL in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527401#M38739</link>
    <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;You con't even really have mailx. The command on Linux is mail but the man page is different.&lt;BR /&gt;&lt;BR /&gt;I think you need to RTFM here but -s or -u looks good to me.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Wed, 04 Nov 2009 13:34:38 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2009-11-04T13:34:38Z</dc:date>
    <item>
      <title>Mailx Doubt RHEL</title>
      <link>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527400#M38738</link>
      <description>Hi we have a new Linux server with RHEL 4. Previously in HP UX we used -r option to sned mails via script to specify a from address. In Linux we dont have the -r option now can any one please help?</description>
      <pubDate>Wed, 04 Nov 2009 11:40:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527400#M38738</guid>
      <dc:creator>vinay_26</dc:creator>
      <dc:date>2009-11-04T11:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Mailx Doubt RHEL</title>
      <link>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527401#M38739</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;You con't even really have mailx. The command on Linux is mail but the man page is different.&lt;BR /&gt;&lt;BR /&gt;I think you need to RTFM here but -s or -u looks good to me.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 04 Nov 2009 13:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527401#M38739</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-11-04T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mailx Doubt RHEL</title>
      <link>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527402#M38740</link>
      <description>Hi vinay,&lt;BR /&gt;&lt;BR /&gt;that's true for RHEL's mail(x) command.&lt;BR /&gt;&lt;BR /&gt;Btw, on my RHEL 5 boxes mailx is simply a symlink to mail, so you ought to be able to use the command name that you prefer (or rather may have carried over from scripts for other Unices).&lt;BR /&gt;&lt;BR /&gt;There are several workarounds to forge the SMTP envelope's Return-path, even when using the mail(x) version without the -r option.&lt;BR /&gt;&lt;BR /&gt;If you studied the manpage of mail(x) on you RHEL you may probably have noticed that you can pass additional sendmail options to the mail(x) command if they follow a double hyphen (i.e. all following that is regarded to be passed to the underlying sendmail).&lt;BR /&gt;&lt;BR /&gt;That's fine since sendmail knows of the -f option (see man sendmail) by which you can specify a deviating Return-path address.&lt;BR /&gt;However, there is a little grain of salt,&lt;BR /&gt;if the invoker is any non-privileged user (viz. !root) and is not the same as that stated in the forged From address then sendmail will add an X-Authentication-Warning to your mails header.&lt;BR /&gt;&lt;BR /&gt;Nevertheless, here's is how it should work.&lt;BR /&gt;&lt;BR /&gt;$ echo "something to fill the body" | mail -s "any subject you like" recipient@their-maildomain.tld -- -fsender@other-than-login.tld&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Besides this way, some claim that often a set environment variable of SENDER should also do the trick.&lt;BR /&gt;However, that hasn't worked for me.&lt;BR /&gt;Sould it work though, the invocation should be something like&lt;BR /&gt;&lt;BR /&gt;$ echo "something to fill the body" | SENDER=sender@other-than-login.tld mail -s "any subject you like" recipient@their-maildomain.tld&lt;BR /&gt;&lt;BR /&gt;Alternatively, you could avoid the usage of mail(x) altogether and script your own SMTP client (e.g. Perl's Net::SMTP or Mail::Mailer etc.)&lt;BR /&gt;Or you pipe your message directly into sendmail like&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;printf "From: %s\nSubject: %s\n\n" $(id -nu)@$(hostname) "any subject you like" "something to fill the body" | /usr/sbin/sendmail -ODeliveryMode=b -fsender@other-than-login.tld recipient@their-maildomain.tld&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Instead of using printf you could also use a here-file sort of "redirection" to keep the command lines shorter.</description>
      <pubDate>Wed, 04 Nov 2009 15:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/mailx-doubt-rhel/m-p/4527402#M38740</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2009-11-04T15:16:58Z</dc:date>
    </item>
  </channel>
</rss>

