Hi, I want to send notification like this: if body :text :matches "*" { notify :importance "3" :message "[NOTIFY] ${1}" "mailto:test at example,com"; } The notification works but the variable ${1} seems to be empty. But in this case: if header :matches "Subject" "*" { notify :importance "3" :message "[NOTIFY] ${1}" "mailto:test at example,com"; } Everything works correct. Regards, Bambero -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20181115/298a621e/attachment-0001.html>
Op 15-11-2018 om 23:54 schreef Bambero:> Hi, > > I want to send notification like this: > > if body :text :matches "*" { > ?????????? notify :importance "3" > ?????????????? :message "[NOTIFY] ${1}" > ?????????????? "mailto:test at example <mailto:test at example>,com"; > } > > The notification works but the variable ${1} seems to be empty. > > But in this case: > > if header :matches "Subject" "*" { > ?????????? notify :importance "3" > ?????????????? :message "[NOTIFY] ${1}" > ?????????????? "mailto:test at example <mailto:test at example>,com"; > } > > Everything works correct.https://tools.ietf.org/html/rfc5173#section-6 Use the extracttext extension instead: https://tools.ietf.org/html/rfc5703#section-7 Regards, Stephan.
Thanks, now it works. But it seems that :message string (of notify command) is limited to 255 chars. Is there any chance to change limit to 512 ? require ["body","enotify","variables","foreverypart","mime","extracttext"]; foreverypart { if header :mime :type :is "Content-Type" "text" { extracttext :first 512 "body"; break; } } if not header :contains "subject" "*" { notify :importance "3" :message "${body}" "mailto:test at example.com"; } On Fri, Nov 16, 2018 at 2:53 PM Stephan Bosch <stephan at rename-it.nl> wrote:> > > Op 15-11-2018 om 23:54 schreef Bambero: > > Hi, > > > > I want to send notification like this: > > > > if body :text :matches "*" { > > notify :importance "3" > > :message "[NOTIFY] ${1}" > > "mailto:test at example <mailto:test at example>,com"; > > } > > > > The notification works but the variable ${1} seems to be empty. > > > > But in this case: > > > > if header :matches "Subject" "*" { > > notify :importance "3" > > :message "[NOTIFY] ${1}" > > "mailto:test at example <mailto:test at example>,com"; > > } > > > > Everything works correct. > > https://tools.ietf.org/html/rfc5173#section-6 > > Use the extracttext extension instead: > > https://tools.ietf.org/html/rfc5703#section-7 > > Regards, > > Stephan. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20181116/18eadf29/attachment.html>
Reasonably Related Threads
- Sieve notify variables not working with body?
- Sieve notify variables not working with body?
- [Sieve] Matches on body content - looking for working example
- sieve: extract first chars of body in sieve script
- sieve-body extension support for deliver LDA's sieve plugin