Steffen Kaiser skdovecot@smail.inf.fh-brs.de writes:
On Tue, 10 May 2016, Jon Kristensen wrote:
Which Pigeonhole Sieve extension should I use to process/test a message depending on whether the message is in a particular mailbox? (Is it the mboxmetadata extension by any chance? If so, I would appreciate if someone could tell me what the reason is for it not being enabled by default.)
The reason I want to perform this test is that I have configured my MTA to deliver "outgoing" e-mails to my "Sent" IMAP folder, and these messages arrive unread. I would like to mark them as read using Sieve.
er, I guess, "message is in a particular mailbox" is meaning it to be spooled, or something like that, right?
Do you use subaddressing (aka +addressing, +detail addressing)? Then look here: http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples#Plus_Addressed_mail_filte...
If you want to resolve the question in the second paragraphe, search the mailing list archive about how to get the name of the mailbox, the implicit keep stores the message in. I'm pretty sure, that there was such question lately.
If you actually want to resolve the question in the first paragraphe, to check whether or not the same message has been spooled in a folder already (aka duplicate check), check out the duplicate extension with ":handle" argument. But you probably need to know the target mailbox, too.
I apologize for not expressing my problem in clear enough terms.
My e-mail server will put sent e-mail to the ~/.Maildir/.Sent (which is also a Maildir directory); naturally, the e-mail is first written into ~/.Maildir/.Sent/tmp, and then it's moved to ~/.Maildir/.Sent/new.
After this has happened, I would like Dovecot to run a Sieve program that will discover that the e-mail is in the "Sent" folder, and mark it as seen.
To explain what I'm imagining with code:
if folder :is "Sent" { setflag "\\Seen"; }
So I don't use subaddressing. I always know the target mailbox, but it's always "Sent" (this is configured in the MTA).
I guess knowing the name of the mailbox that implicit keep stores the message in would solve my problem.
I'm assuming you are referring to this:
https://raw.githubusercontent.com/dovecot/pigeonhole/master/doc/rfc/spec-bos...
And in particular this:
"vnd.dovecot.default-mailbox" The default mailbox that is used by the (implicit) keep action. Normally, this will always yield "INBOX", unless this is changed in the configuration.
It says that this normally will yield "INBOX". Do you, given my explanation above, think that it would yield "Sent" in my case? If not, how would I be able to use this?
Thanks a million!
-- Jon Kristensen (jonkri) PGP fingerprint: 0377 F488 8908 0237 A2AE C484 387E C31D DA60 1350