Question

PostFix send emails as domain.localdomain instead of domain.org

So, I,ve setup up postfix in my server following this article https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-16-04. Whe i make the indicated test of the article mails are reviced as root@innovaclub.localdomain instead of the desire @innovaclub.org. I uncommented the myorigin = /etc/mailname line and edited the mailname file adding innovaclub.org in the firstline but still not working. Any help will be much appreciatte.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@hansen thanks for reply.
I follow this steps. 1.-

postconf | grep myorigin
append_at_myorigin = yes
myorigin = /etc/mailname

2.-

cat mailname 
innovaclub.org

Seems Postfix config looks ok.

3.- Added this to my 000-default as my server its going to manage only 1 website.

  <Directory /var/www/html/>
            php_value sendmail_path "/usr/sbin/sendmail -t -f info@innovaclub.org -i "
            Options FollowSymLinks
            AllowOverride All
            Require all granted
   </Directory>

  1. Try added smtp_generic_maps = hash:/etc/postfix/generic but after that postfix wont send emails.

So far none of this work. still getting root@innovaclub.localdomain

You need to delete the other SPF records - you should only have 1, and I can see 3 currently. And the record should be (without any quotes):

v=spf1 a include:_spf.google.com ~all

@hansen thanks ! that did the trick hostname was set to “innovaclub” instead to innovaclub.org. Now its working.

First step done. Now I have to config php to send mails trought smtp postfix to avoid going directly to gmail spam folder.