Re: [Dovecot] Sieve notify messages
On 2/5/2012 4:57 PM, Andreas Muehlemann wrote:
Hi Stephan
Thank you very much, the encodeurl and ?body= are the trick!
For posterity, please reply to the mailing list as well, especially when it is a success message ;)
Regards,
Stephan.
On 02/05/2012 04:46 PM, Stephan Bosch wrote:
On 2/5/2012 4:00 PM, Andreas Muehlemann wrote:
Hi All
I'm using dovecot 2.0.16 with the pigeonhole plugin 0.25.
I'm trying to use the notifiy mechanism from sieve to send notifications when a mail arrives in the mailbox. The message is checked to be a 8bit message, otherwise it is replaced by the default message "Notification of new message." How can I create a 8bit message body within the sieve script that is accepted by the notification process?
e.g. notify :message "Subject: ${subject}" "mailto:email@domain.com";
Do I have to put the message body into the :message string? Or how can I define a custom message body that is accepted by notify?
If I understand you correctly, the following should be the solution for your issue:
<SCRIPT> require "enotify"; require "variables"; require "encoded-character"; # Percent-encode the UTF-8 message # (I'm using encoded-character here, but you can use UTF8 directly of course) set :encodeurl "message" "In ${unicode:d6}sterreich m${unicode:e4}ht Herr M${unicode:fc}ller seinen Rasen ${unicode:fc}brigens auch ${unicode:fc}ber dem Durchschnitt schnell."; # Send the notification notify :message "Herr M${unicode:fc}ller m${unicode:e4}ht seinen Rasen" "mailto:user@example.com?body=${message}"; </SCRIPT> This sends the following message: <MESSAGE> X-Sieve: Pigeonhole Sieve 0.3.0 Message-ID: <dovecot-sieve-1328456217-863910-0@host.example.com> Date: Sun, 05 Feb 2012 16:36:57 +0100 Subject: Herr =?utf-8?q?M=C3=BCller_m=C3=A4ht?= seinen Rasen From: Postmaster <postmaster@example.com> To: user@example.com Auto-Submitted: auto-notified; owner-email="234234234234@ext2.domain.tld" Precedence: bulk X-Priority: 3 (Normal) Importance: Normal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Österreich mäht Herr Müller seinen Rasen übrigens auch über dem Durchschnitt schnell. </MESSAGE> Regards, Stephan
participants (1)
-
Stephan Bosch