pavement

Setting up a mailserver

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(not pulling your hair out after upgrading)
Line 7: Line 7:
 
# Configure all of them
 
# Configure all of them
  
Voila, Qmail-based mailserver that supports POP3, [[IMAP]], blindingly fast webmail interface, web-based controls for setup of multiple mail domains, and control of user accounts / catch-alls / mail forwards / auto-responders / you-name it fine-grained enough to be handed down to the user level, both the "individual user" level and the "single domain admin on a multi-domain mailserver" level.
+
Voila, Qmail-based mailserver that supports [[POP3]], [[IMAP]], blindingly fast webmail interface, web-based controls for setup of multiple mail domains, and control of user accounts / catch-alls / mail forwards / auto-responders / you-name it fine-grained enough to be handed down to the user level, both the "individual user" level and the "single domain admin on a multi-domain mailserver" level.
  
 
Obviously, this article needs <s>some</s> '''a lot''' of polishing, but there's a start.
 
Obviously, this article needs <s>some</s> '''a lot''' of polishing, but there's a start.

Revision as of 01:52, 6 November 2004

  1. Install Qmail
  2. Install Apache
  3. Install VQadmin
  4. Install Qmailadmin
  5. Install Dovecot
  6. Install sqwebmail
  7. Configure all of them

Voila, Qmail-based mailserver that supports POP3, IMAP, blindingly fast webmail interface, web-based controls for setup of multiple mail domains, and control of user accounts / catch-alls / mail forwards / auto-responders / you-name it fine-grained enough to be handed down to the user level, both the "individual user" level and the "single domain admin on a multi-domain mailserver" level.

Obviously, this article needs some a lot of polishing, but there's a start.

Getting SMTP Authentication running

Note: I'm assuming here that you're 1. running FreeBSD, 2. using vpopmail, 3. using rblsmtpd with a few RBL servers, and 4. using tcpserver/ucspi-tcp. If you aren't doing any of the above, you're going to need to CAREFULLY read the following and adapt to your environment. Good luck.

FIRST, if you're already running qmail, cp /var/qmail/control to /home/yourname/qmail-control. You're very likely to bork your rcpthosts, locals, virtualdomains, and such when you install qmail-smtp_auth+tls over your existing qmail. You want to be able to restore them from a copy in your homedir. If you've set up aliases for localhost addresses in /var/qmail/alias, better copy that too.

Now, set up qmail from /usr/ports/mail/qmail-smtp_auth+tls (on amd64 you may need to hack the Makefile first in order to get it to NOT refuse to build because you aren't on i386), then use the following info to build a certificate, making sure that you use certificate info that matches the servername (to minimize the number of warnings that clients receive the first time they connect and accept the certificate):

ph34r# cp /usr/local/openssl/openssl.cnf.sample /usr/local/openssl/openssl.cnf
ph34r# make certificate

Now change the permissions on vpopmail's vchkpw:

ph34r# chmod 4755 /usr/local/vpopmail/bin/vchkpw
ph34r# chown root /usr/local/vpopmail/bin/vchkpw

Change the server name in the following, and use it to start tcpserver (assumes you're also wanting to use rblsmtpd with the listed RBLs). (note: escaping line breaks with \ as shown may or may not work, and is not recommended - I strongly recommend you get rid of the \'s and turn the following into one single line in your tcpserver.sh startup script)

/usr/local/bin/tcpserver -H -l0 -R -c 512 -p -x /etc/tcp.smtp.cdb -u 82 -g 81 0 smtp \
/usr/local/bin/rblsmtpd -r bl.spamcop.net -r dnsbl.njabl.org /var/qmail/bin/qmail-smtpd \
ph34r.tehinterweb.net /usr/local/vpopmail/bin/vchkpw /usr/bin/true | \
/var/qmail/bin/splogger rblsmtpd &

You should be ready to go now, and your qmail server will now authenticate against your vpopmail user database either with or without SSL/TLS encryption!

Personal tools