Setting a “smarthost” in Postfix September 7, 2005
Posted by Carthik in administration, ubuntu.trackback
Since Postfix is the default Mailer used in Ubuntu, and since you may need to set a smarthost to possibly send outgoing mail through the SMTP server on a webserver, or your ISP, here’s how to do that:
Edit /etc/postfix/main.cf, and add or edit this line:
relayhost = your.server.com
Followed by restarting the postfix service:
$sudo /etc/init.d/postfix restart
This might be handy particularly for those who use a combination of Mutt + procmail + fetchmail to read their mail – old style.
Advertisement







Very handy – just what I was looking for.
[...] You can choose to submit stats via http, or via email. Both are automated processes, and I’d choose http for the convenience. If, however, you do choose email, note that you might have to take a small additional step to enable postfix to send the email properly. You can follow the instructions to setup a “smarthost” in postfix to ensure that your email gets sent and received without problems. I have my popcon set up to use the http protocol to send information. Since it is anonymous, it is not a threat to your privacy. So go ahead, and give ‘em some feedback. [...]
[...] Tiek piedāvāta iespēja vai nu sūtīt informāciju izvēloties HTTP protokolu vai arī sūtīt pa epastu. Lai varētu sūtīt informāciju pa epastu, nepieciešams uzskaņot postfix (apraksts). [...]
Just found this post, good info.
But how do you set postfix up to be a smarthost when the external SMTP server requires authentication and TLS? i.e in my case I’m using Google’s external SMTP server. Thanks.
Great Post,
I could not send any emails to my ISP accounts. My ISP ‘refused to talk, 554′. I edited the main.cf file as you suggested and all is working fine. I can now send and recieve mail in and out of my network with postfix. Thanks.
Marston: There’s some format for this. Something like:
user:pass@smtp.yourmailserver.com
That’s not right, but it’s something like that.
[...] the DET smtp server. I put than in at etc/postfix;/main.cf Here is the very basic what to do… “Setting a Smarthost in Postfix” BTW – using the sudo /etc/init.d/postfix [...]
This doesn’t work. I have an older smarthost configuration working with sendmail. I’m attempting to upgrade to a newer Ubuntu system using Postfix. This “trick” doesn’t work for a couple of reason. For one, Postfix complains that myhostname and relayhost cannot be the same. So I changed relayhost to be exactly the text in this post “your.server.com”. Of course that didn’t work.
I think there is some confusion over what a relay is, and what a smarthost is. This may be why Postfix does not seem to be able to do smarthost’ing.
Thoughts? Please respond. I very much want to get this working and if I’m wrong I really want to know.
http: www dot michael-prokop.at/postfix/ This worked for me
the provided information is in fact _not_ very helpful. the above configuration will only work with an open relay. in other words: the premium invitation to all the spammers in the wide, wide world.
please, with the above slogan “Not quite everything about Ubuntu, but close”, just try to avoid articles like this one an try to act a little more _sensible_
This is a a useful bit of info. I was having problems sending emails to my ISP accounts too but once I edited the “.cf” file it now works great. Thanks for the tip.
Yes I had the same problem too, thanks for the advice.
But how do you set postfix up to be a smarthost when the external SMTP server requires authentication and TLS?
#default_transport = error
#relay_transport = error
if you have the above lines in the main.cf
make sure you comment them if you want to send email.
Didn’t work for my ISP using either the fqdn (mail.ispname.net) as it complained about an mx record lookup issue. So I replaced it with just “ispname.net” (so it could find the mx record itself) and I was back to the previous errors I had.
*** Finally, when I replaced the domain name with the IP ADDRESS of the ISP’s mail server it finally accepted my mails.
It had previously complained of “poor reputation of the MTA” or words to that effect.
[...] Setting a “smarthost” in Postfix « Ubuntu Blog (tags: ubuntu mail) [...]
Thanks! It worked fine for me with JeOS ubuntu 8.04 and internal SMTP relay.
Instead of relying on this post to configure your postfix Email server, you could better by reading documentation on http://www.postfix.org
[...] your own mail server, then setting it up to use your ISP as a smarthost is the easy way to go (very easy with Ubuntu), of course I didn’t take that [...]
Hi, Does this work on the latest version Ubuntu?
thenk you man, bknz : pet izmir
But how do you set postfix up to be a smarthost when the external SMTP server requires authentication and TLS? i.e in my case I’m using Google’s external SMTP server. Thanks.
İYİ
süper payşım teşekkürler
antalya ev ilaçlama
iyi
teşekur ederım
Hey there, You have done a great job. I will certainly digg it and individually suggest to my friends. I am sure they will be benefited from this web site.