pavement

Setting up a mailserver

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
Line 10: Line 10:
  
 
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.
 +
 +
==Getting SMTP Authentication running==
 +
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'''
 +
 +
use the following 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.  Note: I '''did''' have some difficulty getting this working; I did the above steps once, did not have joy, then rebuilt and reinstalled /usr/ports/mail/qmail-smtp_auth+tls with no changes or tweaking and magically it worked (and worked without changing any config files, or even looking at them again from what I'd changed them to the last time).  Beats hell out of me.  I'll tighten this up in the final article, when I'm a little more confident of having done it "once and had it work right the first time."  In the meantime, I'm pretty stoked!
  
 
[[Category:Common Tasks]]
 
[[Category:Common Tasks]]

Revision as of 13:29, 1 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

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

use the following 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. Note: I did have some difficulty getting this working; I did the above steps once, did not have joy, then rebuilt and reinstalled /usr/ports/mail/qmail-smtp_auth+tls with no changes or tweaking and magically it worked (and worked without changing any config files, or even looking at them again from what I'd changed them to the last time). Beats hell out of me. I'll tighten this up in the final article, when I'm a little more confident of having done it "once and had it work right the first time." In the meantime, I'm pretty stoked!

Personal tools