12-21-2011, 07:50 AM
I've written a tutorial once for ubuntu (debian based) on another forum which their email section got shut down within a day or two of me writing so no one really had access to it that didn't see it within the first 48 hours of me posting. When I was learning about how to setup mail servers there was not a lot of updated or correct information out there, so in effort to bring some life to the email section of this forum I wrote this tutorial to share here. There are sections that are taken from other tutorials but this in it's entirety has never been shared as I just wrote it.
Acquire a debian vps or dedicated server, set your “A”and “MX”
records at the registrar to the ip of your server. Go to the control panel of
your server and set the rDNS to your domain if there is no user rdns management
then submit a ticket and request rdns be set to your domain. Log into your
server via ssh with either putty or terminal and complete the following;
Acquire a debian vps or dedicated server, set your “A”and “MX”
records at the registrar to the ip of your server. Go to the control panel of
your server and set the rDNS to your domain if there is no user rdns management
then submit a ticket and request rdns be set to your domain. Log into your
server via ssh with either putty or terminal and complete the following;
Code:
aptitude update
aptitude upgrade
netstat –tap
(look for what process id# is sendmail)
kill -9 processid#forsendmail
/etc/init.d/apache2 stop
(go dl xampp for linux, as of writing this the link is like
this)
wget http://downloads.sourceforge.net/project/xampp/BETAS/xampp-linux-1.7.7.tar.gz
tar xvfz xampp-linux-1.7.7.tar.gz –C /opt
/opt/lampp/lampp start
/opt/lampp/lampp security
(change all passwords)
aptitude install postfix postfix-tls libsasl2-2 sasl2-bin
libsasl2-modules popa3d
aptitude install dovecot-imapd dovecot-pop3d dovecot-common
aptitude install nano
nano /etc/dovecot/dovecot.conf
“page down until you see disable_plain_text_authorization
and uncomment by removing the # and make sure it says no”
ctrl-o to write out and ctrl-x to exit
adduser mailaccountname
adduser bounceaccountname
adduser abuse
/etc/init.d/dovecot restart
nano /etc/postfix/main.cf
add the following:
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = yourdomainname.com
smtpd_recipient_restrictions =
permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options = noanonymous
ctrl-o to write out ctrl-x to exit
rm –r /var/run/saslauthd/
mkdir –p /var/spool/postfix/var/run/saslauthd
ln –s /var/spool/postfix/var/run/saslauthd
chgrp sasl /var/spool/postfix/var/run/saslauthd
adduser postfix sasl
nano /etc/dovecot/dovecot.conf
hit ctrl-w and type auth default hit enter
add 2 to auth default so it reads auth default2
and above it paste the following
auth
default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
ctrl-o to write out and ctrl-x to exit
/etc/init.d/saslauthd restart
/etc/init.d/postfix restart
/etc/init.d/dovecot restart
aptitude install squirrelmail
nano /opt/lampp/etc/httpd.conf
edit your DocumentRoot to /var/www/
scroll to the bottom and under various configs enter the
following:
Include /etc/squirrelmail/apache.conf
ctrl-o to write out and ctrl-x to exit
/opt/lampp/lampp stopapache
/opt/lampp/lampp startapache
chmod 777 /var/lib/squirrelmail/data/
now you can access your email accounts via http://yourdomain.com/squirrelmail
(do not use root account for login)
Now you may install any mailer of your choice by following
their instructions, such as Interspire, Active Campaign, OEMpro, phplist, etc.