[Dovecot] Deliver mail as 'read'?
I'd like to be able to deliver certain mail as 'read' from procmail.
My procmail rules call deliver with -m
to directly to inject filtered mail to maildir based directories.
I like to keep copies of mail I've sent by cc'ing it to myself and
using procmail to filter and store copies in the
appropriate directory.
I cannot seem to find a way of delivering cc'd mail from me to me as
'read'. I'm running dovecot-1.0.7-2.el5 on a CentOS 5 distribution.
Any hints on how I may achieve this are welcomed. Happy to upgrade if
needs be.
Thanks.
Peter Collinson
On Mon, Jul 21, 2008 at 7:42 AM, Peter Collinson pc@hillside.co.uk wrote:
I'd like to be able to deliver certain mail as 'read' from procmail. My procmail rules call deliver with -m to directly to inject filtered mail to maildir based directories.
Hi, I've got an related problem: When fetching emails with POP3, they should *not* be marked 'read' (I also read emails via IMAP and all emails are marked as 'read' because my email-client at home fetches them).
Chris
On Mon, 2008-07-21 at 09:38 +0200, Chris Laif wrote:
On Mon, Jul 21, 2008 at 7:42 AM, Peter Collinson pc@hillside.co.uk wrote:
I'd like to be able to deliver certain mail as 'read' from procmail. My procmail rules call deliver with -m to directly to inject filtered mail to maildir based directories.
Hi, I've got an related problem:
Not really..
When fetching emails with POP3, they should *not* be marked 'read' (I also read emails via IMAP and all emails are marked as 'read' because my email-client at home fetches them).
pop3_no_flag_updates = yes
On Mon, 2008-07-21 at 06:42 +0100, Peter Collinson wrote:
I'd like to be able to deliver certain mail as 'read' from procmail.
My procmail rules call deliver with -m to directly to inject filtered mail to maildir based directories.I like to keep copies of mail I've sent by cc'ing it to myself and
using procmail to filter and store copies in the appropriate directory.I cannot seem to find a way of delivering cc'd mail from me to me as
'read'. I'm running dovecot-1.0.7-2.el5 on a CentOS 5 distribution.Any hints on how I may achieve this are welcomed. Happy to upgrade if
needs be.
Only way I can think of would be with a Sieve script that uses the imap4flags extension to set the flag \seen.
I'll take a stab at that..
Getting started with sieve seems a big step...
On 21 Jul 2008, at 13:40, Timo Sirainen wrote:
On Mon, 2008-07-21 at 06:42 +0100, Peter Collinson wrote:
I'd like to be able to deliver certain mail as 'read' from procmail. My procmail rules call deliver with -m to directly to inject filtered mail to maildir based directories.
I like to keep copies of mail I've sent by cc'ing it to myself and using procmail to filter and store copies in the appropriate directory.
I cannot seem to find a way of delivering cc'd mail from me to me as 'read'. I'm running dovecot-1.0.7-2.el5 on a CentOS 5 distribution.
Any hints on how I may achieve this are welcomed. Happy to upgrade if needs be.
Only way I can think of would be with a Sieve script that uses the imap4flags extension to set the flag \seen.
On Mon, 2008-07-21 at 06:42 +0100, Peter Collinson wrote:
I'd like to be able to deliver certain mail as 'read' from procmail.
Only way I can think of would be with a Sieve script that uses the imap4flags extension to set the flag \seen.
Yes, that's what I did. I wanted to file all identified spam into the user's Junk folder, and mark it as read. You can do it with sieve using the imap4flags extension, but you have to use deliver as the LDA since that's the only one that supports imap4flags AFAIK.
At first I set up exim to do this automatically, and it worked but it took several steps to set up.
Later I decided to let each user create a rule in their sieve scripts to do this, so that they could override it by putting their whitelist rule first. The rule is simple to specify in e.g. Ingo, if you have that set up for your users to create their sieve scripts. Ingo generates the following sieve fragment:
# spam if exists "X-Spam-Flag" { addflag "\\Seen"; fileinto "Junk"; removeflag "\\Seen"; stop; }
There is another way, though. I used to mark messages "read" in kind of an ugly way in maildrop, using an external call to formail(1), which comes with procmail (at least on Debian). See below.
Good luck, Andrew.
# .mailfilter excerpt:
# spam filter
SPAMDIR=$HOME/.mail/.Junk
xfilter spamc # SpamAssassin
if ( /^X-Spam-Flag: YES/ )
{
# mark as Read
xfilter "formail -I\"Status: R\""
# deliver to the spam folder
cc "$SPAMDIR"
# mark it Read (in fact, mark all new spam messages as Read)
foreach (ls $SPAMDIR/new
) =~ /[^ ]+/
{
exception {
cd $SPAMDIR && mv "new/$MATCH" "cur/${MATCH}:2,S"
}
}
exit
}
participants (4)
-
Andrew Schulman
-
Chris Laif
-
Peter Collinson
-
Timo Sirainen