I installed postfix following this tutorial. https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-debian-9 However, I had to edit the first line of the mailname file from americanpharoah.com to americanpharoah.ca since I made a typo during the install. I can send a test email to myself and I did the setup to forward emails to root to me. But the mailname in the file is not used, instead the dropletname.localdomain appears in the Mail From in my tests.
myhostname = dropletname.local domain #I tried putting americanpharoah.ca here but then I can no longer relay the emails to root to me
myorigin = /etc/mailname
mydestination = americanpharoah.ca, $myorigin, $myhostname, localhost.americanpharoah.ca, localhost
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!
Hmm, removed what I had there so now it is justmyhostname =
then I restarted Postfix
but now I get process exited with a non-zero status when I try to send an email to myself
I wonder if I should run “sudo dpkg-reconfigure postfix” and make sure I use americanpharoah.ca instead of americanpharoah.com this time
I just changed it back to myhostname = debian-blahblahblah.localdomain then restarted Postfix, and I was able to send myself an email using the mail command from the linux shell window
I reconfigured postfix by running sudo dpkg-reconfigure postfix This time I made sure to use americanpharoah.ca which is correct.
After changing myhostname = debian-servernameetc.localdomain to myhostname = americanpharoah.ca I now get the emails but it shows it is from root and when I reply it goes to root@debian-s-blahblahetc.localdomain
I checked the mainname file in the etc folder and I still have americanpharoah.ca on the first line. In main.cf if I change the line myhostname = it gives me the 'process exited with non-zero status when I try to send an email to myself
Today, I attempted to add or set the sender email or From address in my command line test
echo "This is the body of the email. Will the FROM Email address be correct?" | mail -s "Mail from AmericanPharoah" -a "From:JohnK<johnk@americanpharoah.ca>" MyRealGmailAddress@gmail.com
I received the email with the correct sender name and sender email address. Also when I check the ‘original’ message in the Gmail details I no longer see any mention of debian-s-1vcpu-1gb-blah-blah-blah for Return-Path or any other values in the email details.
I will try designating the sender in any SendOnly emails sent out by my site.
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.