Sieve and recipient_delimiter
@lbutlr
kremels at kreme.com
Sun Nov 17 09:24:59 EET 2019
On 16 Nov 2019, at 22:06, Sean Kamath <kamath at moltingpenguin.com> wrote:
> On Nov 16, 2019, at 09:46, @lbutlr via dovecot <dovecot at dovecot.org> wrote:
>> I use recipient_delimiter addresseses quiet a bit, and I want to put several of them into a mailbox
>>
>> if anyof (header :contains ["to"] [ “FOO", “foo", “bar", “florin"]) {
>> fileinto :create “later";
>> stop;
>> }
> # MORE NOTES:
> # Using :localpart takes just the local part of an address
> # header selects a header, address selects an address
> # Looks like this is the spec:
> # :localpart = :user+:detail
> # address are :localpart @ :domain, or :user + :detail @ :domain
> # See RFC5233
>
> I use this bit for figuring out what :detail something (might) be going to:
>
> # Check to see if we have detail. . .
> if address :matches :detail "To" "*" {
> # Save name in ${detail} in all lowercase
> # Joe, joe, jOe thus all become 'joe'.
> # Note that we set it to lower, not first-cap
> # because we're going to use this name for a mailbox
> set :lower "detail" "${1}";
> set :lower "user" "${def_user}”;
> }
>
> I don’t know where I got this from, but I am pretty sure it was on this list. :-)
>
> I use it to bucket email based on detail (if no detail, it goes into the address’s default folder, otherwise it goes into the detail folder).
While this is interesting, I am not using if address :matches, I am using if header :contains.
--
"A common mistake people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools.: -
Douglas Adams
More information about the dovecot
mailing list