Route forwarder mails via another server

Oct 24, 2009

At the outset let me give a brief description of our setup.

We have many cpanel shared servers. As of now all the outgoing emails from these shared servers are routed via another server. The relay server has postfix+policyd set [Policyd is nothing but a utility to limit the number of outgoing/incoming mails as per our requirement].

In the Postfix server the limit set in policyd is like:

- X mails per sender [ eg: [email protected]] per hour
- Y mails per domain [ eg:] per hour

So once the limit X,Y is reached, mails will be sent back to the sender itself.

Also, postfix server has some more checks like only the mails coming from shared servers will be processed [IP address is checked]

Coming to the actual issue:

Incase of forwarder mails, the from address is the actual sender address. To elaborate, suppose I have a forwarder set via cPanel as shown below:

All the mails for [email protected] will be forwarded to [email protected]

Now suppose I am sending a mail from [email protected] to [email protected]. So as per the forwarder being set the mail will be forwarded to [email protected], and as per my set up it will be relaying via the Postfix server.

Mail from '[email protected]' -----> to '[email protected]' -------> forwarded to '[email protected]'
As per my understanding, the mail header shows the from address in case of forwarder mail as '[email protected]' itself.

Now say, there are many accounts for which forwarders are set. And the customers are sending mails from to forwarder mail addresses. But when the limit Y is reached at the relay server for '', the mails start bouncing back. Which means in an hour only about Y forwarder mails with sender domain as 'gmail' will be allowed to send.

So was thinking of relaying mails being forwarded via another server. Or else just sending the mails being forwarded via the shared server itself [and not being relayed]. But I am not sure if this can be done, also tried some hit and trial methods, but didn't work out.

Please let me know your thoughts/tips. Also if any other method can be used to fix this issue.

Thanks in advance.