Operating Postfix

USER ACCOUNTS

we don’t want the file to be created with crazy perms (mail has write access on GNU). the mail user’s default 0022 umask will do the job just fine, as there is a sticky-bit over there already.

cp -pi /etc/default/useradd /etc/default/useradd.dist
vi /etc/default/useradd

CREATE_MAIL_SPOOL=no

create a mailbox

grep ^no /etc/group
#useradd -g nogroup -m check
useradd -g nogroup -m -s /sbin/nologin check
#-k /dev/null
#-s /bin/false
#-s /dev/null

#passwd USER

remove a mailbox and loose its data

userdel -r USER

OPERATIONS

make sure the unix socket for SPF is there

netstat -an | grep policy

check the queue

#mailq
postqueue -p

flush the queue

#runq
#postfix flush
postqueue -f

FROM SOURCE (OR CONTAINER) OPERATIONS

apply minor config change

postfix check && echo ok
postfix reload

restart

which postfix
postfix stop
ps auxww | grep master
postfix check && echo ok
postfix start

and on netbsd eventhough you might have built it from source, YOU CAN keep using system’s built-in rc script

/etc/rc.d/postfix restart

NETBSD OPERATIONS

tail -100 -F /var/log/maillog

/etc/rc.d/postfix restart

and in case this is a custom build

vi /etc/rc.local

/usr/sbin/postfix start && echo -n postfix330
/usr/sbin/postconf -d | grep version

DEBIAN/UBUNTU OPERATIONS

tail -F /var/log/mail.*

systemctl restart psotfix

ACCEPTANCE

see postfix.acceptance

ADDITIONAL NOTES

wipe-out all

postsuper -d ALL

How to delete mail queue in Postfix https://sharadchhetri.com/2014/02/06/how-to-delete-mail-queue-in-postfix/

manual reject

Deal with spam that eventually came through the hereby protections (wow, so that’s a clean spam!): look at the headers what fqdn connected to your MX and reject it manually so it doesn’t spam you again,

vi /etc/postfix/client_access

compute.amazonaws.com   REJECT compute.amazonaws.com is identified as a spam domain
.compute.amazonaws.com  REJECT compute.amazonaws.com is identified as a spam domain

postmap /etc/postfix/client_access

deal with Microsoft

unblock your server from MS’s blacklists:

How to Remove Your IP from the Hotmail Blacklist https://www.rackaid.com/blog/hotmail-blacklist-removal/

Microsoft’s Sender Information Form https://support.live.com/eform.aspx?productKey=edfsmsbl3&ct=eformts&wa=wsignin1.0&scrx=1

deal with Outlook.com

register to live.com and define your IP into SNDS: https://postmaster.live.com/snds/

then file a request to un-block your IP: https://support.microsoft.com/en-us/getsupport?oaspworkflow=start_1.0.0.0&wfname=capsub&productkey=edfsmsbl3

Resources

5 top tips for reviewing your Postfix mail queue https://www.wirehive.com/thoughts/5-top-tips-reviewing-postfix-mail-queue/

How to create linux account with useradd without creating mail spool https://serverfault.com/questions/522556/how-to-create-linux-account-with-useradd-without-creating-mail-spool


HOME | GUIDES | BENCHMARKS | html