2010/2/15 Lazy <lazy404@gmail.com>:
Helloo,
We are using dovectot lda with qmail-ldap,
dovecot 1.2.10, sieve 0.1.15
lda is executed as exec /var/qmail/bin/preline -f /usr/local/dovecot/libexec/dovecot/deliver -s
preline adds Delivered-To: header,
everything works fine except vacation
Feb 9 16:07:16 thebe dovecot: deliver(lazy): sieve: msgid=unspecified: discarding vacation response for message implicitly delivered to <lazy@thebe.org> Feb 9 16:07:16 thebe dovecot: deliver(lazy): sieve: msgid=unspecified: stored mail into mailbox 'INBOX'
now I have figured it out, when proper To: header is present in email body ewerything works (wit the following patch)
thebe.org is the hostname of the machine, oryginal recipient address has other domain
.dovecot.sieve file looks like this require ["vacation"];
#autoresponder vacation :days 1 :subject "Auto Reply / Odpowiedz automatyczna" "aaaaaaaaaaaaaaaaaaaaa";
I did experiments with :addresses ["*"] without any luck.
deliver only gets user and HOME directory form env variables provided by qmail, so it's unaware of the target email address.
How to fix it ?
I was thinking about deliver extracting target address from Delivered-To: header added by qmail's preline, or use DTLINE env variable, whitch qmail populates with Delivered-To header.
patch bellow fills destaddr from qmail's DTLINE env, --- src/deliver/deliver.c 2010-01-25 00:14:17.000000000 +0100 +++ src/deliver/deliver.c 2010-02-16 12:12:18.000000000 +0100 @@ -1031,6 +1031,16 @@ if (user == NULL) user = getenv("USER"); + /* if DTLINE (qmail Delivered-To: header) is not null use it as a destination address */ + if (destaddr == NULL) { + destaddr = getenv("DTLINE"); + if (destaddr != NULL) { + if (strlen(destaddr) > 18 ) + destaddr = i_strdup(address_sanitize(destaddr+14)); + else + destaddr = NULL; + } + } if (!keep_environment) deliver_env_clean(!user_auth); -- Lazy