in reply to IMAP: mark message as unseen
I think the \Seen flag is set automatically by the IMAP server whenever any client retrieves a message body. At least in my (automated) IMAP clients, I have resorted to programmatically remove the \Seen flag on mails that I retrieve. Looking at Mail::IMAPClient, there is mention of the Peek flag, which should let the IMAP server know that the mail should remain unread. I haven't tried this, but it could work like this:
$imap->Peek(1); # don't mark mails as \Seen automatically my @unseen = reverse sort $imap->search_unseen; for my $i (@unseen) { my $msg = join '', @{$imap->get($i)}; unless (fork) { if (&process (Email::MIME->new (\$msg)) eq "notouch") { $imap->unsee ($i); exit; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: IMAP: mark message as unseen
by Arik123 (Beadle) on Jul 10, 2018 at 09:30 UTC | |
by Arik123 (Beadle) on Jul 10, 2018 at 10:03 UTC | |
by Corion (Patriarch) on Jul 10, 2018 at 11:03 UTC |
In Section
Seekers of Perl Wisdom