On 23 Oct 2020, at 05:47, @lbutlr kremels@kreme.com wrote:
Excellent! That was the secret sauce!
Thank you!
For the sake of completeness, this is what I have ended up with:
#v+ require ["copy", "variables", "envelope", "fileinto", "subaddress"]; # :matches has implicit ^ and $ around the match if not envelope :matches "to" "*backup*" { # get the top level after @ (example.com => example) if envelope :matches "to" "*@*.*" { set :lower "domn" "${2}"; } # get the user without detail (foo+bar => foo) if envelope :user :matches "to" "*" { set :lower "user" "${1}"; } # Un-needed step, but shows what is done in the trace log set "backup" "backup+297.${domn}.${user}@*somedomain*"; redirect :copy "${backup}"; } #v-
(I don't think I need fileinto)
This means that mail for user@domain.tld and user+foo@domain.tld ends up in a mailbox, today, of
backup/Maildir/.297.domain.user/
And user2@domain.tld
backup/Maildir/.297.domain.user2/
(Which means the backup IMAP hierarchy is all sorted DOY=>domain=>user)
I'd like a fail condition if the redirect for some reason cannot send, but that's a project for tomorrow.
-- and I swear it happened just like this: / a sigh, a cry, a hungry kiss, the Gates of Love they budged an inch / I can't say much has happened since / but CLOSING TIME