Mailsecure
Premade - after install reply.
Hello, I have activated MailSecure for the DOMAINSHERE domain. You'll begin to see emails coming in with a [spam] tag in the subject line; these are the emails the firewall found to be suspicious or spam-like. All of these emails should also be automatically filtered to your spam folder under every email account on this domain. Please let us know if you have any questions or concerns, or if the service is not working as expected.
Hello, Unfortunately, at this time, we do not have a means for customers to view or alter the MailSecure settings. This may be something available in the future, but for the time being, we will need to make any changes on your behalf, and we are always happy to do so. I have the firewall set up not to block any of the emails, but to put them into the spam folders under the email accounts. For a few days, I would like you to make sure that none of your legitimate emails are being flagged as spam. Then, once the filter level is working well, we can switch the firewall to block the emails outright, rather than filter them. Please let me know if you have any further questions or concerns.
Make domain list(put the domains the want in here)
vim /root/mailsecurelist
Run this for loop to use the domain list to backup each domains zone file, then remove the old mx entries, and add the new ones as well as update the ttls and serials all at once.
for i in `cat mailsecurelist`; do sed -i.lwbak -e '/IN[[:space:]]*MX/d' /var/named/$i.db; echo "$i. 300 IN MX 0 bmx01.sourcedns.com." >> /var/named/$i.db; echo "$i. 300 IN MX 0 bmx02.sourcedns.com." >> /var/named/$i.db; sed -i -e 's/^\$TTL.*/$TTL 300/g' -e 's/[0-9]\{10\}/'`date +%Y%m%d%H`'/g' /var/named/$i.db; done
test work
for i in `cat /root/mailsecurelist`; do grep --color "\$TTL" /var/named/$i.db; grep --color -e '[0-9]\{10\}' /var/named/$i.db; egrep --color 'IN[[:space:]]*MX' /var/named/$i.db; done
Reload name server.
rndc reload