2

I want email to come from user@example.com but they are currently coming from user@mail.example.com

From Postfix documentation:

What domain name to use in outbound mail

The myorigin parameter specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine. Unless you are running a really small site, you probably want to change that into $mydomain, which defaults to the parent domain of the machine name.

For the sake of consistency between sender and recipient addresses, myorigin also specifies the domain name that is appended to an unqualified recipient address.

Examples (specify only one of the following):

/etc/postfix/main.cf:

myorigin = $myhostname (default: send mail as "user@$myhostname")

myorigin = $mydomain (probably desirable: "user@$mydomain")

In /etc/postfix/main.cf I have: myhostname = mail.example.com mydomain = example.com myorigin = $mydomain

Dispite what the documents said, my mail is showing as from user@mail.example.com

I have run sudo /etc/init.d/postfix restart after making changes to the main.cf file. Is there another parameter that needs to be set? I have read through the documentation and it seems pretty clear but my result is not consistent with what is described in the document. Thanks for any help.

ps, this is running on Ubuntu 14.04 on an Amazon ec2 instance, with an elastic IP and proper MX records. Mail is being both sent and received. I am sending mail using:

mail recipient@address.com

additional info, if it matters. At the command prompt:

user@mail:$ hostname
mail
user@mail:$ hostname -f
mail.example.com
user@mail:$ postconf myorigin
myorigin = $mydomain
user@mail:$ postconf mydomain
mydomain = example.com
  • first try to send mail and give output and mail logs also – Nullpointer May 5 '16 at 9:56
  • Check you master.cf for myorigin overrides on smtp services. And maillog entries about sending message. – Darigaaz May 5 '16 at 22:48
0

Which do you use mailutils or bsd-mailx ?

$ ls -l /etc/alternatives/mail

If the mail command of mailutils, you can specify the sender in the -r option.

$ mail -r user@example.com recipient@address.com

If the mail command of bsd-mailx, $myorigin setting is enabled.

  • I'm using mailutils. Adding the -r to the mail command does work, so emails come from user@example.com. – Clifford Ponder May 6 '16 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.