By ryankr1
I’ve got a postfix config that’s sending emails just fine, except that the sender address is root@lamp-512mb-lon1-01.localdomain, which isn’t using my domain.
The config file looks like the following:
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = lamp-512mb-lon1-01.localdomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, skytracker.co, lamp-512mb-lon1-01.localdomain, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
inet_interfaces = loopback-only
and /etc/mailname contains the domain that I would like to use to send emails from.
The command that I’m testing my email sending from is:
echo “This is the body of the email” | mail -s “This is the subject line” xyz@hotmail.co.uk
Any help would be appreciated!
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!
The line in your configuration that looks like:
myhostname = lamp-512mb-lon1-01.localdomain
… is why you’re seeing that :-). That should be your actual hostname (mail.yourdomain.com) or your domain itself (yourdomain.com).
Hello. I had the same issue, and I found out… https://www.digitalocean.com/community/questions/system-has-configured-manage_etc_hosts-as-true
By the way, I’ve Ubuntu.
I solved it by adding to the file /etc/cloud/cloud.cfg
manage_etc_hosts: False
And editing /etc/hosts
After the “127.0.1.1” I added myhostname.swe just
Also, I had edited /etc/postfix/main.cf (myhostname= and myorigin=)
Then I restarted (server and) postfix
sudo systemctl restart postfix
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.