This is an old revision of the document!
in case of fast sending, spam problems, ..: always check the mailq! - it is stored in /var/lib/courier/msgs and /var/lib/courier/msgq - you may delete and loose all pending outgoing mail by deleting these folders after stopping courier-mta.
mailq displays a list of all messages that have not been delivered yet:
mailq|less
delete message from mailq - cancelmsg sends an an error mail to the user!:
cancelmsg msgID
Delete ALL messages from mailq - soft version - cancelmsg sends an an error mail to the user!
for i in `mailq | egrep '^[0-9]' | awk ' {print $1}'`; do echo "Dropping message $i..."; cancelmsg $i; done
Brutal way:
/etc/init.d/courier-mta stop /etc/init.d/courier-mta-ssl stop cd /var/lib/courier mv msgs msgserror mv msgq msgqerror mkdir msgs mkdir msgq chown daemon:daemon msgs chown daemon:daemon msgq /etc/init.d/courier-mta start /etc/init.d/courier-mta-ssl start
better scripts: https://github.com/svarshavchik/courier-contrib
generate, check and activate aliases:
makealiases; makealiases -chk; courier flush
find relay errors:
grep "error,relay" /var/log/mail.log|less
WORK IN PROGRESS
set the following in /etc/courier/imapd-ssl, pop3d-ssl, esmtpd,esmtpd-ssl, courierd:
TLS_PROTOCOL="TLS1_2:TLS1_1:TLS1" TLS_CIPHER_LIST="!SSLv2:!SSLv3:TLSv1:TLSv1_1:HIGH:!LOW:!MEDIUM:!EXP:!NULL:!aNULL@STRENGTH"
and additionally this in /etc/courier/imapd-ssl, pop3d-ssl
TLS_STARTTLS_PROTOCOL="TLS1_2:TLS1_1:TLS1"
there are two ways, to configure forwarding of all mails:
1. use $HOME/.courier to setup $HOME/.forward for one account
|| dotforward | /usr/bin/maildrop
2. NOT TESTED: use /etc/courier/courierd to setup “dotforward” for all accounts
DEFAULTDELIVERY="||dotforward | /usr/bin/maildrop"
Put the addresses to forward to in $HOME/.forward.
original-receiver@example.com,test@example.com,test2@example.com
Disable TCPDOPTS -noidentlookup for imap, pop, esamtp. It performs an ident lookup and waits for timeout then.
If SMTP sending is slow, e.g. in webmail, add “-noidentlookup” to /etc/courier/esmtpd's TCPDOPTS
courieresmtpd: error,relay=::ffff:9x.2x6.7x.1x5,from=<mymail@m<domain.net>, to=<friend@otherdomain.net>: 513 Relaying denied.
outbound authentication must be checked within the email client!
(This is the second method if pop-before-smtp fails.)
Please make sure that “Server requires authentication” is enabled in your email client.
importantDNS / reverse DNS rules:
DNS_FROM_AHBL_RHSBL RBL: Envelope sender listed in dnsbl.ahbl.org
remove it from /usr/share/spamassassin/20_dnsbl_tests.cf
if someone sends spam, the address can get a high POSITIVE ranking which leads to spam
remove an address from spam - must be run as root in root's folder:
check all auto-whitelists:
for i in /home/* ; do echo $i; sa-awl $i/.spamassassin/auto-whitelist| grep example; done;