LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-15-2019, 10:20 AM   #1
greyarea
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos5/RHEL5
Posts: 21

Rep: Reputation: 0
changing mail from: address


I'm having trouble getting system alerts to route through our organisations mail relay. Our organisation will, quite reasonably, only relay messages that orinate from domains in its control such as mydomain.com

The problem I have is that the system I'm configuring is not directly a member of the domain mydomain.com but it permitted to relay through it as long as it sets a Reply: address of something@mydomain.com.

To test this, I'm trying the following command:

echo "Test email body." | mail -s "Test email from system." -a "Reply-to: noreply@mydomain.com" -a "Return-path: noreply@mydomain.com" -a "From: noreply@mydomain.com" myinbox@gmail.com

However, postfix still shows that the local root mailbox was used as the from: address.

Mar 15 11:33:03 mysystem postfix/smtp[23631]: > 1.1.1.1[1.1.1.1]:25: MAIL FROM:<root@mysystem>

Try as I might, I can't get the mail client to send a mail with a different reply address - please help!

Last edited by greyarea; 03-15-2019 at 10:26 AM.
 
Old 03-15-2019, 10:34 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,151

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
Quote:
Originally Posted by greyarea View Post
I'm having trouble getting system alerts to route through our organisations mail relay. Our organisation will, quite reasonably, only relay messages that orinate from domains in its control such as mydomain.com

The problem I have is that the system I'm configuring is not directly a member of the domain mydomain.com but it permitted to relay through it as long as it sets a Reply: address of something@mydomain.com. To test this, I'm trying the following command:

echo "Test email body." | mail -s "Test email from system." -a "Reply-to: noreply@mydomain.com" -a "Return-path: noreply@mydomain.com" -a "From: noreply@mydomain.com" myinbox@gmail.com

However, postfix still shows that the local root mailbox was used as the from: address.

Mar 15 11:33:03 mysystem postfix/smtp[23631]: > 1.1.1.1[1.1.1.1]:25: MAIL FROM:<root@mysystem>

Try as I might, I can't get the mail client to send a mail with a different reply address - please help!
Fairly simple: http://www.postfix.org/BASIC_CONFIGU....html#myorigin

Change the myorigin directive in the postfix main.cf file, and restart. By default, it uses the "$myhostname" directive, which is exactly what you're seeing.
 
  


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
mail command + changing senders email address aeby Linux - Server 5 04-18-2010 05:43 PM
Rejecting non local mail for specific e-mail address vrsic Linux - Server 4 10-24-2006 02:46 AM
Shel script mail send ("/" in mail address) problem anaid Linux - Networking 3 08-23-2005 07:41 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
how can I use sendmail to e-mail with an existing e-mail address? vofkid Linux - Newbie 0 03-14-2002 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration