Koozali.org: home of the SME Server

mail sorting and filter pattern

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
mail sorting and filter pattern
« on: September 29, 2020, 01:11:33 AM »
I have a group of incoming email addresses that need to be moved to a single directory in the mail tree. The idea is that  incoming email from Ann, Bob, Cathy, Doug, Ed or Francis, should be put in the IMAP directory named, say, "Tree Project".

Individual rules work fine, of course, but being a lazy man I wondered if there was way to set up a single filter for it. None of these people have SME user accounts.

I believe the mail sort contrib uses regex for the filter parsing, so I tried using pipes between the incoming addresses. I found that pipes are not allowed. I also tried a comma delimited string but that appears to function like "and".

How might I set up an "or" filter?

Perhaps a better question is "What flavor of regex is used in SME/mail sort?"
- Mark

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: mail sorting and filter pattern
« Reply #1 on: September 29, 2020, 11:23:25 AM »
How does ths mail come in?

POP3 or SMTP?

Either way the mail must be be ultimately directed to a user account eg admin.

Can you use mail sorting contrib with procmail to sort it?

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: mail sorting and filter pattern
« Reply #2 on: September 29, 2020, 05:18:45 PM »
How does ths mail come in?

POP3 or SMTP?

Either way the mail must be be ultimately directed to a user account eg admin.

Can you use mail sorting contrib with procmail to sort it?

SMTP

Yes, there is an SME user account that hosts the target directory.

The mail sort contrib is installed and is using procmail. Presently, the user account in question has a bit more than 260 rules defined.
- Mark

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: mail sorting and filter pattern
« Reply #3 on: September 29, 2020, 06:11:27 PM »
The rules are pretty simple. I think it is tricky to parse/save more complex searches via the web panel.

You could just write a custom procmail template to do more complex commands.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation