[2025-02-18 15:39] Tassilo Philipp <tphil...@potion-studios.com>
> Maybe I misunderstand... but you have "mail-from regex" and "rcpt-to 
> regex", which covers all those use cases, no?

My usecase is to lookup the uid or the cn of ldap users/groups.
regex lookups don't work with external tables.

A bit more general, I don't think regex is a good tool to use for config
and it should be possible to avoid them for common config. I would say
it makes the config better to understand without regex use. In my
opinion matching the local part of the recipient or the domain of the
sender is common enough to have some code for it.

Philipp

> On Wed, Jan 08, 2025 at 08:05:23AM +0100, Philipp wrote:
> > Hi
> >
> > The match rules for the sender and recipient are currently only match 
> > the full mail addresses. So you can not match local part or domains in 
> > them. There are some workarounds for this, but they depend on the 
> > concrete table implementation.
> >
> > It would be nice to have a general syntax for this. I would prefere 
> > to have an optional parameter ``address-part'' for these conditions. 
> > So the syntax would look something like this:
> >
> >     [from] mail-from [full|localpart|domain] sender|<sender>
> >     [for] rcpt-to [full|localpart|domain] recipient|<recipient>
> >
> > The biggest problem with this is that the "domain" keyword now is used 
> > twice. But I don't know a better keyword. The "rcpt-to domain" part is 
> > redundant, but I have added it for symetry.
> >
> > To implement this I would extend the ruleset_match_smtp_mail_from() 
> > and ruleset_match_smtp_rcpt_to().
> >
> > What do you think about this idea?
> >
> > Philipp
> >

Reply via email to