jump to navigation

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

Comments»

1. Grateful - July 5, 2006

Very handy – just what I was looking for.

2. Ubuntu Blog » Participate in the Popularity Contest - July 16, 2006

[...] 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. [...]

3. attic » Blog Archive » Piedalieties Ubuntu “popularitātes sacensībās” - July 17, 2006

[...] 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). [...]

4. Marston - October 19, 2006

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.

5. junck - February 12, 2007

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.

6. Jon - February 16, 2007

Marston: There’s some format for this. Something like:

user:pass@smtp.yourmailserver.com

That’s not right, but it’s something like that.

7. Getting Textpattern to sendmail (3) « Computers at Werrington PS - August 5, 2007

[...] 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 [...]

8. Scott Lindner - January 13, 2008

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.

9. Gregg - January 20, 2008

http: www dot michael-prokop.at/postfix/ This worked for me

10. Pascal - March 3, 2008

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_

11. jobsearch - April 21, 2008

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.

12. graduate jobs - April 21, 2008

Yes I had the same problem too, thanks for the advice.

13. driving jobs - April 21, 2008

But how do you set postfix up to be a smarthost when the external SMTP server requires authentication and TLS?

14. Olly - June 5, 2008

#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.

15. GB - September 16, 2008

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.

16. links for 2008-12-17 « O0o. Pathfinder .o0O - December 17, 2008

[...] Setting a “smarthost” in Postfix « Ubuntu Blog (tags: ubuntu mail) [...]

17. Ivan Versluis - March 10, 2009

Thanks! It worked fine for me with JeOS ubuntu 8.04 and internal SMTP relay.

18. none - October 19, 2009

Instead of relying on this post to configure your postfix Email server, you could better by reading documentation on http://www.postfix.org

19. Roo’s View » Blog Archive » Earning Trust for Your Email Server - December 30, 2009

[...] 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 [...]

20. find a job - March 28, 2010

Hi, Does this work on the latest version Ubuntu?

21. pet izmir - August 2, 2010

thenk you man, bknz : pet izmir

22. seks izle - September 29, 2010

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.

23. ukrayna vizesi - July 30, 2011

İYİ

24. arkadaş - August 6, 2011

süper payşım teşekkürler

25. antalya böcek ilaçlama - August 7, 2011

antalya ev ilaçlama

26. vizw - August 17, 2011

iyi

27. www.kizmazlarevdenevenakliyat.com - October 9, 2011

teşekur ederım

28. видеоуроки по wordpress - January 5, 2012

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.


Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 237 other followers