Although I’ve used many MTA’s before, I’m new to postfix so here’s a few handy commands to note: List the mail queue: postqueue -p or mailq Delete a single message: postsuper -d 4C63F2300BA
Archive for the ‘Email’ Category
Exchange 2007 – Renewing self signed SSL
If your running Exchange 2007 and you don’t really have the need for an SSL that’s issued by a valid CA, then you can just renew the self signed one that’s automatically generated on server build. Most devices are happy to connect to an unsigned SSL once an exceptions been made, but they may well [...]
Spamassassin 2010 bug
A bit of an oversight – old versions of Spamassassin have an inbuilt rule to block emails with a future date. Not a bad idea really, but the rule starts blocking things from 2010! The rule should be fixed in newer versions, however Plesk for example uses a fairly old version. You can edit the [...]
qmail adds number to recipient header
qmail sometimes adds a number to the recipient header when delivering mail locally, so for example, user@domain.com may become 3-user@domain.com. This isn’t such a problem when mail is just being used locally, but if your using a POP connector to download mail to an Exchange server for example it will cause issues with it getting [...]
SMTP Reply codes
Code Meaning 200 (nonstandard success response, see rfc876) 211 System status, or system help reply 214 Help message 220 <domain> Service ready 221 <domain> Service closing transmission channel 250 Requested mail action okay, completed 251 User not local; will forward to <forward-path> 354 Start mail input; [...]
POP3S IMAPS and SMTPS on Plesk
Setup SSL certificates for mail services (pop3s, imaps, smtps) on Plesk / Courier-Imap / Qmail Either get a certificate from a CA: openssl genrsa 1024 > host.key openssl req -new -nodes -key host.key -out host.csr Put the certificate received into host.crt or generate your own: openssl genrsa 1024 > host.key openssl req -new -x509 -nodes [...]
Test an email against Spamassassin
To run an email through spamassassin to test how “spamlike” it is, put email+ headers in file: cat file | spamassassin -t
Creating custom Spamassassin rules
example: body Job_Scam_Rule /craftmediadepartment|LOUWILLE ENGINEERING|ABLE TEXTILE DEPARTMENT/ describe Job_Scam_Rule “Spam is not allowed” score Job_Scam_Rule 2000 2000 2000 2000 or header LOCAL_ED_SUBJECT Subject =~ /\bED\b/ score LOCAL_ED_SUBJECT 40 needs to go in the users user_prefs file if allow_user_rules is enabled in local.cf. Otherwise can be done on a serverwide basis in /etc/mail/spamassassin/local.cf or similar manual: [...]
Managing the Qmail queue
/var/qmail/bin/qmail-qstat or for more detailed info: /var/qmail/bin/qmail-qread qmail configuration: /var/qmail/control list count of email addresses in queue grep -h “^From:” /var/qmail/queue/mess/*/* | sort | uniq -d -c for big big queues: (will take a while) find /var/qmail/queue/mess/21/ -type f -print0 | xargs -0 -P1 -n64 grep -h “^From:” |sort | uniq -d -c search through [...]
Managing the Postfix queue
This command will delete one specific email address from the mail queue (taken from the postsuper man page): #mailq | tail +2 | grep -v ‘^ *(‘ | awk ‘BEGIN { RS = “” } { if ($8 == “email@address.com” && $9 == “”) print $1 } ‘ | tr -d ‘*!’ | postsuper -d [...]