[Dovecot] FTS question

Peter Chiochetti pch at myzel.net
Fri Feb 14 14:07:12 UTC 2014


Am 2014-02-14 05:43, schrieb Timo Sirainen:
> On 14.2.2014, at 5.15, Peter Chiochetti <pch at myzel.net> wrote:
>
>> Can I override the user parameter in solr indexing and searching?
>
> No, and I think that would the wrong solution for this, because it would have to be repeated for everything in Dovecot that uses username as part of the mailbox identifier.
>
> Change the user to be the same for all the users. Use the new %{auth_user} variable in v2.2.11+ for logging the unchanged username in login_log_format_elements and mail_log_prefix instead of using %u.
>

Thank You very much Timo, exactly what I was wishing for!

It took me some time to translate your short script into config, but now 
it works, so instead of a blog post somewhere, here we go, probably no 
other changes from the default config:


> # There is one system user "crew" where mail comes in.
> # There are several virtual users, that work with this
> # mail: move, reply, delete, etc. Think of groupware.
> # Anybody can do anything, but may have to justify…
>
> # sample line from passwd  file
> # Name:{PLAIN}password
> passdb {
>    driver = passwd-file
>    args = /etc/dovecot/passwd
> }
>
> # On authentication, users are switched to "crew"
> userdb {
>    driver = static
>    args = uid=crew gid=crew home=/home/crew user=crew
> }
>
> mail_plugins = $mail_plugins fts fts_solr mail_log notify
>
> plugin {
>    # Search
>    fts = solr
>    fts_solr = url=http://sage.bst.lan:8983/solr/
>    fts_autoindex = yes
>
>    # Audit
>    mail_log_prefix = %{auth_user}
>    mail_log_events = save copy delete undelete expunge mailbox_create mailbox_rename mailbox_delete
>    mail_log_fields = uid box msgid from subject
> }

I have turned off PAM in conf.d/10-auth.conf to avoid waiting for a 
small timeout. This setup only works for a single system user, another 
userdb driver should make it coexist with more system users though.

I think its nice if a body search also looks at the subject, so in solr 
schema write : <copyField source="subject" dest="body"/>


-- 
peter


More information about the dovecot mailing list