All pastes #561604 Raw Edit

w0ls0n

public text v1 · immutable
·published 2007-06-12 14:52 UTC
rendered paste body
The vpopmail skel patch allows you to patch vpopmail so you can make your own custom directories. If you create a user with just the normal vpopmail install, you get a default Maildir with new, tmp and cur in it which really doesn't allow you to do too much with filtering and the like. If you create a new user and vpopmail has been patched with the skel patch, The users maildir is copied from the ~vpopmail/skel dir. If you really think about it, you can pretty much add your own maildrop recipe into the skel dir along with the .qmail file. If you add the qmailadmin into the mix, you or your users can turn on or off the spam filtering at your or their leisure. If you really know what you're doing, this can open up a whole new worl d with vpopmail. I have been using a custom Maildir structure for about a year and a half now with no issues .

When maildrop is updated, run the following:

# mkdir -m 1755 /var/qmail/supervise/maildrop-logger
# mkdir -m 755 /var/qmail/supervise/maildrop-logger/log
# cd /var/qmail/supervise/maildrop-logger/log
# fetch http://freebsdrocks.net/files/log-run
# mv log-run run
# chmod 755 run
# cd ..
# fetch http://freebsdrocks.net/files/log-maildrop
# fetch http://freebsdrocks.net/files/pipe-watcher
# fetch http://freebsdrocks.net/files/maildrop-logger-run
# mv maildrop-logger-run run
# chmod 755 pipe-watcher log-maildrop run
# touch /tmp/log-maildrop
# chown vpopmail:vchkpw /tmp/log-maildrop

Now lets start the maildrop logger service and make sure it's running:

# ln -s /var/qmail/supervise/maildrop-logger /service

wait a few seconds and then run

# svstat /service/maildrop-logger /service/maildrop-logger/log

and you should see something like:

/service/maildrop-logger: up (pid 83407) 31 seconds
/service/maildrop-logger/log: up (pid 83408) 31 seconds

# cd ~vpopmail
# fetch http://freebsdrocks.net/files/skel.tgz
# tar zxvf skel.tgz
# chown -R vpopmail:vchkpw skel/
# chmod -R 700 skel/
# rm skel.tgz

# cd /downloads/qmailrocks
# wget http://umn.dl.sourceforge.net/sourceforge/vpopmail/vpopmail-5.4.17.tar.gz
# tar zxvf vpopmail-5.4.17.tar.gz
# wget http://freebsdrocks.net/files/patch-vpopmail-port.patch
# cd vpopmail-5.4.17
# patch < ../patch-vpopmail-port.patch
# ./configure --enable-logging=p
# make
# make install

Add a domain and you should get a output. Don't worry about this as it's a debug output and when you create the domain or user, their Maildir is copied from the ~vpopmail/skel folder :-)

Qmailadmin

# wget http://easynews.dl.sourceforge.net/sourceforge/qmailadmin/qmailadmin-1.2.11.tar.gz
# tar zxvf qmailadmin-1.2.11.tar.gz
# cd qmailadmin-1.2.11
# ./configure --enable-modify-spam=Y --enable-spam-command='|preline -f /usr/local/bin/maildrop mailfilter' --enable-cgibindir=/path/to/cgi-bin --enable-htmldir=/path/to/www --enable-imagedir=/path/to/www/images --enable-help --enable-autoresponder-path=/usr/local/bin

# make install

 When we add new users via qmailadmin, we want Spam Fighting turned on by default. Edit the following:

# vi /usr/local/share/qmailadmin/html/add_user.html

and then do a search for

<input type="checkbox" name="spamcheck">

and change it to

<input type="checkbox" name="spamcheck" checked>

This allows the "Spam Detection" box in the users email-account to automatically be checked when each user in qmailadmin is created