Adam Raszkiewicz
2018-Sep-19 19:54 UTC
[Sieve] Matches on body content - looking for working example
I have tried to do something like
if body :content ["multipart"] :matches
["Original-Message-ID" ?*?] { set "Original_Message_ID"
"${0}"; }
but instead getting Original Message ID I?m getting value from previous match
which was
if envelope :matches "From" "*" { set "sender"
"${0}"; }
Is there any example of working :matches matching-type with body?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://dovecot.org/pipermail/dovecot/attachments/20180919/11816ce3/attachment-0001.html>
Doug Hardie
2018-Sep-19 22:22 UTC
[Sieve] Matches on body content - looking for working example
> On 19 September 2018, at 12:54, Adam Raszkiewicz <araszkiewicz at medallies.com> wrote: > > I have tried to do something like > > if body :content ["multipart"] :matches ["Original-Message-ID" ?*?] { set "Original_Message_ID" "${0}"; } > > but instead getting Original Message ID I?m getting value from previous match which was > > if envelope :matches "From" "*" { set "sender" "${0}"; } > > Is there any example of working :matches matching-type with body? > > ThanksI have the following that works: if allof (header :contains "from" "fbl-no-reply at postmaster.aol.com", body :contains :raw "some text") { fileinto "Deleted Messages"; stop; }
Adam Raszkiewicz
2018-Sep-20 12:45 UTC
[Sieve] Matches on body content - looking for working example
I know your example will work but I'm looking for something similar like
if envelope :matches "From" "*" { set "sender"
"${0}"; }
but with the body :content
?On 9/19/18, 6:22 PM, "Doug Hardie" <bc979 at lafn.org> wrote:
> On 19 September 2018, at 12:54, Adam Raszkiewicz <araszkiewicz at
medallies.com> wrote:
>
> I have tried to do something like
>
> if body :content ["multipart"] :matches
["Original-Message-ID" ?*?] { set "Original_Message_ID"
"${0}"; }
>
> but instead getting Original Message ID I?m getting value from previous
match which was
>
> if envelope :matches "From" "*" { set
"sender" "${0}"; }
>
> Is there any example of working :matches matching-type with body?
>
> Thanks
I have the following that works:
if allof (header :contains "from" "fbl-no-reply at
postmaster.aol.com",
body :contains :raw "some text")
{
fileinto "Deleted Messages";
stop;
}
Stephan Bosch
2018-Sep-20 20:29 UTC
[Sieve] Matches on body content - looking for working example
Op 19/09/2018 om 21:54 schreef Adam Raszkiewicz:> > I have tried to do something like > > if body :content ["multipart"] :matches ["Original-Message-ID" ?*?] { > set "Original_Message_ID" "${0}"; } > > but instead getting Original Message ID I?m getting value from > previous match which was > > if envelope :matches "From" "*" { set "sender" "${0}"; } > > Is there any example of working :matches matching-type with body? >I am not sure what you're trying to achieve here, but with the body test that will definitely not work with match variables: https://tools.ietf.org/html/rfc5173#section-6 : "Wildcard expressions used with "body" are exempt from the side effects described in [VARIABLES]. That is, they MUST NOT set match variables (${1}, ${2}...) to the input values corresponding to wildcard sequences in the matched pattern." Instead, the MIME Sieve extensions will likely provide what you need: https://tools.ietf.org/html/rfc5703 Regards, Stephan.