Changing the default delivery mailbox to something other than INBOX
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
I expect the delivery location used by the Dovecot LDA is set in the Dovecot LDA and not in postfix.
-- Noel Jones
On 1/17/2021 8:42 PM, Ron Garret wrote:
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
Um, yeah. mail_location is in dovecot.conf. (I am using dovecot for my LDA, which is why I’m asking this on the dovecot list and not the postfix list.)
On Jan 17, 2021, at 9:30 PM, Noel noeldude@gmail.com wrote:
I expect the delivery location used by the Dovecot LDA is set in the Dovecot LDA and not in postfix.
-- Noel Jones
On 1/17/2021 8:42 PM, Ron Garret wrote:
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
I don't see how that would the obvious way, and that, as you found out, does cause your mails to disappear.
Looking at man dovecot-lda
you'll find
-m mailbox
Destination mailbox (default is INBOX). If the mailbox doesn't exist, it will not be created (unless the lda_mailbox_autocreate setting is set to yes). If a message couldn't be saved to the mailbox for any reason, it's delivered to INBOX instead.
Aki
On 18/01/2021 04:42 Ron Garret ron@flownet.com wrote:
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
I’m looking at the docs here:
https://doc.dovecot.org/configuration_manual/mail_location/
There I see:
Mailbox autocreation
Dovecot in the 1.x era created mailboxes automatically regardless of whether mail_location was set. In 2.x autocreation only gets triggered if mail_location is correctly set. You’ll see something like this if you enable debug logging:
…
I’m pretty sure that autocreation is working because the mailbox is in fact being created. And AFAICT it is being created in the right place with the right permissions. Despite this, mail delivery is failing when I use INBOX=…
All of the messages disappearing from my client is also mighty hinky. The only way I can explain that is that dovecot is telling my client that my inbox is no longer named Inobx. If that is the case then this whole approach won’t work because that will defeat the purpose. The whole point of this exercise is to get the dovecot LDA to put mail in something OTHER than what the client thinks is the main inbox.
On Jan 17, 2021, at 10:04 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
I don't see how that would the obvious way, and that, as you found out, does cause your mails to disappear.
Looking at
man dovecot-lda
you'll find-m mailbox
Destination mailbox (default is INBOX). If the mailbox doesn't exist, it will not be created (unless the lda_mailbox_autocreate setting is set to yes). If a message couldn't be saved to the mailbox for any reason, it's delivered to INBOX instead.
Aki
On 18/01/2021 04:42 Ron Garret ron@flownet.com wrote:
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
On 18/01/2021 08:46 Ron Garret ron@flownet.com wrote:
I’m looking at the docs here:
https://doc.dovecot.org/configuration_manual/mail_location/
There I see:
Mailbox autocreation
Dovecot in the 1.x era created mailboxes automatically regardless of whether mail_location was set. In 2.x autocreation only gets triggered if mail_location is correctly set. You’ll see something like this if you enable debug logging:
…
I’m pretty sure that autocreation is working because the mailbox is in fact being created. And AFAICT it is being created in the right place with the right permissions. Despite this, mail delivery is failing when I use INBOX=…
All of the messages disappearing from my client is also mighty hinky. The only way I can explain that is that dovecot is telling my client that my inbox is no longer named Inobx. If that is the case then this whole approach won’t work because that will defeat the purpose. The whole point of this exercise is to get the dovecot LDA to put mail in something OTHER than what the client thinks is the main inbox.
Don't touch the INBOX setting (leave it out), use the -m parameter for dovecot-lda.
Aki
On Jan 17, 2021, at 10:04 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
I don't see how that would the obvious way, and that, as you found out, does cause your mails to disappear.
Looking at
man dovecot-lda
you'll find-m mailbox
Destination mailbox (default is INBOX). If the mailbox doesn't exist, it will not be created (unless the lda_mailbox_autocreate setting is set to yes). If a message couldn't be saved to the mailbox for any reason, it's delivered to INBOX instead.
Aki
On 18/01/2021 04:42 Ron Garret ron@flownet.com wrote:
I tried the obvious:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=mail/.Incoming
and that failed in an even more bizarre way. The Incoming mailbox was created, it showed up in my mail client as it should have, but mail delivery still failed. Not only that, but all the messages that were in my Inbox disappeared from my mail client. I reverted the change and all of the messages that had previously been in Inbox reappeared.
WTF?
On Jan 17, 2021, at 5:00 PM, Ron Garret ron@flownet.com wrote:
I groveled around in the docs and discovered the INBOX=… option to the mail_location config parameter. I tried that, and it didn’t work, but it failed in a very strange way.
I currently have:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail
I tried changing that to:
mail_location = maildir:/var/mail/vhosts/%d/%n/mail:INBOX=incoming
That failed with the following log message:
Jan 17 23:41:17 lmtp(shp@rngh.net)<32476>
: Error: Mailbox INBOX: Failed to autocreate mailbox: Permission denied But the weird thing is that it DID create a directory called incoming, and that directory has the same permissions as the rest of the mailbox hierarchy.
There is something else which I was not expecting, and that is that the directory is a peer to /var/mail/vhosts/%d/%n/mail. What I want is to create a folder *inside* /var/mail/vhosts/%d/%n/mail.
Advice on how to proceed would be much appreciated. (BTW, I’d be happy to pay someone a consulting fee for help with this project. If you’re interested contact me off-list.)
rg
On Jan 17, 2021, at 12:08 PM, Ron Garret ron@flownet.com wrote:
Is there an easy way (i.e. a built-in configuration setting) to change the name of the mailbox that the dovecot LDA delivers mail into? The default is INBOX but I’d like mail to be delivered to some other mailbox. The reason for this is that I want all incoming mail to be invisible to the user by default until it has been screened for viruses and spam. I know I could do this with Sieve, but that is a PITA.
More details in case anyone is interested:
The goal of this filter is to make it work with very little training. To bootstrap the process, the filter is given access to outgoing mail (via a milter) which it uses as a reliable training corpus for good messages. It then leverages that information to filter incoming messages. For example, messages from senders which have been the recipients of outgoing messages are presumed to be good. There is also a spam honeypot to provide a reliable spam corpus.
One of the heuristics I want to use is to look for the same subject line in multiple messages from unknown users received over a period of an hour or so because those are almost invariably spam. But that requires a time delay between when a message is received and when it is filtered, and that in turn requires a place to store messages for a while before they are processed. While they are in that temporary storage, I don’t want them in the user’s face, but I do want them to be accessible if the user wants to see them (e.g. if they know that an important message is coming in which may be stuck in the temp storage). So I’d like to make something like an INCOMING mailbox where all mail is delivered. The messages in INCOMING are scanned by the filter and moved to Junk or INBOX as appropriate.
Thanks, rg
On Jan 17, 2021, at 10:48 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
Don't touch the INBOX setting (leave it out), use the -m parameter for dovecot-lda.
I don’t think that will work. My MTA is postfix and it’s connected to dovecot via LMTP, so AFAIK postfix is talking to dovecot over a socket, and dovecot-lda isn’t being invoked so there is no place to pass that the -m parameter. But we are at the limits of my understanding of how all this stuff actually works under the hood so please correct me if I’m wrong here.
rg
On 18/01/2021 08:56 Ron Garret ron@flownet.com wrote:
On Jan 17, 2021, at 10:48 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
Don't touch the INBOX setting (leave it out), use the -m parameter for dovecot-lda.
I don’t think that will work. My MTA is postfix and it’s connected to dovecot via LMTP, so AFAIK postfix is talking to dovecot over a socket, and dovecot-lda isn’t being invoked so there is no place to pass that the -m parameter. But we are at the limits of my understanding of how all this stuff actually works under the hood so please correct me if I’m wrong here.
rg
Ah, you are using LMTP... then the easiest is to use Sieve here.
You can use simple global script, e.g. /etc/dovecot/default-mbox.sieve
require ["fileinto", "mailbox"];
fileinto "OtherBox";
then sievec the script, and use
plugin { sieve_before = /etc/dovecot/default-mbox.sieve }
this way it will change the default mailbox, but allows per-user scripts to change it.
Aki
On Jan 17, 2021, at 11:06 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
On 18/01/2021 08:56 Ron Garret ron@flownet.com wrote:
On Jan 17, 2021, at 10:48 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
Don't touch the INBOX setting (leave it out), use the -m parameter for dovecot-lda.
I don’t think that will work. My MTA is postfix and it’s connected to dovecot via LMTP, so AFAIK postfix is talking to dovecot over a socket, and dovecot-lda isn’t being invoked so there is no place to pass that the -m parameter. But we are at the limits of my understanding of how all this stuff actually works under the hood so please correct me if I’m wrong here.
rg
Ah, you are using LMTP... then the easiest is to use Sieve here.
I was afraid of that :-(
What about just using postfix as the LDA?
You can use simple global script, e.g. /etc/dovecot/default-mbox.sieve
require ["fileinto", "mailbox"]; fileinto "OtherBox";
then sievec the script, and use
plugin { sieve_before = /etc/dovecot/default-mbox.sieve }
this way it will change the default mailbox, but allows per-user scripts to change it.
The problem is that the spam filter needs to put good messages back in INBOX. That would cause an infinite loop (unless sieve has a mechanism to prevent this that I don’t know about). So to prevent this I’d need to make the rule conditional on some header that the spam filter adds before moving the message back. The problem with *that* is that it plays badly with the strategy for training the filter, which is for the user to move false-positive messages from SPAM to INBOX. A user might then also move a good message from OtherBox to INBOX rather than wait for the spam filter to get around to processing it, and then sieve would (presumably) move it right back. So now I need *another* header that *sieve* adds before moving the message to OtherBox and make the rule conditional on *that* header. It all starts to seem very complicated and fragile.
rg
On 18/01/2021 18:05 Ron Garret ron@flownet.com wrote:
On Jan 17, 2021, at 11:06 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
On 18/01/2021 08:56 Ron Garret ron@flownet.com wrote:
On Jan 17, 2021, at 10:48 PM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
Don't touch the INBOX setting (leave it out), use the -m parameter for dovecot-lda.
I don’t think that will work. My MTA is postfix and it’s connected to dovecot via LMTP, so AFAIK postfix is talking to dovecot over a socket, and dovecot-lda isn’t being invoked so there is no place to pass that the -m parameter. But we are at the limits of my understanding of how all this stuff actually works under the hood so please correct me if I’m wrong here.
rg
Ah, you are using LMTP... then the easiest is to use Sieve here.
I was afraid of that :-(
What about just using postfix as the LDA?
You can use simple global script, e.g. /etc/dovecot/default-mbox.sieve
require ["fileinto", "mailbox"]; fileinto "OtherBox";
then sievec the script, and use
plugin { sieve_before = /etc/dovecot/default-mbox.sieve }
this way it will change the default mailbox, but allows per-user scripts to change it.
The problem is that the spam filter needs to put good messages back in INBOX. That would cause an infinite loop (unless sieve has a mechanism to prevent this that I don’t know about). So to prevent this I’d need to make the rule conditional on some header that the spam filter adds before moving the message back. The problem with *that* is that it plays badly with the strategy for training the filter, which is for the user to move false-positive messages from SPAM to INBOX. A user might then also move a good message from OtherBox to INBOX rather than wait for the spam filter to get around to processing it, and then sieve would (presumably) move it right back. So now I need *another* header that *sieve* adds before moving the message to OtherBox and make the rule conditional on *that* header. It all starts to seem very complicated and fragile.
rg
How about using IMAP Sieve for Spam filter training? https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/
Also, sieve rules are processed during Delivery (lmtp or lda), not if users or spam filters move messages around. IMAP sieve is different thing, and needs to be separately configured. Not sure what "infinite loop" you are seeing here?
Aki
On Jan 18, 2021, at 8:11 AM, Aki Tuomi aki.tuomi@open-xchange.com wrote:
How about using IMAP Sieve for Spam filter training? https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/
That is in fact exactly what I am doing.
Also, sieve rules are processed during Delivery (lmtp or lda), not if users or spam filters move messages around. IMAP sieve is different thing, and needs to be separately configured. Not sure what "infinite loop" you are seeing here?
Ah. I did not realize that sieve and IMAP sieve were two different things. I though they were synonyms.
I’m not actually *seeing* an infinite loop, I was merely anticipating one. But that was based on what is apparently a false assumption. So I need to go back and re-do my design analysis with this in mind.
Thanks for the help!
rg
participants (3)
-
Aki Tuomi
-
Noel
-
Ron Garret