Postfix bodycheck regex

Discussion in 'Tips/Tricks/Mods' started by so1eda, Oct 12, 2016.

  1. so1eda

    so1eda New Member

    Hello friends,
    I've configured a body-filter in ISPConfig 3 but this filter should not match for some special mail addresses. Unfortunately the white list check doesn't work in this case, because the smtpd_sender_restrictions are processed at the beginning of the smtp dialog and the whitelist only after this.

    Example:
    Mails with dropbox, wetransfer or paypal links should be redirected to a special mail address, because we get a lot of pishing mails with this content...
    /(dropbox|wetransfer|paypal)/ REDIRECT admin0example.com

    Now we have some trustworthy customers (i.e. info0customer.com) who send us real links from dropbox. E-Mails from them should not be filtered. I think the only way to do this is a MIME check with a negativ lookahead, but I don't know what's the right way.

    /(?!info0customer.com).*(dropbox|wetransfer|paypal)/
    doesn't work. :-(

    Can anyone help me?
    Best regards...

    PS: Sorry, because I'm new at this forum I can't use the at-sign (I can't post mail addresses), so I've used a 0 for this...
     
    Last edited: Oct 12, 2016
  2. sjau

    sjau Local Meanie Moderator

    The checks work from top to bottom. So you could have rules first for your special cases and signal them with "PASS":

    That way, you can have your special cases first. If they pass, then the mail won't be checked against the other rules.
     
  3. so1eda

    so1eda New Member

    Oh yes! :) Thank you very much. It sounds actually very simple. Why it didn't come to my mind? :confused:
     

Share This Page