Benjamin Thomas
2012-Aug-27  10:40 UTC
[Dovecot] Dovecot sieve and duplicate email subjects
Hi,
I'm running a small email server with the help of iRedMail.
I can manage sieve scripts from the Rouncube web interface or manually
inside the user's personal sieve folder.
I have an email account setup to receive automated tasks.
Some of these "alerts" occur too often and they have the same subject
line,
but different senders.
This is the rule I am currently using:
##CODE START##
# rule:[AutoAlerts]
if anyof (
header :matches "Subject" "AutoAlert Type1*",
header :matches "Subject" "AutoAlert Type2*",
header :matches "Subject" "AutoAlert Type3*"
)
{
        fileinto "INBOX.AutoAlerts";
        stop;
}
##CODE END##
I was wondering if it's possible to gracefully handle duplicate subjects
lines (within a given time frame) with sieve filters ?
Ideally, I would like the first email of the day with subject
""AutoAlert
Type1..." to get moved to the subfolder given above. Subsequent
"duplicate"
emails would then go into a "duplicate" subfolder.
Is this possible with sieve filters ? I could not find anything striking me
as obvious while reading the page http://wiki.dovecot.org/LDA/Sieve.
Thanks very much for your input.
Op 8/27/2012 12:40 PM, Benjamin Thomas schreef:> Hi, > > I was wondering if it's possible to gracefully handle duplicate subjects > lines (within a given time frame) with sieve filters ? > > Ideally, I would like the first email of the day with subject ""AutoAlert > Type1..." to get moved to the subfolder given above. Subsequent "duplicate" > emails would then go into a "duplicate" subfolder. > > Is this possible with sieve filters ? I could not find anything striking me > as obvious while reading the page http://wiki.dovecot.org/LDA/Sieve.It is currently not possible to maintain some sort of custom state information between deliveries, i.e. Sieve invocations. There is the unofficial vnd.dovecot.duplicate extension, but that uses the message-id exclusively and (currently) cannot be used to track duplicate subjects. Regards, Stephan.
On 8/27/2012 12:40 PM, Benjamin Thomas wrote:> I was wondering if it's possible to gracefully handle duplicate subjects > lines (within a given time frame) with sieve filters ? > > Ideally, I would like the first email of the day with subject ""AutoAlert > Type1..." to get moved to the subfolder given above. Subsequent "duplicate" > emails would then go into a "duplicate" subfolder. > > Is this possible with sieve filters ? I could not find anything striking me > as obvious while reading the page http://wiki.dovecot.org/LDA/Sieve.Although the above is still not possible with the standard Sieve features, I updated the Dovecot-specific vnd.dovecot.duplicate extension with support for the scenario you describe. Basically, I made it much more flexible for checking all kinds of string value duplicates and not only strictly based on the Message-ID header. Also, the user can now directly control the time frame within which duplicates are detected (within configurable limits). http://hg.rename-it.nl/dovecot-2.1-pigeonhole/raw-file/tip/doc/rfc/spec-bosch-sieve-duplicate.txt It will be included in the next Pigeonhole v0.3 release. Regards, Stephan.