On 22 Oct 2020, at 10:05, @lbutlr <kremels at kreme.com> wrote:> require ["variables", "copy"]; > > if address :matches ["To", "Cc"] ["*@*."] { > redirect :copy "backup+295.${1}.${2}@*example.com*"; > }I have tried this with similar results: require ["copy", "variables", "envelope", "fileinto", "subaddress"]; if envelope :matches :detail "to" "*" { set :lower "name" "${1}"; redirect :copy "backup+295.${name}@@*example.com*"; } ## Started executing script 'bcc' 5: envelope test 5: starting `:matches' match with `i;ascii-casemap' comparator: 5: getting `to' part from message envelope 5: extracting `detail' part from address <kremels at kreme.com> 5: finishing match with result: not matched 5: jump if result is false 5: jumping to line 7 ## Finished executing script 'bcc' So why are these not matching? I can see the 'detail' right there, and this matches examples that I see online. (I've read, I think, every page google or DDG can find that contains "redirect :copy" to no avail). -- I'm no psychologist (although I play one when I'm picking up chicks over by the asylum)
> On Oct 22, 2020, at 12:19, @lbutlr <kremels at kreme.com> wrote: > > On 22 Oct 2020, at 10:05, @lbutlr <kremels at kreme.com> wrote: >> require ["variables", "copy"]; >> >> if address :matches ["To", "Cc"] ["*@*."] { >> redirect :copy "backup+295.${1}.${2}@*example.com*"; >> } > > I have tried this with similar results: > > require ["copy", "variables", "envelope", "fileinto", "subaddress"]; > > if envelope :matches :detail "to" "*" { > set :lower "name" "${1}"; > redirect :copy "backup+295.${name}@@*example.com*"; > } > > ## Started executing script 'bcc' > 5: envelope test > 5: starting `:matches' match with `i;ascii-casemap' comparator: > 5: getting `to' part from message envelope > 5: extracting `detail' part from address <kremels at kreme.com> > 5: finishing match with result: not matched > 5: jump if result is false > 5: jumping to line 7 > ## Finished executing script 'bcc' > > So why are these not matching? I can see the 'detail' right there, and this matches examples that I see online. > > (I've read, I think, every page google or DDG can find that contains "redirect :copy" to no avail). >If I read that bcc trace, it says ?extracting ?detail? part from address <kremels at kreme.com <mailto:kremels at kreme.com>>?. ?kremels at kreme.com <mailto:kremels at kreme.com>? does not have a :detail part (https://wiki2.dovecot.org/Pigeonhole/Sieve/Examples <https://wiki2.dovecot.org/Pigeonhole/Sieve/Examples> talks about this). If it were ?kremels+thing at kreme.com <mailto:kremels+thing at kreme.com>? then the net line out to say ?finished match with result: ?thing?? or some such. My notes from my sieve file: # :localpart = :user+:detail # address are :localpart @ :domain, or :user + :detail @ :domain # See RFC5233 Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20201022/5c83f65b/attachment.html>
On 22 Oct 2020, at 15:10, Sean Kamath <kamath at moltingpenguin.com> wrote:> On Oct 22, 2020, at 12:19, @lbutlr <kremels at kreme.com> wrote: >> On 22 Oct 2020, at 10:05, @lbutlr <kremels at kreme.com> wrote: >>> if address :matches ["To", "Cc"] ["*@*."] {>> if envelope :matches :detail "to" "*" { >> set :lower "name" "${1}"; >> redirect :copy "backup+295.${name}@@*example.com*"; >> } >> >> ## Started executing script 'bcc' >> 5: envelope test >> 5: starting `:matches' match with `i;ascii-casemap' comparator: >> 5: getting `to' part from message envelope >> 5: extracting `detail' part from address <kremels at kreme.com> >> 5: finishing match with result: not matched >> 5: jump if result is false >> 5: jumping to line 7 >> ## Finished executing script 'bcc'> If I read that bcc trace, it says ?extracting ?detail? part from address <kremels at kreme.com>?.OK, but that exact line is used in several examples online to get the email address. And it doesn't explain why "if address :matches ["To", "Cc"] ["*@*."] {" also failed to match despite also showing the email address.> ?kremels at kreme.com? does not have a :detail part (https://wiki2.dovecot.org/Pigeonhole/Sieve/Examples talks about this).And I am not asking for :detail, nor am I trying to the the address extension/plus address.> If it were ?kremels+thing at kreme.com? then the net line out to say ?finished match with result: ?thing?? or some such.It should not because I am not asking for the detail, I am only asking for :matches "*" -- "Are you pondering what I'm pondering?" "Well, I think so, Brain, but I can't memorize a whole opera in Yiddish."