[Dovecot] Sieve & Regex
Peregrino "Pipino" Tuc
newsletter-ale at guest.net
Tue May 12 11:17:58 EEST 2009
Any hint?
Il giorno lun, 11/05/2009 alle 16.40 +0200, Peregrino "Pipino" Tuc ha
scritto:
> Hi all
> I'm trying to create a new sieve rule.
>
> What I would like to do is catch "From" addresses that
> are equal to the rightpart (hostname) of a message-id.
>
> For example:
>
> Message-ID: <000d01c9d23a$941a7db0$6400a8c0 at upwabm>
> From: "Leanne Crabtree" <upwabm at blomberg-co.com>
>
> I would like to catch this mail, because it has
> "upwabm" on the right part of the message-id and
> "upwabm" on the left part of the sender address.
>
> I've done this, but with no success. The error
> reported is: "Invalid preceding regular expression"
> on line with the second regex with ${1}
>
> More over I would like to add an header with the
> result of regex, an header like this:
>
> "X-MyHeader" "${1}" but it does not work.
>
> This is an extract of our sieve:
> ---
> require ["regex"];
> if header :regex "Message-ID" "^.*@(.*)>$" {
> if header :regex "From" ".*<${1}@.*>$" {
> addheader "X-MyHeader" "${1}"
> }
> }
> ---
>
More information about the dovecot
mailing list