I am using this simple sieve script to do "vacation":

require ["fileinto", "vacation"];
if exists "X-Spam-Flag" {
 stop;
}
vacation
 :days 1
 :subject "Out of office reply"
 :addresses ["<email address hidden>", "<email address hidden>" ]
"I am on vacation until 2008-08-07.
If you have something urgent, please contact: Jan Novak <email address hidden>
";

I use sql lookups for users and passwords. For some reason the default location ~/.dovecot-sieve did not work for some reason. However I prefer to put sieve scripts to /var/lib/sieve and when I added additional field to lookup with this location it started to work.

But it sends vacation messages with null envelope sender, which is in my opinion undesirable, because many vacation messages are caught in spam filters.

I think there could be same sender on envelope.
In dovecot-sieve/src/sieve-cmu.c around line 380 is a call to smtp_client_open(src->addr, NULL, &f);
NULL could be replaced with src->fromaddr

Maybe some more patching may be necesary. I found similar patch for cyrus-imapd at http://oss.digirati.com.br/mail/cyrus.html <http://oss.digirati.com.br/mail/cyrus.html>

My current system:
1)  Ubuntu 8.04.1

[EMAIL PROTECTED]:~$ dovecot --version
1.0.15

It is a backported package from ubuntu intrepid ibex. However the same applies for dovecot 1.0.10 which is in ubuntu 8.04.


Summary:
I expect messages sent by vacation recipe should have envelope from same as user's e-mail address. This is then writen to Return-Path: header by receiving MTA

NULL envelope from is used, resulting (in my case) to Return-Path: <> rewriten by postfix to Return-Path: <MAILER-DAEMON> by receiving MTA

--- dovecot-sieve/src/sieve-cmu.c	2008-07-29 23:55:58.000000000 +0200
+++ ../dovecot-1.0.10/dovecot-sieve/src/sieve-cmu.c	2008-07-29 22:51:08.000000000 +0200
@@ -377,7 +377,7 @@
     script_data_t *sdata = (script_data_t *) sc;
     sieve_msgdata_t *md = mc;
 
-    smtp_client = smtp_client_open(src->addr, NULL, &f);
+    smtp_client = smtp_client_open(src->addr, src->fromaddr, &f);
 
     outmsgid = deliver_get_new_message_id();
     fprintf(f, "Message-ID: %s\r\n", outmsgid);
begin:vcard
fn;quoted-printable:Josef Li=C5=A1ka
n;quoted-printable:Li=C5=A1ka;Josef
org;quoted-printable:CHL po=C4=8D=C3=ADta=C4=8De, s.r.o.
adr;quoted-printable;quoted-printable:;;St=C5=99edn=C3=AD 1249;=C4=8Cerno=C5=A1ice;;252 28;Czech Republic
email;internet:[EMAIL PROTECTED]
title:root
tel;cell:+420 776 026526
x-mozilla-html:FALSE
url:http://www.chl.cz
version:2.1
end:vcard

Reply via email to