LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2006, 12:01 PM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
Changing from address when using Mailx?


Is there a way of changing the from address when using Mailx to send emails from the command line?

I've tried -a "mail from: anotheraccount@domain.com" but this doesn't work.
 
Old 12-07-2006, 12:51 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Not that I've ever found in the Linux version. The HP-UX version of mailx has a -r flag for specifying who the sender is.

You can set it globally in sendmail with MASQUERADING (DM macro in sendmail.cf)

Otherwise I don't know how you'd do it with mailx.
 
Old 12-07-2006, 01:08 PM   #3
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
-r isn't a valid option for mailx on my linux box.

I really really don't want to have to su - user -c "mail ....".
 
Old 12-08-2006, 11:25 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I knew the -r wasn't available on Linux. My comment was I hadn't seen a way to do it on Linux's mailx.

If you always want the user to send as another user then you might want to have a look at sendmail's aliases file. (man aliases).

To change it on the fly though I don't know how you'd do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set reply to address on mailx hamish Linux - Newbie 3 05-31-2005 02:28 AM
ip address keeps changing barrys Mandriva 2 12-06-2003 02:52 PM
changing localdomain in mailx setting vsg123 Linux - Networking 2 07-21-2003 09:40 AM
changing IP address ethanchic *BSD 7 04-25-2003 11:48 PM
Changing the ip address saravanan1979 Linux - Software 1 01-28-2002 04:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration