Find DrewDahl on Facebook! Find DrewDahl on Twitter! View Andrew Dahl's Profile Drew's Blog

Archive for February, 2010

Setup sendmail to use Gmail’s SMTP server

by Drew Dahl on Feb.18, 2010, under HowTo, Linux, Mail

Well, I did this on Fedora 12, so I’ll be basing everything off of Fedora packages and yum; however, this should work on any distro.

Things you’ll need: sendmail, sendmail-cf, cyrus-sasl

Might need something more, but if so, I’ve overlooked it…

The first thing we’re going to do is setup our authinfo. Do the following:

mkdir /etc/mail/auth/
cd /etc/mail/auth/
vim client-info

In the client-info file you’ve open in your text editor, insert the following line:

AuthInfo:smtp.gmail.com “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”
AuthInfo:smtp.gmail.com:587 “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”

Now, save it, quit your editor, and run the following in the same directory.

makemap -r hash client-info.db < client-info
chmod 600 *
cd ../
chmod 700 auth

Now, let’s move on to making our certs. Do the following:

mkdir /etc/mail/certs/
cd /etc/mail/certs/
openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
openssl req -nodes -new -x509 -keyout sendmail.pem -out sendmail.pem -days 3650
cp  /etc/pki/tls/certs/ca-bundle.crt /etc/mail/certs

And finally, let's edit our sendmail.mc. Do the following:

cd /etc/mail/
vim sendmail.mc

And, add the following to sendmail.mc:

FEATURE(`authinfo’,`hash /etc/mail/auth/client-info.db’)dnl
define(`SMART_HOST’,`smtp.gmail.com’)dnl
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)
define(`CERT_DIR’, `/etc/mail/certs’)
define(`confCACERT_PATH’, `CERT_DIR’)
define(`confCACERT’, `CERT_DIR/ca-bundle.crt’)
define(`confCRL’, `CERT_DIR/ca-bundle.crt’)
define(`confSERVER_CERT’, `CERT_DIR/sendmail.pem’)
define(`confSERVER_KEY’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_CERT’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_KEY’, `CERT_DIR/sendmail.pem’)
define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)

Now run:

m4 sendmail.mc > sendmail.cf
/etc/init.d/sendmail restart

I think it's all self explanatory for the most part. Happy mailing :-)

-=EDIT=-06/02/2010

In the above configuration files, a user reported having issues while copying the above information into their config files. The issue was regarding the quotes around various options. So, if you experience any trouble, please try replacing the quotes. (e.g. delete the ones that are there and add them back within your text editor)

8 Comments :, , more...

Create a Login!

by Drew Dahl on Feb.18, 2010, under Site News

Well, if any of you have tried to create accounts, you’ve probably been saddened by the fact that the mail server wasn’t working properly. It’s an issue with a various set of problems, but I’ve finally setup sendmail to relay all mail to gmail, so life should be good :-)

If you want to create a user, please go to http://drewdahl.com/wp-login.php and register. If not, that’s fine too :-) You should receive post updates regarding comments when you leave your e-mail addresses now as well. I’ll be posting instructions on how to setup sendmail to use GMail’s smtp server in the near future.

Leave a Comment : more...

Todoist Addon for Firefox 3.6

by Drew Dahl on Feb.18, 2010, under Projects, Todoist Firefox Plugin

Well, the Todoist addon/plugin doesn’t work with the latest and greatest Firefox 3.6 =( I went on their support website, hoping that this was already taken care of, but it hadn’t been. In fact, the case was already 30 days old and no developers had come to the rescue. Seeing that saddened me, so I forced the Todoist plug-in to install and it worked fine; however, disabling compatibility checks is the last thing I want to leave enabled, so I set out to validate it with the Mozilla team today.

I did a validity check with their validation tool and it came back with two main errors. The first was the use of a deprecated method in its’ javascript and the other was some locale issue that was optional to fix. After fixing the javascript issue and verifying it, I was unable to submit it to the developer’s due to there being a lack of license in the code. After some tooling around, I realized that the Todoist developer’s never bothered to upload it to the Mozilla site anyway, so I tested it out again in 3.6 and it installed without any trouble with checking enabled.

That said, here is the link for you to download it:

http://www.drewdahl.com/wp-content/uploads/todoist-addon.xpi

This hasn’t been accepted by the Todoist developer’s, so I imagine they may not support it (even though the difference from theirs is only 4 different lines of code). So, if you see any problems with, it let me know. Hopefully they’ll either fix theirs or adopt mine sooner than later. Anyway, Enjoy!

13 Comments : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!