Re: Autocreate virtual users' home directory?

2024-01-03 Thread Aki Tuomi via dovecot

> On 03/01/2024 23:38 EET John Fawcett  wrote:
> 
>  
> Hi
> 
> I have recently rectified an old configuration error whereby I had 
> virtual users' home and mail directories set to the same value.
> 
> I used option 3 from "ways to set up home directory"
> 
> https://doc.dovecot.org/configuration_manual/home_directories_for_virtual_users/
> 
> so I have:
> 
> home= |/var/vmail/domain/user/home/|
> 
> mail= |/var/vmail/domain/user/|
> 
> |where domain and user are substituted for the real domain and user.|
> 
> For existing users where I created the home directory when migrating the 
> settings, there is no issue. But I am seeing errors like this for new users:
> 
> lmtp(t...@example.com)<125035>: Error: 
> autoexpunge: Couldn't create dovecot.autoexpunge.lock lock: 
> file_create_locked(/var/vmail/example.com/t...@example.com/home//dovecot.autoexpunge.lock)
>  
> failed: 
> safe_mkstemp(/var/vmail/example.com/t...@example.com/home//dovecot.autoexpunge.lock)
>  
> failed: No such file or directory
> 
> Seems that differently to mail directory which is automatically created, 
> the home directory is not created. I couldn't see any config setting 
> that would autocreate home directories (where home directories are 
> subdirectories of mail directories).
> 
> Would it be worthwhile introducing an autocreate option for home 
> directories?
> 
> John
> 
> 
> 
> 
> 
> Hi
> I have recently rectified an old configuration error whereby I had virtual
> users' home and mail directories set to the same value.
> I used option 3 from "ways to set up home directory"
> https://doc.dovecot.org/configuration_manual/
> home_directories_for_virtual_users/
> so I have:
> home= /var/vmail/domain/user/home/ 
> mail= /var/vmail/domain/user/
> where domain and user are substituted for the real domain and user.
> For existing users where I created the home directory when migrating the
> settings, there is no issue. But I am seeing errors like this for new users:
> lmtp(t...@example.com)<125035>: Error: autoexpunge:
> Couldn't create dovecot.autoexpunge.lock lock: file_create_locked(/var/vmail/
> example.com/t...@example.com/home//dovecot.autoexpunge.lock) failed:
> safe_mkstemp(/var/vmail/example.com/t...@example.com/home//
> dovecot.autoexpunge.lock) failed: No such file or directory
> Seems that differently to mail directory which is automatically created, the
> home directory is not created. I couldn't see any config setting that would
> autocreate home directories (where home directories are subdirectories of mail
> directories).
> Would it be worthwhile introducing an autocreate option for home directories?
> John
> 
> 
> 

I don't really understand why you want home to be under mail directory? How 
about swapping them around like 

home= /var/vmail/domain/user/
mail= /var/vmail/domain/user/mail

because this makes more sense in many ways?

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Autocreate virtual users' home directory?

2024-01-03 Thread John Fawcett
Hi
I have recently rectified an old configuration error whereby I had virtual
users' home and mail directories set to the same value.
I used option 3 from "ways to set up home directory"
https://doc.dovecot.org/configuration_manual/
home_directories_for_virtual_users/
so I have:
home= /var/vmail/domain/user/home/ 
mail= /var/vmail/domain/user/
where domain and user are substituted for the real domain and user.
For existing users where I created the home directory when migrating the
settings, there is no issue. But I am seeing errors like this for new users:
lmtp(t...@example.com)<125035>: Error: autoexpunge:
Couldn't create dovecot.autoexpunge.lock lock: file_create_locked(/var/vmail/
example.com/t...@example.com/home//dovecot.autoexpunge.lock) failed:
safe_mkstemp(/var/vmail/example.com/t...@example.com/home//
dovecot.autoexpunge.lock) failed: No such file or directory
Seems that differently to mail directory which is automatically created, the
home directory is not created. I couldn't see any config setting that would
autocreate home directories (where home directories are subdirectories of mail
directories).
Would it be worthwhile introducing an autocreate option for home directories?
John





___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Piegonhole behaviour when redirect fails

2024-01-03 Thread Aubry Jaquier via dovecot
Hello,

I noticed an unusual behavior of the implicit keep from pigeonhole when a
redirect fails in a sieve script.

For instance, with the sieve below, if the relay host is unavailable, dovecot
will not accept the email and will respond with a tempfail. 
redirect "myaddr...@domain.com";
stop;

But if my sieve script has a fileinto inside (see the example below), dovecot
will accept the message, copy the email in the INBOX and in the folder from the
fileinto and write the following log "Execution of script filter.sieve failed,
but implicit keep was successful"
fileinto "Folder";
redirect "myaddr...@domain.com";
stop;

According to the RFC 5228, section 2.10.2 Implicit keep, the last example
should not trigger an implicit keep but act like the first example.
An implicit keep is performed if a message is not written to a
mailbox, redirected to a new address, or explicitly thrown out.  That
is, if a fileinto, a keep, a redirect, or a discard is performed, an
implicit keep is not.


Does it look like a bug to you, or is this the intended behaviour ?

Best regards,

Aubry
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Solr/Tika patches for dovecot 2.3.21

2024-01-03 Thread John Fawcett

On 03/01/2024 10:16, Aki Tuomi via dovecot wrote:

On 09/12/2023 15:02 EET John Fawcett  wrote:

  
Hi


I've just made updated versions of 3 patches against the latest release
2.3.21 in case they are useful to someone or might get considered for
official inclusion.

John
___

Could you please post these into https://github.com/dovecot/core against main 
please?

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Thanks Aki, please see

https://github.com/dovecot/core/pull/215

All three patches are in a single pull request, but each patch has a 
separate commit. Also just noticed that pull request 213 contains a fix 
about solr "rows" query parameter with a different approach. If you 
intend to merge #213, let me know and I can either remove my patch or 
adjust it, whichever is preferred, since both approaches could co-exist.


John


John
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Solr/Tika patches for dovecot 2.3.21

2024-01-03 Thread Aki Tuomi via dovecot


> On 09/12/2023 15:02 EET John Fawcett  wrote:
> 
>  
> Hi
> 
> I've just made updated versions of 3 patches against the latest release 
> 2.3.21 in case they are useful to someone or might get considered for 
> official inclusion.
> 
> John
> 
> *dovecot-2.3.21-tika-http-auth.patch*
> 
> Allows specification of username and password in the fts_tika setting 
> for basic auth against tika server. For example
> 
> fts_tika = https://user:password@tika_server:443/tika
> 
> *dovecot-2.3.21-solr-max-size.patch
> *
> 
> This is a simplified version of my previous patch. Sets a size limit 
> (configuration fts_max_size) on message bodies that are to be indexed. 
> Message bodies for messages larger than fts_max_size are not sent to 
> solr. Defaults to zero which means no limit. For example
> 
> fts_max_size = 10M
> 
> *dovecot-2.3.21-solr-max-rows.patch
> *
> 
> When dovecot sends a search to solr it uses the rows parameter. For 
> multiple mailbox search the value used is SOLR_MAX_MULTI_ROWS , 
> hardcoded to 10. For single mailbox search the value is uidnext. 
> This patch introduces an upper limit for single mailbox search using the 
> same value as SOLR_MAX_MULTI_ROWS, while leaving the existing 
> functionality of sending the uidnext value if it is smaller. This is 
> just to place a more reasonable upper bound since uidnext can get much 
> larger.
> 
> Hi
> I've just made updated versions of 3 patches against the latest release 2.3.21
> in case they are useful to someone or might get considered for official
> inclusion.
> John
> dovecot-2.3.21-tika-http-auth.patch
> Allows specification of username and password in the fts_tika setting for 
> basic
> auth against tika server. For example
> fts_tika = https://user:password@tika_server:443/tika
> dovecot-2.3.21-solr-max-size.patch
> This is a simplified version of my previous patch. Sets a size limit
> (configuration fts_max_size) on message bodies that are to be indexed. Message
> bodies for messages larger than fts_max_size are not sent to solr. Defaults to
> zero which means no limit. For example
> fts_max_size = 10M
> dovecot-2.3.21-solr-max-rows.patch
> When dovecot sends a search to solr it uses the rows parameter. For multiple
> mailbox search the value used is SOLR_MAX_MULTI_ROWS , hardcoded to 10. 
> For
> single mailbox search the value is uidnext. This patch introduces an upper
> limit for single mailbox search using the same value as SOLR_MAX_MULTI_ROWS,
> while leaving the existing functionality of sending the uidnext value if it is
> smaller. This is just to place a more reasonable upper bound since uidnext can
> get much larger.
> 
> ___

Could you please post these into https://github.com/dovecot/core against main 
please?

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Panic: file index-search-result.c: line 132 (index_search_result_update_flags): assertion failed: (result->search_args->args == _arg)

2024-01-03 Thread Aki Tuomi via dovecot


> On 21/12/2023 20:32 EET Markus Doits via dovecot  wrote:
> 
>  
> Hello dovecot community,
> 
> I hope you can help me with the following panic:
> 
> ---
> 
> Panic:
> file index-search-result.c: line 132 (index_search_result_update_flags): 
> assertion failed: (result->search_args->args == _arg)
> 
> Error:



> 
> ---
> 
> I have this virtual mailbox configured:
> 
> namespace {
>prefix = _/
>separator = /
>location = 
> virtual:~/Maildir/virtual:LAYOUT=maildir++:INDEX=~/Maildir/virtual
> }
> 

You should not store virtual folders inside Maildir (assuming this is your mail 
location). Please use
~/virtual/ instead. The INDEX directive is not needed in this case as it points 
to same place anyways.

> When I remove this mailbox, the error goes away - so it seems to be 
> something with the virtual mailbox.
> 
> As the fts provider I use 
> [fts_flatcurve](https://slusarz.github.io/dovecot-fts-flatcurve), maybe 
> this has something to do with it?
> 
> Any help appreciated how to debug this further and maybe fix it. Thanks!

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: how to take mdbox extract of time interval and restore that again?

2024-01-03 Thread Aki Tuomi via dovecot


> On 27/12/2023 11:33 EET lutzn via dovecot  wrote:
> 
>  
> Hi!
> 
> Due to a fatal hardware error we have to extract data of all existing imap 
> accounts and all their boxes/folders etc. from an mdbox store starting with 
> the 5th of december until today.  Then we have to restore the old system and 
> import the data back into it.  Mail before 5th will come from the system 
> backup, newer mail from that export.  After that it may be possible that 
> some/few mails may exist twice in the boxes, but that's ok.
> 
> 1.  What would be the command line for doveadm to extract everything starting 
> the 5th?  I find that the command line for doveadm is pretty complicated.  I 
> tried but I am not sure if I really got all mails exported.  So I would like 
> to ask if someone with much more experience can give me a command line that 
> surely does what we want.  The command will be run from a remote machine.
> 

You can use doveadm import to specify search, using doveadm-search-query(7). Be 
careful though, import is not re-entrant, and will happily import same mails 
again.

> 2.  And what would be the command line to restore all the mails that we have 
> exported back into the system?  (The folder and account structure is the 
> same.)
> 

doveadm sync is probably best tool for this.

> 3.  After that some of the mails may exist twice.  Is that a problem, maybe 
> because of internal IDs?
> 

If duplicates appear, you can try using doveadm deduplicate.

> 4.  Are there any other things we need to be aware of when doing that?
> 
> I thank you very much for your help!
> 
> Cheers!
> -lutzn
> 
> 
> ___
> dovecot mailing list -- dovecot@dovecot.org
> To unsubscribe send an email to dovecot-le...@dovecot.org

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org