Problem with rule when subject is multi lines

f4242

Well-Known Member
Dec 19, 2016
101
4
58
Quebec, QC
Hello,

I created a rule for incoming mail that add a suffix to the mail subject. This usually work fine but I found that some mails are not being tagged. I found that theses mails have something in common. The "subject" field contain a line return so the subject is displaying on two or more lines when I look at the mail headers.

A sample mail that expose the problem (message is not tagged):

Code:
telnet mail.myorg.tld 25
EHLO mail.example.com
MAIL FROM:<me@gmail.com>
RCPT TO:<me@myorg.tld>
DATA
Subject: testing123
   b

asdf
.

The problem seem to be related with the folllowing "what" exclusion rule, because the message is tagged correctly if I don't set this condition in my mail rule:

V6kzVYuG35ig.png


So this rule should not execute only mail when subject already contain my "[EXTERNE]" tag.

Is there something I can do to avoid this issue?

Thanks!

pmg-api/5.2-7/9943bd5d (running kernel: 4.15.18-25-pve)
 
Last edited:
what do you want to match exactly?
afaiu you want to match all mails which do not start with '[EXTERNE]' ?

if yes, i would change the regex to : ^(?!\[EXTERNE\])
 
I want to match any mails not containing the string "[EXTERNE]" at all in the subject field. The goal is to tag only a message if the tag is not already present (when users are receiving a reply of a reply, the tag would be already there).
 
ah yes, after reading it again of course ^^
you can try with this regex:

^((?!\[EXTERNE\])(?:.|\r?\n))*$

i guess this should be what you want...
 
One more thing, the regexp doesn't match when the subject field is missing. How could I mark my message as external if the subject field is missing? If I don't add the "what" exclusion rule it works fine and the subject become "No Subject [EXTERNE]".
 

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!