Hi at all,
I'm trying to figure out a problem with Sieve Duplicate Extension when used together with fileinto. I use a Dovecot 2.2.23 and Pigeonhole v0.4.13

I have a user (user01) with 3 email addresses (mai...@example.com, mai...@example.com, use...@example.com); I want to discard duplicate, and I want to move email in different folder, so I'm using this sieve script:

----------------------------------------------
require ["fileinto", "duplicate", "imap4flags"];

if duplicate {
        discard;
        stop;
}

if address :is :all "to" "mai...@example.com" {
        fileinto "mail01";
}

if address :is :all "to" "mai...@example.com" {
        fileinto "mail02";
}
-------------------------------------


To make my test, I have a script that send always the same email; this is an example:

-----------------------------------------
Delivered-To: use...@example.com
Received: from smtp-server.example.com ([192.168.1.214])
by lmtp-server.example.com (Dovecot) with LMTP id YSaBBU53GFdhbwAAIDyJFw
        for <use...@example.com>; Thu, 21 Apr 2016 08:48:41 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: TEST EMAIL
From: mys...@example.com
To: mai...@example.com, mai...@example.com, use...@example.com
Date: Thu, 21 Apr 2016 08:48:41 +0200
Message-ID: <20160421064841.26889.86...@kratos.example.com>

This is a test email

Please ignore me.
--------------------------------------------

The problem is that duplicate extension doesn't ALWAYS work ; I mean, one time it works (sieve discard 2 duplicate mails), one time it doesn't work at all (sieve doesn't discard any mail), another time it works only for one mail (sieve discards only 1 mail)

Here my server log:

Apr 21 08:49:07 smtp-server dovecot: lmtp(use...@example.com): 1dKXOMl3GFdibwAAIDyJFw: sieve: msgid=<20160421064906.26896.49...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:07 smtp-server dovecot: lmtp(use...@example.com): 1dKXOMl3GFdibwAAIDyJFw: sieve: msgid=<20160421064906.26896.49...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:07 smtp-server dovecot: lmtp(use...@example.com): oSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064906.26896.49...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action) Apr 21 08:49:07 smtp-server dovecot: lmtp(use...@example.com): eY00CY93GFcucgAAIDyJFw: sieve: msgid=<20160421064906.26896.49...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action)



Apr 21 08:49:13 smtp-server dovecot: lmtp(use...@example.com): dSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064913.26904.88...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:13 smtp-server dovecot: lmtp(use...@example.com): dSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064913.26904.88...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:13 smtp-server dovecot: lmtp(use...@example.com): pSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064913.26904.88...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action) Apr 21 08:49:13 smtp-server dovecot: lmtp(use...@example.com): vZWNOMl3GFcldAAAIDyJFw: sieve: msgid=<20160421064913.26904.88...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action)



Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): eSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): qSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): qSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): aSaBBU53GFdhbwAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): aSaBBU53GFdhbwAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:18 smtp-server dovecot: lmtp(use...@example.com): eSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064918.26911.55...@myhost.example.com>: stored mail into mailbox 'mail02'


Apr 21 08:49:22 smtp-server dovecot: lmtp(use...@example.com): rSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064922.26919.68...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:22 smtp-server dovecot: lmtp(use...@example.com): rSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064922.26919.68...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:22 smtp-server dovecot: lmtp(use...@example.com): YVCsNPJ3GFd1dgAAIDyJFw: sieve: msgid=<20160421064922.26919.68...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action) Apr 21 08:49:23 smtp-server dovecot: lmtp(use...@example.com): bSaBBU53GFdhbwAAIDyJFw: sieve: msgid=<20160421064922.26919.68...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action)


Apr 21 08:49:27 smtp-server dovecot: lmtp(use...@example.com): fSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064927.26926.28...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:27 smtp-server dovecot: lmtp(use...@example.com): sSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064927.26926.28...@myhost.example.com>: stored mail into mailbox 'mail01' Apr 21 08:49:27 smtp-server dovecot: lmtp(use...@example.com): sSM3And3GFdFaQAAIDyJFw: sieve: msgid=<20160421064927.26926.28...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:27 smtp-server dovecot: lmtp(use...@example.com): fSOyOtV3GFcmdAAAIDyJFw: sieve: msgid=<20160421064927.26926.28...@myhost.example.com>: stored mail into mailbox 'mail02' Apr 21 08:49:27 smtp-server dovecot: lmtp(use...@example.com): ZVCsNPJ3GFd1dgAAIDyJFw: sieve: msgid=<20160421064927.26926.28...@myhost.example.com>: marked message to be discarded if not explicitly delivered (discard action)


As you can see, the message ID of a single sent, is the same, so the duplicate extension should work. If I replace the 'fileinto' rule with, for example, a 'setflag' rule:

-----------------------------------------------
require ["fileinto", "duplicate", "imap4flags"];

if duplicate  {
        discard;
        stop;
}

if address :is :all "to" "mai...@example.com" {
        setflag "\\seen";
}

if address :is :all "to" "mai...@example.com" {
        setflag "\\seen";
}
----------------------------------------------

it works like a charm: for every mail sent, the duplicate extension works.


What is it wrong ? someone has any clue ?

Cheers,
  Marco






--
Marco Giunta - ITCS SysAdmin
Via Bonomea, 265
34136 - Trieste, Italy
Tel: +39-040-3787-503
Fax: +39-040-3787-244

Reply via email to