The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Email filtering question: Filtering on "Envelop-to:" field?

Discussion in 'E-mail Discussions' started by vltech, Jan 24, 2013.

  1. vltech

    vltech Registered

    Jan 24, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Website Owner
    I'm in a shared hosting environment, with several domains on my account. I do NOT have root or even shell access. I need to be able to filter against the "Envelope-to:" field (matching a regex). Is there a way to do that?

    More broadly, I'm trying to filter on recipients (with a regex). The only options I've found are:
    1) Filtering on the TO field, which fails to work for email sent CC, BCC, DCC and via email lists.
    2) Filtering on the "Any header" field, which fails to work when an email is sent to more than one person at a domain and false positives if a local email address is mentioned in any other field (just imagine the hilarity of jack@mydomain.tld emailing jane@mydomain.tld with a subject line "Who is this james@mydomain.tld jerk???" The "Any header" criterion would match that and send a copy to james, which while excellent comedy is less excellent mail filtering behavior.)

    In case it weren't obvious from the examples: I'm trying to implement plus addressing, at least the incoming side of the problem. "jack+arbitrarystring@mydomain.tld" needs to deliver to "jack@mydomain.tld", while "jane+arbitrarystring@mydomain.tld" needs to deliver to "jane@mydomain.tld", while "spammermadeupaccountname@mydomain.tld" needs to either bounce as user not found or deliver to either a special account for crap or /dev/null. Jack should be able to subscribe to the cpanellovers-l email list with the email address jack+cpanel@mydomain.tld, and have the list emails delivered to jack@mydomain.tld despite the fact that jack@mydomain.tld and jack+cpanel@mydomain.tld never appear in the To field of the messages, and jack+cpanel@mydomain.tld is only reflected in the messages' Envelope-to field. Further, Jack should then be able to filter emails with an Envelope-to jack+cpanel@mydomain.tld and jack+apache@mydomain.tld and jack+postgresql@mydomain.tld to his "TechForums" folder, while his jack+mom@mydomain.tld, jack+stacey@mydomain.tld, and jack+thesmiths@mydomains.tld emails get put in his "Family" folder.

    Surely this possible? It's pretty basic. How is it done?

Share This Page