I'm now nearly there in sorting the mail server on the new server. I worked out what the big problem was this morning.
The main domain for the old server (what you got if you asked the various ip lookup utilities what domain name was associated with its ip address) was 'example.com' (not really, but…) and when I got the old server, I used to use firstname.lastname@example.org as an email address for various things.
Unfortunately, before long it got spammed to death, so I stopped using it.
Then the spammers started backscattering the domain (sending email to random addresses at it, in the hope that some of them would be read one way or another).
So I put the following in the virtual-maps file that the mail server uses to decide where to deliver mail to the various domains:
email@example.com ian firstname.lastname@example.org drop email@example.com firstname.lastname@example.org email@example.com firstname.lastname@example.org @example.com drop
.. or, in English, send mail to a new address to my account's mailbox; drop (silently throw away by sending to the /dev/null 'file') mail to email@example.com; send 'every domain should have these addresses work' mail to a Gmail account and let them spam filter it; and drop everything else.
Elsewhere in these instructions, lovingboth.com mail was sent to the lovingboth account's local mailbox and a Gmail account (thank you Google for a free mail backup / webmail access).
Worked fine for years.
OK let's copy this working config to the new server, the new example.com.
See a recent entry, but it tuns out that since a few Postfix versions ago,
no longer works without some faff. You're supposed to do
instead. So I add example.com to all the various instructions.
Hmm, firstname.lastname@example.org gets dropped. Let's undo that, and send it to the ian mailbox instead.
Hmm, it's still getting spammed, but greylisting and insisting that people trying to send mail to it follow various rules they're supposed to (real servers do, spammers often don't bother) catches 99% of that.
But for some reason, email@example.com mail is being locally dropped. I know the virtual-maps file is being used, because the mail is being sent to the Gmail account. But it's not being put into the local lovingboth mailbox.
Why? Why? Why?
See how long it takes you to realise why…