Re: Fast searching from android device with Dovecot/Maildir

2019-12-02 Thread Sami Ketola via dovecot
Hi,

you probably need to set up some kind of FTS backend and index your mails.
See https://doc.dovecot.org/configuration_manual/fts/ 


Sami


> On 1 Dec 2019, at 23.18, John Gateley via dovecot  wrote:
> 
> Hello,
> 
> I am using dovecot as an imap server, mail is stored in mail directories.
> Configuration is below.
> 
> One mail directory has about 14 Gb of mail in the inbox and .Sent directories.
> 
> Searching from an Android phone with gmail is slow or doesn't work (it times 
> out).
> 
> Is there a configuration for Dovecot that can improve this? A better e-mail 
> client
> for Android?
> 
> Thanks,
> 
> John
> 
> 
> root@giraffe:~# dovecot --version
> 2.2.27 (c0f36b0)
> root@giraffe:~# doveconf -an
> # 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.16 (fed8554)
> # OS: Linux 4.9.0-11-amd64 x86_64 Debian 9.11
> ...
> mail_location = maildir:~/Maildir
> namespace inbox {
>   inbox = yes
>   location =
>   mailbox Drafts {
> special_use = \Drafts
>   }
>   mailbox Junk {
> special_use = \Junk
>   }
>   mailbox Sent {
> special_use = \Sent
>   }
>   mailbox "Sent Messages" {
> special_use = \Sent
>   }
>   mailbox Trash {
> special_use = \Trash
>   }
>   prefix =
> }
> ...
> protocols = " imap"
> ...



ACL hide folders

2019-12-02 Thread Peter Chiochetti via dovecot

After updating from 2.2.22 to 2.2.33 rsp 2.3.8 my ACLs went bust.

Below line in the global acl file hides all folders except INBOX for all 
users



* group=ALL


Next reenable certain folders, eg:


Sent group=ALL lrwsi


This made anyone see "Sent" in 2.2.22, but no longer so in 2.2.33


Any ideas how to have it like before?


--
peter


About "received" header when using Dovecot proxy

2019-12-02 Thread Riku via dovecot
Hello.
My name is Riku.

Currently, I use Dovecot as a proxy for another SMTP server.
However, this seems to cause the IP address of the "received" header to be that 
of the proxy server.
Is it possible to change this so that the IP address of the sender is entered?
The version of Dovecot is "2.3.8 (9df20d2db)".
Sorry for the incomprehensible explanation.

Thank you.

 Best regards.



Re: ACL hide folders

2019-12-02 Thread Peter Chiochetti via dovecot

Am 02.12.19 um 13:35 schrieb Peter Chiochetti via dovecot:

After updating from 2.2.22 to 2.2.33 rsp 2.3.8 my ACLs went bust.

Below line in the global acl file hides all folders except INBOX for all 
users



* group=ALL


Next reenable certain folders, eg:


Sent group=ALL lrwsi


This made anyone see "Sent" in 2.2.22, but no longer so in 2.2.33


Any ideas how to have it like before?




PS: my setup is a little contrived, but perhaps, this can be seen more 
widely? Attached acl-debug output; I suppose, it clearly states, the 
mailbox is visible in LIST - connecting with telnet I can select the 
mailbox and fetch messages, though it does not appear in LIST


--
peter
# doveadm -D acl debug -u NN Sent
doveadm(NN): Debug: auth-master: userdb lookup(NN): Started userdb lookup
doveadm(NN): Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: 
Connecting
doveadm(NN): Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: Client 
connected (fd=10)
doveadm(NN): Debug: auth-master: userdb lookup(NN): auth USER input: crew 
acl_groups=ALL,GRP uid=1001 gid=1001 home=/home/crew blocking=no
doveadm(NN): Debug: auth-master: userdb lookup(NN): Finished userdb lookup 
(username=crew acl_groups=ALL,GRP uid=1001 gid=1001 home=/home/crew blocking=no)
doveadm(NN): Debug: changed username to crew
doveadm(NN): Debug: Added userdb setting: plugin/acl_groups=ALL,GRP
doveadm(NN): Debug: Added userdb setting: plugin/blocking=no
doveadm(NN): Debug: Effective uid=1001, gid=1001, home=/home/crew
doveadm(NN): Debug: acl: No acl_shared_dict setting - shared mailbox listing is 
disabled
doveadm(NN): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, 
hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir
doveadm(NN): Debug: maildir++: root=/home/crew/Maildir, index=, indexpvt=, 
control=, inbox=/home/crew/Maildir, alt=
doveadm(NN): Debug: acl: initializing backend with data: 
vfile:/etc/dovecot/dovecot-acl
doveadm(NN): Debug: acl: acl username = crew
doveadm(NN): Debug: acl: owner = 1
doveadm(NN): Debug: acl: group added: ALL
doveadm(NN): Debug: acl: group added: GRP
doveadm(NN): Debug: acl vfile: Global ACL file: /etc/dovecot/dovecot-acl
doveadm(NN): Info: Mailbox 'Sent' is in namespace ''
doveadm(NN): Info: Mailbox path: /home/crew/Maildir/.Sent
doveadm(NN): Info: All message flags are shared across users in mailbox
doveadm(NN): Debug: Mailbox 'Sent' matches global ACL pattern '*'
doveadm(NN): Debug: Mailbox 'Sent' matches global ACL pattern '*'
doveadm(NN): Debug: Mailbox 'Sent' matches global ACL pattern '*'
doveadm(NN): Debug: Mailbox 'Sent' matches global ACL pattern '*'
doveadm(NN): Debug: Mailbox 'Sent' matches global ACL pattern 'Sent'
doveadm(NN): Info: User crew has rights: lookup read write write-seen insert
doveadm(NN): Info: Mailbox in user's private namespace
doveadm(NN): Info: Mailbox Sent is visible in LIST
doveadm(NN): Debug: auth-master: conn unix:/var/run/dovecot/auth-userdb: 
Disconnected: Connection closed (fd=10)


Re: ACL hide folders

2019-12-02 Thread Peter Chiochetti via dovecot

Am 02.12.19 um 13:35 schrieb Peter Chiochetti via dovecot:

After updating from 2.2.22 to 2.2.33 rsp 2.3.8 my ACLs went bust.

Below line in the global acl file hides all folders except INBOX for all 
users



* group=ALL


Next reenable certain folders, eg:


Sent group=ALL lrwsi


This made anyone see "Sent" in 2.2.22, but no longer so in 2.2.33


Any ideas how to have it like before?




PPS: turning on mail_debug=yes, dovecot logs


imap(...): Debug: acl: Mailbox not in dovecot-acl-list: Sent


Yet, I have configured acl_globals_only = yes

--
peter


Running dovecot proxy as different user

2019-12-02 Thread Marc Roos via dovecot


I thought, I read somewhere I could prevent chroot with[1] but I am 
still getting chroot errors[2]. 

drwxrwxr-x 2 10053   101  6 Dec  2 16:54 empty
drwxr-x--- 2 10053   101 73 Dec  2 17:00 login
drwxr-x--- 2 10053   101 44 Dec  2 17:00 token-login

[1]
service anvil {
  chroot =
}

[2]
Dec  2 17:07:07 c04 dovecot: stats: Fatal: chroot(/var/dovecot/empty) 
failed: Operation not permitted
Dec  2 17:07:07 c04 dovecot: master: Error: service(stats): command 
startup failed, throttling for 16 secs
Dec  2 17:07:07 c04 dovecot: pop3-login: Fatal: setgid(101(dovenull)) 
failed with euid=10053(dovecot), gid=10053(dovecot), 
egid=10053(dovecot): Operation not permitted (This binary should 
probably be called with process group set to 101(dovenull) instead of 
10053(dovecot))
Dec  2 17:07:07 c04 dovecot: master: Error: service(pop3-login): command 
startup failed, throttling for 16 secs




Re: About "received" header when using Dovecot proxy

2019-12-02 Thread Tom Sommer via dovecot



On 2019-12-02 13:42, Riku via dovecot wrote:

Hello.
My name is Riku.

Currently, I use Dovecot as a proxy for another SMTP server.
However, this seems to cause the IP address of the "received" header
to be that of the proxy server.
Is it possible to change this so that the IP address of the sender is 
entered?

The version of Dovecot is "2.3.8 (9df20d2db)".
Sorry for the incomprehensible explanation.


This has been discussed a few times on the list already, and I believe 
there is a fix coming at some point: 
https://github.com/dovecot/core/pull/74


Currently there is none

--
Tom


running dovecot under different user

2019-12-02 Thread Marc Roos via dovecot


Did anyone ever managed to run dovecot as a non-root user?


Re: running dovecot under different user

2019-12-02 Thread Benny Pedersen via dovecot

On 2019-12-02 20:08, Marc Roos via dovecot wrote:

Did anyone ever managed to run dovecot as a non-root user?


basic: all ports below 1024 need to be setup from root unix system user

so yes dovecot can run non rooted if all binded ports is over 1023

if thats practical


RE: running dovecot under different user

2019-12-02 Thread Marc Roos via dovecot
 

Unless you run with linux capability net_bind_service. But I just found 
this page[1] maybe those user options help.

[1]
https://wiki.dovecot.org/HowTo/Rootless


-Original Message-
From: Benny Pedersen via dovecot [mailto:dovecot@dovecot.org] 
Sent: maandag 2 december 2019 20:21
To: dovecot@dovecot.org
Subject: Re: running dovecot under different user

On 2019-12-02 20:08, Marc Roos via dovecot wrote:
> Did anyone ever managed to run dovecot as a non-root user?

basic: all ports below 1024 need to be setup from root unix system user

so yes dovecot can run non rooted if all binded ports is over 1023

if thats practical




fts_solr and # char

2019-12-02 Thread Marcio Merlone via dovecot

Hi,

Dovecot wiki says the solr url is something like 'solr/dovecot/' but 
this gives a 404, if I install solr as per the docs I have a 
'solr/#/dovecot/' url:


https://wiki.dovecot.org/Plugins/FTS/Solr

I have installed dovecot 2.3 from https://repo.dovecot.org/ and solr 8.3 
as per the wiki on a Ubuntu 18.04.



The problem and the guess work I did:


fts_solr = url=http://localhost:8983/solr/#/dovecot/

doveconf: Warning: Configuration file /etc/dovecot/conf.d/90-plugin.conf 
line 13: Ambiguous '#' character in line, treating it as comment. Add a 
space before it to remove this warning.



fts_solr = url="http://localhost:8983/solr/#/dovecot/";

Error: fts: Failed to initialize backend 'solr': fts_solr: Failed to 
parse HTTP url: Path component contains invalid character



fts_solr = url='http://localhost:8983/solr/#/dovecot/'

Error: fts: Failed to initialize backend 'solr': fts_solr: Failed to 
parse HTTP url: Relative HTTP URL not allowed



fts_solr = url=http://localhost:8983/solr/%23/dovecot/

Error: Failed to expand plugin setting fts_solr = 
'url=http://localhost:8983/solr/%23/dovecot/': Unknown variable '%/'



fts_solr = 'url=http://localhost:8983/solr/#/dovecot/'

fts_solr: Failed to parse HTTP url: URL fragment not allowed for HTTP 
URL in this context



Thanks for any help.


--
*Marcio Merlone=*


Problem With Quota Dovecot

2019-12-02 Thread Gter Marcelo via dovecot
Hi Dears,

I have one problem with Dovecot in My mailserver.

Dovecot Quota setting is not working fine.

plugin {
  quota = dict:User quota::file:MAILDIR/dovecot-quota
  quota_rule = *:storage=1GB
}

For example if i put the limit in 1GB, i have accounts in my mailbox with
size of maildir in 3gb,4gb for exemple and if i running the command

doveadm quota get -u ACCOUNT_MY_USER

The user with 2GB should be return 100% or some number bigger , but return
45% used only,

If i force running one force-resync, the quota-get return the size correct
showing more  than 100%

Someone can Help me ?


Re: About "received" header when using Dovecot proxy

2019-12-02 Thread Sami Ketola via dovecot



> On 2 Dec 2019, at 19.23, Tom Sommer via dovecot  wrote:
> 
> 
> On 2019-12-02 13:42, Riku via dovecot wrote:
>> Hello.
>> My name is Riku.
>> Currently, I use Dovecot as a proxy for another SMTP server.
>> However, this seems to cause the IP address of the "received" header
>> to be that of the proxy server.
>> Is it possible to change this so that the IP address of the sender is 
>> entered?
>> The version of Dovecot is "2.3.8 (9df20d2db)".
>> Sorry for the incomprehensible explanation.
> 
> This has been discussed a few times on the list already, and I believe there 
> is a fix coming at some point: https://github.com/dovecot/core/pull/74
> 
> Currently there is none


This change does not allow you to edit the received header, it's only about not 
adding it at all.

and the change seems to be on the list for 2.3.9

Sami



Re: Fast searching from android device with Dovecot/Maildir

2019-12-02 Thread Frank-Ulrich Sommer via dovecot
I dont't know the capabilities of gmail, but IMAP supports server side search 
which is quite fast if the Solr full text search plugin for dovecot is used 
(wiki.dovecot.org/Plugins/FTS/Solr). For debian "dovecot-solr" can be used.

For Android K9-Mail does not really support server side search, Aquamail does 
and for other mail clients I don't know.

Am 1. Dezember 2019 22:18:37 MEZ schrieb John Gateley via dovecot 
:
>Hello,
>
>I am using dovecot as an imap server, mail is stored in mail
>directories.
>Configuration is below.
>
>One mail directory has about 14 Gb of mail in the inbox and .Sent 
>directories.
>
>Searching from an Android phone with gmail is slow or doesn't work (it 
>times out).
>
>Is there a configuration for Dovecot that can improve this? A better 
>e-mail client
>for Android?
>
>Thanks,
>
>John
>
>
>root@giraffe:~# dovecot --version
>2.2.27 (c0f36b0)
>root@giraffe:~# doveconf -an
># 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf
># Pigeonhole version 0.4.16 (fed8554)
># OS: Linux 4.9.0-11-amd64 x86_64 Debian 9.11
>...
>mail_location = maildir:~/Maildir
>namespace inbox {
>   inbox = yes
>   location =
>   mailbox Drafts {
>     special_use = \Drafts
>   }
>   mailbox Junk {
>     special_use = \Junk
>   }
>   mailbox Sent {
>     special_use = \Sent
>   }
>   mailbox "Sent Messages" {
>     special_use = \Sent
>   }
>   mailbox Trash {
>     special_use = \Trash
>   }
>   prefix =
>}
>...
>protocols = " imap"
>...

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Re: fts_solr and # char

2019-12-02 Thread Shawn Heisey via dovecot

On 12/2/2019 12:34 PM, Marcio Merlone via dovecot wrote:
Dovecot wiki says the solr url is something like 'solr/dovecot/' but 
this gives a 404, if I install solr as per the docs I have a 
'solr/#/dovecot/' url:


Solr URLs with # in them are ONLY for use in a browser.  You cannot use 
them for API calls.  Specifically, they are used by the complex 
javascript application that is the Solr admin UI.


The reason is that all characters in a URL starting with # are NOT sent 
to the server, they are ONLY handled by the client.  Typically only a 
browser is capable of using those characters.


If the Solr core/collection is named "dovecot" then the example URL in 
the wiki is completely correct.  If the index has a different name, then 
you can replace the string "dovecot" with the correct name.


Trying the exact URL that you give to dovecot *will* give you a 404 
error.  When a Solr client (like fts_solr) uses that URL, it will add 
the necessary information for it to work correctly.


Thanks,
Shawn