LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-29-2017, 10:38 AM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;GO MAGEIA!!!Hopefully last destination is Gentoo
Posts: 880

Rep: Reputation: 52
mail option to change sender


Hi, instead of creating another user login I would like to be able to change the sender name of a e-mail when using the mail command. I have tried using the -r and -a option+ without success. In other words I don't want 'user@localhost' in the send box.
Thanks for your expertise!
 
Old 11-29-2017, 12:38 PM   #2
scasey
Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.4
Posts: 492

Rep: Reputation: 156Reputation: 156
Try
Code:
mail -S "from=user@domain.com" -s "Subject goes here" recipient@example.com ...
the -S set the from variable. Got that from the man page, which, I concede, is onerous. The -r has always worked for me, but I note the man page says it won't "if SMTP is used"
 
1 members found this post helpful.
Old 11-29-2017, 03:42 PM   #3
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;GO MAGEIA!!!Hopefully last destination is Gentoo
Posts: 880

Original Poster
Rep: Reputation: 52
Thank you! I will give that a try and post back.
 
Old 11-29-2017, 09:10 PM   #4
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;GO MAGEIA!!!Hopefully last destination is Gentoo
Posts: 880

Original Poster
Rep: Reputation: 52
I took the quotes out around the from part and it worked!Thanks so much for the help. I tried everything I could find on the net and it didn't work.Now people will find this when they do a search!
 
Old 12-18-2017, 04:44 PM   #5
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;GO MAGEIA!!!Hopefully last destination is Gentoo
Posts: 880

Original Poster
Rep: Reputation: 52
I just looked at the 'Raw Message' of my test E-mails and it lists the log in users name. Is there anyway to change or not provide that info?
Thanks for your expertise!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail without a subject or sender orrik Linux - Server 2 10-06-2016 01:58 PM
[SOLVED] Change Sender name using mail in Centos 6 trickynapzter Linux - Server 4 03-30-2014 10:00 AM
cannot send mail using Mail::Sender cccc Programming 2 11-02-2007 03:27 AM
Option to specify Sender's Address in Mail command crazy_girl Linux - Newbie 2 08-20-2007 11:36 AM
Specify mail sender? spiffytech Linux - Networking 1 01-23-2006 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:01 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration