[Dovecot] dovecot 1.2.1 and sieve-0.9.1
Hi all,
ok, can someone tell me which header fields that the "Sender" function in sieve looks at ???
I've created a sieve rule to move a mail to a directory that looks like this : # rule:[File Message] if anyof (address :contains "Sender" "Dude") { fileinto "TestFolder"; }
And the emails headers look like this :
Received: (qmail 5811 invoked by uid 100); 28 Jul 2009 22:33:56 -0000 X-Sieve: Dovecot Sieve 0.1.9 Delivered-To: xxxxxx-xxxxxx@xxxxxx.com Received: (qmail 5581 invoked from network); 28 Jul 2009 22:33:53 -0000 Received: from unknown (HELO mx1.securemailscan.com) (209.132.1.198) by mda1.scaledsystems.com with SMTP; 28 Jul 2009 22:33:53 -0000 X-Envelope-From: xxxxx@yahoo.com X-Envelope-To: xxxxxx@xxxxxx.com Received: From web35801.mail.mud.yahoo.com (66.163.179.170) by mx1.securemailscan.com (MAILFOUNDRY) id uh1v8HvGEd6coQAw for xxxxxx@xxxxxx.com; Tue, 28 Jul 2009 22:33:52 -0000 (GMT) Received: (qmail 76116 invoked by uid 60001); 28 Jul 2009 22:33:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248820432; bh=bMaME6CgqoU7EGtJwkX2i9rjL4ONpP79bbfuft4bEok=; h=Message-ID:X-YMail-OSG:Received:X-RocketSRV:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=as+pQdsUMeD/yiXAxceO3lYtDm/vCgjqDH1AS1OsfMfQITJV7YMRJSqBst1m4mHIgC0xyShetRIo6o3FEeLxDDOHYKUhy3V31MrS+0d7B+us4Nrjft7OZu3zVPIS87fDWoF6hM9dc9eVXTu4Kuj0a1bul0XwKIRwXqn+AfXepYg= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-RocketSRV:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=kHyfgMDzLWxu70JYhQk6KYifrtYSi7jV4T7UqqQ6XfSN+WZeTRlZ4fK6R+nb1ykwTjmp2pROJAPYgHooRPs3MaYMtx54f0+7IL8HjP0c2wqiYIy++6pFzc+mk8j+72OJMBcxMhDTPtV/i52Uu0bDEl5+DbU6QXrQhYbak6BdzLM=; Message-ID: 213398.63258.qm@web35801.mail.mud.yahoo.com X-YMail-OSG: nmd_HZwVM1lT6TNyXWr2RcbN36VCejKyF4bZMN8urulX03szfpVuJD36F652_focw.1y1PwSPvcfGlWkoBsq5kEb9H_R.HWV.kcpvFe1pZGC4oWcj6Cc4uO737j.52s0kwXmru.WZEdJi..tsbkjg.8f3y_Lc4wJRFORqhFHjMoKG17xhVM8_z1olhpu_FtyrOVvTuoqaapAk3ioUOGTyEYp52oHRPQAx9TuiKojStPmtmq0AkGjDMybhQeciqJSvFJcrF6KqdL5wEjBX4G1bGGXGD61RYzUaJNGMX8FQ.tJqPEKSI1vlBU- Received: from [76.176.154.181] by web35801.mail.mud.yahoo.com via HTTP; Tue, 28 Jul 2009 15:33:52 PDT X-RocketSRV: showStationery=1248820330364@dclient.mail.yahoo.com,1248820330363@dclient.mail.yahoo.com,1248820330362@dclient.mail.yahoo.com X-Mailer: YahooMailRC/1358.22 YahooMailWebService/0.7.289.15 Date: Tue, 28 Jul 2009 15:33:52 -0700 (PDT) From: Dude Crush xxxxxxx@yahoo.com Reply-To: Dude Crush xxxxxxx@yahoo.com Subject: test from dude 2 To: xxxxxxxx@xxxxxxxx.com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-948431439-1248820432=:63258"
But when the mail is delivered, it goes into the INBOX, and the dovecot message in the log file looks like this : Jul 28 15:33:56 deliver(xxxxxxx@xxxxxx.com): Info: sieve: msgid=213398.63258.qm@web35801.mail.mud.yahoo.com: stored mail into mailbox 'INBOX'
So, I'm a little bi stumped as to why it wouldn't pick up "Dude" in any of the sender addresses...
I can get it to work for the address by using
# rule:[File Message] if anyof ( envelope :contains "From" "yahoo") { fileinto "TestFolder"; }
But isnt' it supposed to be able to deal with the Sender name???
Thanks,
Tim.
John Killian schreef:
Hi all,
ok, can someone tell me which header fields that the "Sender" function in sieve looks at ???
I've created a sieve rule to move a mail to a directory that looks like this : # rule:[File Message] if anyof (address :contains "Sender" "Dude") { fileinto "TestFolder"; }
And the emails headers look like this :
[..headers..]
First of all, there is no "sender" header in the example you provided. The only header I see is "from". But more importantly, the name before the address enclosed in <> is not matched with the address test (i.e. the phrase part of the address, containing 'Dude', is ignored). This kind of match can only be achieved with the header test.
Regards,
-- Stephan Bosch stephan@rename-it.nl
John Killian wrote:
Hi all,
ok, can someone tell me which header fields that the "Sender" function in sieve looks at ???
I've created a sieve rule to move a mail to a directory that looks like this : # rule:[File Message] if anyof (address :contains "Sender" "Dude") { fileinto "TestFolder"; }
Your script checks for:
- a header called "Sender" literally (which isn't in the posted header)
- expects it to contain a valid e-mail address that contains the string "Dude" (which is not true, when you actually meant to use "From": Dude is not part of the mail address)
And the emails headers look like this :
Received: (qmail 5811 invoked by uid 100); 28 Jul 2009 22:33:56 -0000 X-Sieve: Dovecot Sieve 0.1.9 Delivered-To: xxxxxx-xxxxxx@xxxxxx.com Received: (qmail 5581 invoked from network); 28 Jul 2009 22:33:53 -0000 Received: from unknown (HELO mx1.securemailscan.com) (209.132.1.198) by mda1.scaledsystems.com with SMTP; 28 Jul 2009 22:33:53 -0000 X-Envelope-From: xxxxx@yahoo.com X-Envelope-To: xxxxxx@xxxxxx.com Received: From web35801.mail.mud.yahoo.com (66.163.179.170) by mx1.securemailscan.com (MAILFOUNDRY) id uh1v8HvGEd6coQAw for xxxxxx@xxxxxx.com; Tue, 28 Jul 2009 22:33:52 -0000 (GMT) Received: (qmail 76116 invoked by uid 60001); 28 Jul 2009 22:33:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248820432; bh=bMaME6CgqoU7EGtJwkX2i9rjL4ONpP79bbfuft4bEok=; h=Message-ID:X-YMail-OSG:Received:X-RocketSRV:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=as+pQdsUMeD/yiXAxceO3lYtDm/vCgjqDH1AS1OsfMfQITJV7YMRJSqBst1m4mHIgC0xyShetRIo6o3FEeLxDDOHYKUhy3V31MrS+0d7B+us4Nrjft7OZu3zVPIS87fDWoF6hM9dc9eVXTu4Kuj0a1bul0XwKIRwXqn+AfXepYg= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-RocketSRV:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=kHyfgMDzLWxu70JYhQk6KYifrtYSi7jV4T7UqqQ6XfSN+WZeTRlZ4fK6R+nb1ykwTjmp2pROJAPYgHooRPs3MaYMtx54f0+7IL8HjP0c2wqiYIy++6pFzc+mk8j+72OJMBcxMhDTPtV/i52Uu0bDEl5+DbU6QXrQhYbak6BdzLM=; Message-ID: 213398.63258.qm@web35801.mail.mud.yahoo.com X-YMail-OSG: nmd_HZwVM1lT6TNyXWr2RcbN36VCejKyF4bZMN8urulX03szfpVuJD36F652_focw.1y1PwSPvcfGlWkoBsq5kEb9H_R.HWV.kcpvFe1pZGC4oWcj6Cc4uO737j.52s0kwXmru.WZEdJi..tsbkjg.8f3y_Lc4wJRFORqhFHjMoKG17xhVM8_z1olhpu_FtyrOVvTuoqaapAk3ioUOGTyEYp52oHRPQAx9TuiKojStPmtmq0AkGjDMybhQeciqJSvFJcrF6KqdL5wEjBX4G1bGGXGD61RYzUaJNGMX8FQ.tJqPEKSI1vlBU- Received: from [76.176.154.181] by web35801.mail.mud.yahoo.com via HTTP; Tue, 28 Jul 2009 15:33:52 PDT X-RocketSRV: showStationery=1248820330364@dclient.mail.yahoo.com,1248820330363@dclient.mail.yahoo.com,1248820330362@dclient.mail.yahoo.com X-Mailer: YahooMailRC/1358.22 YahooMailWebService/0.7.289.15 Date: Tue, 28 Jul 2009 15:33:52 -0700 (PDT) From: Dude Crush xxxxxxx@yahoo.com Reply-To: Dude Crush xxxxxxx@yahoo.com Subject: test from dude 2 To: xxxxxxxx@xxxxxxxx.com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-948431439-1248820432=:63258"
The correct version of the script would check the "From" header:
if header :contains "From" "Dude" { fileinto "foobar"; }
-- Regards, Tom
Your script checks for:
- a header called "Sender" literally (which isn't in the posted header)
- expects it to contain a valid e-mail address that contains the string "Dude" (which is not true, when you actually meant to use "From": Dude is not part of the mail address)
The correct version of the script would check the "From" header:
if header :contains "From" "Dude" { fileinto "foobar"; }
Thank you for eveyone for the answers. It shed better light on how the rules work. I guess the best way to get the name portion of the sender is indeed to use the "header" modifier and pick the correct header field.
Thanks,
Tim.
participants (4)
-
John Killian
-
Stephan Bosch
-
Tim Traver
-
Tom Hendrikx