SoldierX.com SquidBlackList - the world's largest porn blacklist! HAX Radio - The stream the FBI Listens to! Offensive Security Wireless Professional PWNIE 2012 Nominations The Hip-Hop Realm

SquirrelMail + Dovecot + Postfix + Linode

This assumes that you can receive and send Email using mailx from the command line and your MX record is setup properly on your Linode.

What an experience this was. Setting up a gui Email interface was so ridiculous. I could have coded, by hand, a nice AJAX/PHP/MySQL Email client to read our mbox files after a PAM UNIX login in less time than it took to understand this procedure. Anyways, If you buy a Linode server and get your domain to point to the Linode IP, you can start up an Email server to start receiving your Emails to You@YourDomain.com
They have some how to’s on their site:

http://library.linode.com/email/postfix/dovecot-mysql-debian-5-lenny

I have Lenny installed on my Linode, because I hate Ubuntu. Anyways, if you follow the guide, it says to make a weird dovecot.conf file. If you are going to use SquirrelMail, don’t use that file they offer and simply look at what the conf file has to offer and edit it by hand. This line in particular is useful:

mail_location = mbox:~/mail:INBOX=/var/mail/%u

This will say where to read the files in which your Email is stored. Next, you need to install SquirrelMail:

cd < some directory in web root e.g. /var/www/squirrelmail/ >
wget 'http://downloads.sourceforge.net/project/squirrelmail/stable/1.4.21/squirrelmail-1.4.21.tar.gz?r=http%3A%2F%2Fsquirrelmail.org%2Fdownload.php&ts=1288558199&use_mirror=iweb'
mv * squirrelmail.tar.gz
tar vxzfvvvvvv squirrelmail.tar.gz

You have to mv the file and jump through hoops because SquirrelMail is too cool to host it’s own code. (Or use SVN if it’s available) This will create a directory with all of the php files needed by SquirrelMail. This is why you don’t install it via aptitude. run the configuration script

./configuration

Hit “D” and type “dovecot” Hit “s” to save and then then “r” to get back to the main menu. Hit 2 for: folder options and make the default folder prefix NULL. That means nothing at all, not even empty single quotes. like so:
1. Default Folder Prefix  :
If you cannot, and accidentally set it to something, you will have to open the file and edit it by hand with vim:

vim config/config.php

and simply delete the empty double quoted string:

$default_folder_prefix = '';
In the config file it’s okay to have the empty single quotes, just not in the configuration utility. This is because it will break the gui and you will constantly be presented with empty in boxes.

After that check your installation by going to the URL it says http://< your domain.com >/< web mail folder >/src/configtest.php
If anything is wrong it will tell you right away.

Once you get everything working, you will need to know how to add users to the mail database you created in the tutorial. Under this: “Setting up Domains and Users Link” it says how to INSERT the record for the new user. This password NEEDS to be the UNIX password. The same password the user would use when, say, SSH’ing to your Linode. If not, you will get a nasty error saying “username or password unknown”

That’s it!

~Douglas.

3 Responses to “SquirrelMail + Dovecot + Postfix + Linode”

  1. [...] original post here:  WeakNet Labs » Blog Archive » SquirrelMail + Dovecot + Postfix + … Posted in Postfix | Tags: assumes, command-line, dovecot, general-discussion, linode, [...]

  2. [...] that GoDaddy actually did quite a good job at cutting out the spam from my Inbox. As per this post: http://weaknetlabs.com/main/?p=50 I had to figure out a way to stop the spam! I searched Google for a while and found this site, [...]

  3. Ed says:

    Hi,

    Thank you for your page.
    Recently I setup a homemade e-mail server and wrote a full detailed tutorial that you can find in

    http://cosmolinux.no-ip.org/raconetlinux2/mail.html

    using Debian Squeeze, Postfix, Dovecot, SASL, Spamassassin and Squirrel (and a Google account for SMTP relay).

    I wish it is helpful to someone.

Leave a Reply