How to let Cpanel Server know the "Delivery status of relayed mail"

leehuynhf

New Member
Jul 31, 2021
1
0
1
33
Dear everyone,
I'm using proxmox as a relay mail server of my WHM/Cpanel Server. All the outgoing mail from The Cpanel server was relayed via proxmox server.
The Issues is the handle of spam user while send outgoing mail. On Cpanel, which have a setting to block a domain which have 5 failed or deferred emails in hour. But if relay via promox, all the mails sending from Cpanel is accepted status even it failed (like sending to a wrong email account, wrong domain, etc..), only promox know the status of those mails. If we see on the "Tracking Center", the status of failed mail like "accepted/bounced", or "accepted/deferred then Cpanel know those mails is accepted (not failed or deferred ) and the limit "5 failed emails in hour" will not work.
For all that, The question is: Is it possible to let Cpanel Server know the "Delivery status of relayed mail" ?
Thank you so much
 
I don't think that this is (easily) doable:
* for SMTP servers once a mail has been handed to the next-hop (i.e. for you Cpanel it has been handed to PMG) - it's job is done
* The question is when/how PMG could know whether the mail will not get accept from it's final destination (or next hop) - if PMG knows this before trying to relay it to the next-hop (because PMG decides not to send out the mail) then it can answer to Cpanel with 5xx or 4xx respectively
* for this you need to enable before-queue filtering:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_mail_proxy_configuration (section 4.7.5.)

Else - you can in theory check for queued/deferred mail in PMG via the REST-API and use that in Cpanel -
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/nodes/{node}/postfix/queue/{queue}

but this sounds quite complicated.

Finally some users have implemented some kind of outbound ratelimiting with postfwd
- see e.g. https://forum.proxmox.com/threads/sender-rate-limit-to-prevent-spam.86021/#post-397342
(or search the forum)

I hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!