assuming you got postfix up and running already
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
not sure we can use group mail
for that account because it seems to be dedicated to few system components
find / -group mail ls -ldF /var/spool/mail/ ls -ldF /var/spool/dma/ ls -ldF /usr/bin/lockfile ls -ldF /usr/bin/procmail
besides, we’re not using the SGID on spool but rather the sticky bit
create a mailbox
grep ^no /etc/group useradd -m -g nogroup -s /sbin/nologin MAIL-USER # -k /dev/null # -s /bin/false # -s /dev/null passwd MAIL-USER ls -alF /var/spool/mail/ chmod 600 /var/spool/mail/root chmod 600 /var/spool/mail/MAIL-USER # once it exists chmod 700 /home/MAIL-USER/
remove a mailbox and loose its data
userdel -r MAIL-USER
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
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
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
tail -F /var/log/mail.* systemctl restart psotfix
postsuper -d ALL
How to delete mail queue in Postfix https://sharadchhetri.com/2014/02/06/how-to-delete-mail-queue-in-postfix/
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
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
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
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