I’ve got a postfix config that’s sending emails just fine, except that the sender address is email@example.com, 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” firstname.lastname@example.org
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!
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.
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.
Click below to sign up and get $100 of credit to try our products over 60 days!