Filtering "Envelope-to:" header problem
-
Hello, Do you have root access to this system? If so, could you open a support ticket using the link in my signature so we can take a closer look at the affected system to see what's happening? You can post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
Thanks for your prompt reply. Unfortunately, I don't have root access (shell) and I can therefore not obtain the Support Access ID information required for opening a ticket. 0 -
I recommend reporting this issue to your web hosting provider so they can take a closer look and open a support ticket with us if necessary. Thank you. 0 -
Thank you for your reply. I have already contacted my web hosting provider. 0 -
Thank you for your reply. I have already contacted my web hosting provider.
Hello, Did you find a solution? I also want to filter my emails depending on the "Envelope-to" because of emails sent with CC and BCC. As reseller I dont understand why I should contact my providor for this subject since they have nothing to do with cpanel and they are not the ones in need of support on this matter and thus they will not be able to give a productive information when creating a ticket on our behalf.... thanks!0 -
@braldesign - this thread is six years old, so the older posters are unlikely to reply. cPanel does have the "any header" filter option, which may be the closest you can get, as we don't have any specific Envelope-to filtering available. 0 -
Hi Rex,
I've just come across this while trying to filter based on the Envelope-to header.
I can confirm that "any header" ignores Envelope-to
This presents a problem because the Envelope-to address is not always inserted into the Received header such as with an "unseen" delivery from an externally filtered email.
I have started relying on cPanel mail filters quite heavily but this problem is particularly disruptive. Do you think this is something that can be looked at? I know there's a lot going on at the moment.
Cheers
Nathan0 -
Nathan - have you submitted a feature request for this behavior? That would likely be the best option for this since it's new behavior, and I could bring it up with the team as soon as this Friday.
0 -
Thanks Rex,
I've just submitted.
Work-around at the moment is to use a Roundcube filter which allows Envelope-to as a user specified customisation.
cheers
Nathan0 -
Thanks so much - I'll let you know the result!
0 -
Nathan - I did send you a support ticket on this, but I'll also reply here.
I did some research on this and I'm not finding that any of the major providers, including Exim on cPanel, use the envelop-to header. Sendmail and Postfix also don't have an option for this by default, as it requires a customization.
I'd be interested to know where you're seeing this header (either the source or mailserver type) and why that is the specific thing that you need to filter.
0 -
Hi Rex,
Thanks for looking into this and apologies for sending you on a wild goose chase. I believe I know what is happening now. I suspect the filter is not triggering because the Envelope-to header is not present in transit when cPanel filters the message.
According to the Exim specification.`Envelope-to:' headers are not part of the standard RFC 822 header set. Exim can be configured to add them to the final delivery of messages. (See the generic `envelope_to_add' transport option.) They should not be present in messages in transit. If the `envelope_to_remove' configuration option is set (the default), Exim removes `Envelope-to:' headers from incoming messages.
This is news to me after 25 years! but many of our customised deployments are configured with an Exim filter using "unseen deliver" which causes the "for" line in the received header to be removed so we rely on "Envelope-to" to filter the received message.
This would explain why Roundcube filters the message successfully. By the time Roundcube looks at the message, the Envelope-to header has been re-written to the delivered message.can you let me know where you were receiving a message from that had this value enabled?
As far as I'm aware, all messages delivered in cPanel have Envelope-to (after the message has been delivered)
Return-Path: <REDACTED@gmail.com> Delivered-To: technical@REDACTED._.au Received: from hosting2.REDACTED._.au by hosting2.REDACTED._.au with LMTP id UiBRLcTAsWpHiToA9CmXmA (envelope-from <REDACTED@gmail.com>) for <technical@REDACTED._.au>; Tue, 22 Sep 2026 09:11:56 +0930 Return-path: <REDACTED@gmail.com> Envelope-to: technical@REDACTED._.au Delivery-date: Tue, 22 Sep 2026 09:11:56 +0930 Received: from mail-pz2-f41.google.com ([74.125.228.41]:39999) by hosting2.REDACTED._.au with esmtps (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.100) (envelope-from <REDACTED@gmail.com>) id 1x8ndz-0000000G5wd-3Z6h for technical@REDACTED._.au; Tue, 22 Sep 2026 09:11:56 +0930
Cheers,
Nathan0 -
I did go ahead and reply to the ticket as well :)
0 -
Cheers... I replied to the ticket.
I know where the envelope_to come from now.
It's defined for the Dovecot delivery transport in /etc/exim.confdovecot_delivery:
driver = lmtp
socket = /var/run/dovecot/lmtp
batch_max = 200
batch_id = "$r_cpanel_user ${if def:r_bcc_addr {$r_bcc_addr}}"
rcpt_include_affixes
delivery_date_add
envelope_to_add
return_path_addThis is from a Cloudlinux 8 cPanel deployment.
If you're not seeing it then maybe envelope_to_add has been removed in recent versions.
0 -
I created case CPANEL-57184 to have our team look into the "any header" not really acting on *any* header. I did add some more details in the ticket, but hopefully that gets resolved soon!
0
Please sign in to leave a comment.
Comments
15 comments