Sieve extension for testing for mailbox
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi!
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.
Thanks in advance!
Jon Kristensen (jonkri) PGP fingerprint: 0377 F488 8908 0237 A2AE C484 387E C31D DA60 1350 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQIcBAEBAgAGBQJXMjBWAAoJEDh+wx3aYBNQfnIP/19D90MOwN1h/AXEuC2eSlXx MFHVuVgnXlc4mTXINkybBRxyjeaQlry7Lcbl2UR74rX5MLet6hEqu6l2tbBtbaKX 7VKDydOr55NsKUKvEDLg6DRhRRgHWYS1TxhENuRbhAriNZx4GbPnbAJAx8VL9wQ9 5W8PhTr8VMJUXiYZSCQ3LxXLHXrDAcIflh2vkJubiL5S0WQzbm1wyCplCAcUCTw4 Uk9StP0Zb9aMuwm+IsRDB9T0/2U90vCpz2b9UUJzg8yUwaTRIxSkoPNqaukSepsq tBNWKmQ8efKYq0AtISzQK5SSRQp7c4MudQUuNqU9oR85qMC5F/i/c//To7HBUuRd bkNr4gpvDXKKIYCAmcE8I1jU36M+E7Y5RE/gYkvA23/xC9cd7GpsaOAspWjVhm4l sp7DXnFkfGyM8/l3m5CVhfsFewFjrq8K9L5gVnCrEBRnfHqm/BeE7+rrQ4+LmPMl dZ45fwy8lFD2HIUE97p0E3n2xX4JvhMDhR/gilnSl/ssmVVpnbpVAgXrmqWJ9cr4 dfue7unhvrM5DTQ0hM9WoWXzCi/tSOHvYido1rjhtEYzCHIdTtJKAUVg69CZHLHu zDodyGn70kxxS5YOYMYuIahUFaZknbiuCV3MGh4p2sTGOY69kFANQlB00m0ZaiPZ D6cjf2Yz0Ny2RsAUgyPw =g2F3 -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVzLLVnz1H7kL/d9rAQJUdwgAi/mMAxMxAGleV1TkAhZH0p37bLH7NWcI OpkQ9VDQEXr8WFjXQesITpwJrnROZFL+IrmIpWY6s+tcjO045PU9N89gfPB+gjt+ g9fN+w6eKtOKvsLQdAsD8Ut+LP0qaLORaMgFHe+2ZpJItxp5iz7nSvXymusqB9ad lhIre61YfU7u97t/UUG2uvK7s4mdLhapX0wDP+Lp7KP3E19lWCK7IFvXZ6cWjNY/ JHZUytcKEghlF1LPnPp5372kUn/46NN8q9tYA/Qwsy4ErDImNBYmSnJUi05Q6uDR RYaBjZR1pq9mT2oOkBAds+z570YRIfO37HX7KVH+BvnHyimbItmPjg== =80sz -----END PGP SIGNATURE-----
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
Jon Kristensen info@jonkri.org writes:
I'm assuming you are referring to this:
https://raw.githubusercontent.com/dovecot/pigeonhole/master/doc/rfc/spec-bos...
Is it only me, or this not documented at http://wiki2.dovecot.org/Pigeonhole/Sieve/?
If it's not documented, should a bug be filed somewhere?
-- Jon Kristensen (jonkri) PGP fingerprint: 0377 F488 8908 0237 A2AE C484 387E C31D DA60 1350
Op 5/11/2016 om 8:34 PM schreef Jon Kristensen:
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?
Your explanation suggests the MTA is directly delivering messages to the Sent folder. In that case Sieve is never involved. Sieve is run only at delivery when said delivery is performed using Dovecot's LDA or LMTP agents.
If you're using dovecot-lda, the target (default) mailbox can be
specified using the -m option. LMTP is less flexible and can only use
what's after the recipient_delimiter' in the local part of the address as target mailbox when
lmtp_save_to_detail_mailbox=yes'.
Sieve will be able to see the configured default mailbox in the environment extension you mentioned above. You can define an administrator script for marking messages as seen using the sieve_before setting. This script can also prevent the normal user script from being executed by canceling the implicit keep.
Regards,
Stephan.
Stephan Bosch stephan@rename-it.nl writes:
Op 5/11/2016 om 8:34 PM schreef Jon Kristensen:
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?
Your explanation suggests the MTA is directly delivering messages to the Sent folder. In that case Sieve is never involved. Sieve is run only at delivery when said delivery is performed using Dovecot's LDA or LMTP agents.
If you're using dovecot-lda, the target (default) mailbox can be specified using the -m option. LMTP is less flexible and can only use what's after the
recipient_delimiter' in the local part of the address as target mailbox when
lmtp_save_to_detail_mailbox=yes'.Sieve will be able to see the configured default mailbox in the environment extension you mentioned above. You can define an administrator script for marking messages as seen using the sieve_before setting. This script can also prevent the normal user script from being executed by canceling the implicit keep.
Regards,
Stephan.
Thanks for your clarifications!
Just to confirm: Since my MTA is delivering my messages to ~/Mailbox/.Sent directly, neither Sieve or Dovecot's LDA or LMTP facilities can/will be involved, and I can't really solve my original problem (having messages in the Sent folder being marked automatically as read, on the server) using any of these utilities? Or can perhaps dovecot-lda/lmtp be used to process these "Sent" messages?
Any suggestions on elegant approaches that would solve that particular problem would be very welcome.
-- Jon Kristensen (jonkri) PGP fingerprint: 0377 F488 8908 0237 A2AE C484 387E C31D DA60 1350
participants (3)
-
Jon Kristensen
-
Steffen Kaiser
-
Stephan Bosch