Send outgoing mail via host Postfix setup

Afternoon all, Ive recently reinstalled Ubuntu Server with Virtualmin / Webmin on a home pc in order to test some website functionality part of this function is to send emails for an invite system and also confirmation emails however I realised because im on a dynamic IP address my emails bounce back from hotmail.

I can send emails to gmail no problems and can also recieve emails to the server not bad to say I dont have a static ip address and im using Dyndns as my nameserver everything seems to work as it should but i would like to try and combat the hotmail using by using the send outgoing mail via host option in postfix.

I see there is a box there for the option but not quite sure what to put in this box do i just put Gmails smtp server once i have enabled it on my account or do i also need to add the port username and password.

Any information would be great so i can try send emails to hotmail.



Check with your ISP, as they may offer an outbound SMTP server for customers to use. They will tell you whether you need to authenticate or not. Otherwise, there are paid options such as Sendgrid and Mailgun.

signed up for Sendgrid my ISP does not provide any smtp without autentication i have a smtp server and api key now what lol

Sendgrid also offers traditional SMTP relaying. Here’s their documentation for Postfix:

Big thanks to noisemarine and Joe everything setup and all working wasnt that hard tbh certainly alot cheaper than purchasing a static ip address anyway.

Static ip is not expensive…mine is $10month. if you plan on doing any of this stuff on a full time basis you will eventually need one (particularly so you can whitelist your ipaddress so programs like fail2ban, wordfence, or other security software doesnt kick you out of your own online webserver if you breach its access protocols (which often happens when developing and administering servers.)

My ISP does not provide any options for a static IP address, sendgrid equates to around £7 per month so in theory its probably the better option as i’m not having to use my own resources to send emails. I only use the server to test website functionality in a live situation so having a service I can start and stop with ease is far the better option for myself.

It’s also worth noting that many of the SMTP relay providers have a free tier that’ll cover many users…if you’re not sending a lot of mail it might not even cost that much.

We’ve considered adding an SMTP relay service (both directions with spam/AV scanning on the incoming side) for that as part of the Virtualmin Pro subscription since both sending and scanning mail are complicated in their own ways, but we’re a little concerned about our servers ending up being used for abuse. It’d have to be the full-time job of one of us to keep it reliable and secure (or we’d have to figure out how to make it pay enough to hire an extra employee).

This might sound a little cheapass, can more than one mail relay host be configured at same time?

Anyone needing to send more than the free tier quota limit would then be able to send a lot more emails!

That’s probably a lot more work than the money it’d save, but you could probably make a cron job that rotates the configuration files (only two, the and the password file) every hour or whatever. It’s worth noting however that mail for a domain that comes from a variety of sources may look spammy to some filters. I doubt this would be an issue if you have them all in your SPF records…but, who knows. Lots of mail filters do weird things.