Postfix Notes


>>To purge an item from the mailq

        find the item in the mailq and type: postsuper -d queueid

>>To delete everthing in the queue

         go to /var/spool/postfix

         most queued mail will be in directories like /flush, /active, etc. 

         so if they were in /var/spool/postfix/flush/ you could issue the command:

         find /var/spool/postfix/flush -type f | xargs rm

>>If there is a mail item having problems, go to /var/spool/postfix.

    Type: find . -type f

    to see the deferred directory location cd to the location, postcat the file

>>To search for a particular message

    grep -nri "clueword" * .

    (e.g., grep -nri "^Subject:.*Brim.*" .)

    (The ^ means beginning of line, and the .* means to match any string of xxxx characters)

>>Adding user to sasl

        saslpasswd -c -u "" accountname

    Updating a users password in sasl

        saslpasswd -u "" accountname

    Delete user in sasl

        saslpasswd -d -u "" accountname

    Query sasldb


    If I have to change the sasl database, make sure the permissions are: root.postfix and 640

    After changing sasldb in /etc/ copy it to /var/spool/postfix/etc/  (cp -a to preserve permissions)

    [it might be a good idea to create a soft link from /var/spool/postfix/etc/sasldb to /etc/sasldb

>>Change LDAP domain name

    Open LDAP Explorer.

    For Bind DN As.... Enter "cn=root,dc=domain,dc=com"

    Bind password: see password file.

Create new POP3 and IMAP certificates

go to: /usr/lib/courier-imap/share/

remove the expired certs: imapd.pem and pop3d.pem

then issue the commands:



    •     create a *.cer file from a *.pem file: openssl x509 -in my-cert.pem -inform PEM -out my-cert.cer -outform DEN 

    •     create a *.pem file from a *.cer file: openssl x509 -in my-cert.cer -inform DEN -out my-cert.pem -outform PEM 

Sophos SMTP

To change email scanning parameters:


To stop and start email scanning:


mmsmtpd -terminate

mmsmtpd -start