Creating Mail Server on Ubuntu Jaunty (9.04) with Postfix, Dovecot, SASL and Squirrel Mail

A mail server (also known as a mail transfer agent or MTA, a mail transport agent, a mail router or an Internet mailer) is an application that receives incoming e-mail from local users (people within the same domain) and remote senders and forwards outgoing e-mail for delivery. A computer dedicated to running such applications is also called a mail server. Microsoft Exchange, qmail, Exim and sendmail are among the more common mail server programs.
Here we will try to install applications on ubuntu mail server Jaunty (9:04) by using Postfix, Dovecot, SASL and Squirrel Mail, follow these steps :
Install Postfix MTA (Mail Transfer Agent)

$ sudo su
$ apt-get install postfix postfix-tls libsasl2-2 sasl2-bin libsasl2-modules


During the installation process you must fill in the name of the server by filling in your domain name.
Install Dovecot

$ apt-get install dovecot-imapd dovecot-pop3d dovecot-common

after installation is complete, you need to edit the dovecot configuration files in the directory /etc /dovecot/dovecot.conf, to the configuration file. use the command:

$ gedit  /etc /dovecot/dovecot.conf

edit that into:
protocols = pop3 imap
# uncomment this and change to no.
disable_plaintext_auth = no
pop3_uidl_format = %08Xu%08Xv


Save and exit...!!

Configuring SASL Authentication with TLS

edit /etc/postfix/main.cf  configuration by type :

$ gedit /etc/postfix/main.cf

Enter the following configuration to the end of the file /etc/postfix/main.cf that you had
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = yourdomain.com
smtpd_recipient_restrictions =
permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options = noanonymous


Save and exit,  then Run the command:

$ rm -r /var/run/saslauthd/
$ mkdir -p /var/spool/postfix/var/run/saslauthd
$ ln -s /var/spool/postfix/var/run/saslauthd /var/run
$ chgrp sasl /var/spool/postfix/var/run/saslauthd
$ adduser postfix sasl


You should configure file /etc/dovecot/dovecot.conf  to determine dovecot  daemon socket:

$ gedit /etc/dovecot/dovecot.conf

enter the information below:
auth default2 {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}}}

 Save and exit.

Install Squirrel mail

$ apt-get install apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi squirrelmail

after installation completed, we must edit configuration file /etc/apache2/apache2.conf by type :


$ gedit  /etc/apache2/apache2.conf

enter the information below:

Include /etc/squirrelmail/apache.conf 

Reboot your machine by type :

$ reboot


and  Check your work by :
Open your browser and type this http://ip_anda/squirrelmail  into address bar your browser. If your configuration is correct, then you will view the first entry squirrelmail login, then enter your user name and password. if any, follow the above configuration to the right.
Happy Testing...!!

No comments:

Post a Comment

Please Comment...!!