From the Notes section of my sieve file, because I always forget this
# 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).
Sean
On Nov 16, 2019, at 09:46, @lbutlr via dovecot <dovecot@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; }
When I get an email addressed to me+FOO@example.com or me_florin@example.com, the messages end up in my inbox (Yes, I have both + and _ defined as delimiters in postfix and in dovecot).
Is this because sieve is not seeing the delimiter? I am wondering this because I have another rule that seems to be working fine that is largely the same, but operates on domains:
if anyof ( header :contains ["From"] [“kreme.com", “localdomain1.tld”, "localdomain2.tld", "localdomain3.tld", “covisp.net” ]){ fileinto :create "priority"; }
-- She'd always tried to face towards the light. But the harder you stared into the brightness the harsher it burned into you until, at last, the temptation picked you up and bid you turn around to see how long, rich, strong and dark, streaming away behind you, your shadow had become- --Carpe Jugulum