Thursday, February 26, 2009

send e-mail to the outside world from your ubuntu desktop

There are couple of reasons why I want my Ubuntu machine at home to send e-mails to the outside world: any notices from Cron jobs, and e-mails from websites that I am developing. There are a couple of reasons why the mail service does not work out of the box on a Ubuntu desktop, broadband ISPs normally block the default mail port for outgoing mail, the mail service programs are not normally installed by default.

I have finally managed to make this work on my machine. I got help from the following tutorials on the Internet:

this is the one that I followed, most of it worked but I had to make a couple of fixes afterwards:
configuringubuntu-postfix-and-gmail-in-101-easy-steps

this is another similar tutorial which is a little bit better formatted that I found later:
getting-postfix-to-work-on-ubuntu-with

I wasn't able to send e-mail out after completing all the above steps, I got a few errors. the first two were easy to fix. The mail program was not able to find the transport.db and the tls_per_site.db file. That was probably because I'd missed a couple of steps from the tutorial. I then got the following error:

Feb 26 06:05:36 ubuntu810desktop postfix/smtp[7100]: Untrusted TLS connection established to smtp.gmail.com[72.14.253.109]:587: TLSv1 with cipher RC4-MD5 (128/128 bits)
Feb 26 06:05:36 ubuntu810desktop postfix/smtp[7100]: A767D49EE5: to=, relay=smtp.gmail.com[72.14.253.109]:587, delay=7724, delays=7723/0.03/0.31/0, dsn=4.7.5, status=deferred (Server certificate not trusted)

I fixed it by updating the /etc/postfix/cacert.pem file based on this ubuntu tutorial

I was then able to successfully send e-mail from that machine. Hope you find this useful.