Blue Flower

Monday, 06 July 2015 00:45

Configuring POP3D-SSL

Written by

This HOWTO covers the configuration of Courier pop3d with SSL. This HOWTO assumes you have installed Courier's IMAP/POP3 installation.

Please note that paths may vary from distro to distro

# cp /usr/local/etc/pop3d-ssl.dist /usr/local/etc/pop3d-ssl
# cp /usr/local/etc/pop3d.dist /usr/local/etc/pop3d

Modify /usr/local/etc/pop3d-ssl so it includes the below lines.


Create the pop3d-ssl cert by running the following command.

# /usr/local/sbin/mkpop3dcert

Create the pop3d-ssl start script and start pop3d-ssl, by running the below commands.

# cp /usr/local/libexec/pop3d-ssl.rc /usr/local/etc/rc.d/init.d/pop3s
# /usr/local/etc/rc.d/pop3s start

Add the last line above to /etc/rc.local to ensure pop3d-ssl starts at boot.

Installing your SSL Certificate into Outlook or Outlook Express

The PEM file holds your certificate and your private key. Split them into
two files using a text editor and copy commands:
cp blah.pem usercert.pem
cp blah.pem userkey.pem

In usercert.pem delete the section for the private key
(marked with ---- BEGIN RSA PRIVATE KEY ---- and ---- END RSA PRIVATE KEY ----)

In userkey.pem delete everything but the private key

To convert the current .pem to a readable format so Outlook can import it, we use this method:

From .pem to .p12

openssl pkcs12 -export -out cert.p12 -inkey ./userkey.pem -in ./usercert.pem

It will ask you to enter your PEM pass phrase twice. Enter both correctly and you will now have a .p12 file!

Monday, 06 July 2015 00:45

Unable to write pipe error

Written by

SMTP Daemon Cannot Start in Solaris

Change in the run scritps

QMAILDUID=`/usr/bin/id -u qmaild`
NOFILESGID=`/usr/bin/id -g qmaild`


QMAILDUID=`/usr/xpg4/bin/id -u qmaild`
NOFILESGID=`/usr/xpg4/bin/id -g qmaild`


POP3 & SMTP Validation say "Unable to Write Pipe"

Check in run Scripts the system home of the vpopmail user

Special thanks to Jorge Grosso

Monday, 06 July 2015 00:43

Setting a default Domain

Written by

Modify or create /var/qmail/control/defaultdomain and /home/vpopmail/etc/defaultdomain to specify your default domain. This will allow your users to just use their username to login rather than their entire email address.

Monday, 06 July 2015 00:43

How to blacklist domains

Written by

The file "/var/qmail/control/badmailfrom" is used by qmail-smtpd to reject certain email addresses or domains in the envelope. lines in this file may look like " This email address is being protected from spambots. You need JavaScript enabled to view it. ", or "" to block the entire domain.

if you create this file, make sure to IMMEDIATELY do "chmod 644" on it so that qmail-smtpd can read it. creating or changing this file does not necessitate restarting qmail or the smtp service, but if any messages try to come in during the time between when you create the file and when you set the permissions on it, those message will be refused with the error message "unable to read controls".

however, this only checks the ENVELOPE sender- whatever the sending machine puts in the MAIL FROM: command. it doesn't look at the "From:" header inside the message. spammers will often use different email addresses for their envelope senders and their "From:" headers- but there are times when legitimate users do it as well, which means this is not a reliable flag for spam.

To check based on header values, you may want to look at writing some custom spamassassin rules so that mail with "From:" headers from these domains will be considered spam.

Monday, 06 July 2015 00:42

Why don't my images show up in qmailadmin

Written by

Most reasons why you don't see images in qmailadmin is because the images are generally not where they are supposed to be. The easy fix for this is to look at /var/log/apache-error.log and see exactly where Apache is looking for those images.
Then copy /downloads/qmailrocks/qmailadmin-x.x.x/images/ (copy the entire images folder) to the place where Apache is looking for those images.

Visitor Comments:

Comment #1 (Posted by DanThis )

For me, this problem occurred because I followed the QMR installation to the letter.
In step 13 (Installing Squirrelmail), the instructions say to edit httpd.conf to define a VirtualHost with your IP address, and to make the DocumentRoot inside your webmail directory. This causes any request to your system to default to that VirtualHost, and that DocumentRoot. Instead, define your VirtualHost with your FQDN, and that should resolve the issue, since the /images folder for qmailadmin will resolve correctly when you visit the qmailadmin page.

Monday, 06 July 2015 00:42

Getting qmailstats to show daily stats only

Written by

For those that are interested, I've found making the following changes
works well.  Since qmailrocks sets up the qmailstats to run once a
day, I changed it to only look at the last days worth (the only way
this works is if you set multilog to rotate the logs (according to its
log size) no more than once a day.

edit the /var/qmail/qmailstats script (which should be in the
/etc/crontab to run once daily) by changing the line:

cat /var/log/qmail/qmail-send/* /var/log/qmail/qmail-pop3d/*
/var/log/qmail/qmail/qmail-smtpd/* | tai64n2tai | awk
'{$1=substr($1,1,index($1,".")+6);print}' | matchup > $QMAILSTATS


cat /var/log/qmail/qmail-send/current
/var/log/qmail/qmail/qmail-smtpd/current | tai64n2tai | awk
'{$1=substr($1,1,index($1,".")+6);print}' | matchup > $QMAILSTATS

What this does it tells the qmailanalog to only look at the log files
that haven't been rotated yet.  Next, add the following line to the
very bottom of the script:

svc -h /service/qmail-smtpd/log /service/qmail-pop3d/log /service/qmail-send/log

I believe -a will work as well, but since I don't understand what it
does and I know the -h works, that's what I'm using.

This forces multilog to rotate the logs whether they need it or not.
If you have multilog set to rotate large files (for my small server
100k is ample), then you'll end up with a rotation once a day and your
qmailstats email (once a day) will reflect only the previous 24 hours.

DISCLAIMER: This may undo multilogs excellent method of using only a
certain amount of disk space for logs, so...  Keep an eye on your logs
and make sure you have enough history for your liking and not taking
up too much disk space.  Tweak the multilog settings (found in
/service/foo/log/run ) accordingly.  As always make backups of
everything before editing, and take my advice with great skepticism

Special thanks to Silver Fox

Page 15 of 23