Hi,
some explanations:
A mail can have two stages: prequeue and postqueue. Prequeue is a stage, where the mail is still in the connection dialogue with the sending mail server, so at this stage it's possible to reject a message, that the sending mailserver get informed, this message is rejected and can inform the sender. Postqueue is a stage, where the mail has already been accepted by the receiving mail server, so the sending mail server already got a 250 OK code, so the sending mail server is expecting the mail been delivered well and does not expect any other state and also may inform the sender, that the mail is well delivered. If you want to "reject" a message at this stage, a NDR is required, however, such NDR are seen as backscattering, as spammers or other criminals may flood mail servers with mails, they would "postreject" and send NDRs to senders, which never sent the mail, so you get a spammer too that way, because of that, it's bad practice to send NDR, it's much better to reject at connection level. In addition in Germany it's illegal, if a mail is in postqueue stage and you will block the message here without reject at connection level (which is not possible any more in postqueue) or NDR as then you suppress the message and that's illegal.
The current PMG setup is, that PMG does some checks for spam mails:
1. pregreet checks like does the sending mail server have a fqdn, is the fqdn solvable and does it fit the connection IP etc. => prequeue
2. spf and greylisting checks (although I recommend to use non of them) => prequeue
3. rbl blacklists as given in the mail options via PMG UI => prequeue
4. mail server black- and whitelists (at mail options level in PMG UI) => prequeue
5. spamassassin content check => postqueue
6. clamav content check => postqueue
7. pmg rules check (also any RegEx, black- and whitelists not been performed at mail options level) => postqueue
What I improved to PMG is:
3a. I add dbl blacklists which also check the helo, sender server, sender address etc. against a domain blacklist => prequeue
3b. I add an additional spamassassin content check (like 5) via milter integration to reject at a particular level => prequeue
Beside the possibility, that Proxmox in future will change from postqueue to prequeue checking by adjusting their pmg-smtp-filter, which perform all the steps 5 to 7, as been able to be "miltered", what I would welcome as well as greylisting just at a particular spam score level (only possible as well, if performing the spamassassin check upfront, also would require greylisting to be invoked by pmg-smtp-filter to be able to conditional invoke greylisting) as been seen by rspamd, that is a great idea as I saw there, that possible spam mails got rejected at second connection try because of getting blacklisted at rbl or dbl blacklists in the meanwhile (see
https://bugzilla.proxmox.com/show_bug.cgi?id=1890), you have two options to reject messages:
1. blacklist at mail options level
2. create your own header or body checks with postfix via CLI
3. create a spamassassin rule with high score and integrate spamassassin (additional) via milter as in my explanations
I wouldn't do rejects on your destination server instead of PMG as then you would only be able to suppress the message (as reject will be performed against PMG, not against the sending server) or do NDR, which I would not recommend.
However, I also won't recommend to blacklist every domain, which send mail to an unknown recipient. This could result in many false-positives if a sender just did a mistake or written the recipient address in a wrong style. If you try to establish honeypots like scrollout f1 included, you may therefor set up a honeypot blacklist. I'm still unsure here, if blacklisting IP or domain is a good way or if it's better for such "stupid spam" to set up a mailbox, which you always learn as spam to spamassassin to be sure, that such spam is rejected, however, it's somehow similar as importing foreign spam: You would dilute your spamassassin quality with such "stupid" spam. So maybe you should setup a blacklist server here (any may contribute to others), I did not found any server software therefor yet, maybe have a look here:
http://drbl.gremlin.ru/en.html#soft or file a feature bug to get sth. similar from Proxmox or ask a the Scrollout project, if they would extract that part of their code as extra project (I would welcome also).
Regards,
Christian