Thanks, but that did not work either:

# hostname
dev
# hostname -f
dev.example.com

/etc/hosts:
162.243.46.210 dev.example.com dev
[...]

main.cf :
myorigin = example.com
mydomain = example.com
myhostname = dev.example.com
[...]

e-mail arrives from   r...@dev.example.com

(I even rebooted before sending the e-mail)

Gabor


On Thu, May 8, 2014 at 2:15 PM, Marius Gologan <marius.golo...@gmail.com> wrote:
> Try,
>
> mydomain = example.com
> postfix reload
>
> Marius.
>
> -----Original Message-----
> From: owner-postfix-us...@postfix.org 
> [mailto:owner-postfix-us...@postfix.org] On Behalf Of Gabor Szabo
> Sent: Thursday, May 8, 2014 2:12 PM
> To: postfix-us...@cloud9.net
> Subject: Setting the domain name of outgoing e-mail
>
> hi,
>
> I have just set up an Ubuntu 14.04 and installed postfix using aptitude 
> install postfix.
> When I send an e-mail (as root) to a gmail account it arrives from 
> root@localhost
>
> I tried to configure it to send as r...@example.com but the only way I 
> managed to make it work isn't really right. In /etc/postfix/main.cf I had
>
>    myorigin = /etc/mailname
> and /etc/mailname had example.com in it but that did not help.
> I tried setting
>     myorigin = example.com
> and tried
>
>  myorigin = $mydomain
>
> but I still got the mail from root@localhost.
>
> The only way I could convince it to send from r...@example.com was to add
>
> 162.243.46.210 example.com
>
> to the /etc/hosts  file. This is not really acceptable as example.com should 
> resolve to another IP address and not to this machine.
>
> Am I doing something incorrectly?
> How could I convince postfix to use the content of mydomain as the domain 
> name when sending e-mail?
>
> regards
>     Gabor
>

Reply via email to