7

I want email to come from [email protected] but they are currently coming from [email protected]

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 [email protected]

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 [email protected]

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
2
  • first try to send mail and give output and mail logs also May 5, 2016 at 9:56
  • 1
    Check you master.cf for myorigin overrides on smtp services. And maillog entries about sending message.
    – Darigaaz
    May 5, 2016 at 22:48

1 Answer 1

3

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 [email protected] [email protected]

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .