dovecot+ldap with keepalive

2020-12-28 Thread Maciej Milaszewski
Hi
I have dovecot-2.36.4 (director +5 nodes) - backend to auth is
openldap+keepalived to second ldap

For test i shutdown my ldap server - keepalive  works perfectly VIP
switched - ldapserach works ok (all connect to second ldap)
but I noticed strange dovecot behavior - some user get "no response" or
"waiting waiting"

in dovecot i use:
auth_cache_negative_ttl = 5 mins
auth_cache_size = 20 M
auth_cache_ttl = 5 mins

service lmtp {
  inet_listener lmtp {
    address = 127.0.0.1 10.0.100.4
    port = 24
  }
  process_min_avail = 5

protocol lmtp {
  auth_socket_path = director-userdb
  mail_plugins = quota expire notify mail_log
  passdb {
    args = proxy=y nopassword=y port=24
    driver = static
    name =
  }
  syslog_facility = local3
}


in ldap server i have:
idletimeout 256

Any idea ?



Re: .imap folders

2020-12-28 Thread Elise

Op 28-12-20 om 12:56 schreef Aki Tuomi:


in your mail location, where you have specified `mbox:~/...`

We do not recommend using mbox mail format for read-write, as the
support for that is limited.


Noted, that did the trick, thanks.

/Elise



Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Aki Tuomi


> On 28/12/2020 16:35 Toni Mueller  wrote:
> 
>  
> Hi Aki,
> 
> On Mon, Dec 28, 2020 at 03:37:33PM +0200, Aki Tuomi wrote:
> > What you are describing will not be solved by looking at dovecot
> > source code.
> 
> ok.
> 
> > Can you describe your configuration more? Maybe you are running
> > dovecot in chroot or something? Can you consider using LMTP instead of
> > LDA?
> 
> I want to have as much information about the users and their mailboxes
> as possible in an SQL database (I use Pg), so I can easily move things
> around, change permissions and what-not.
> 
> I thought about using LMTP, but so far shyed away from it because I
> suspected that it would be unable to do uid/gid switching on a per-user
> basis. But I'll check this idea out as well.
> 
> I have not done anything special to the Debian installation, but
> checking if that contains an unwanted chroot somewhere, is a good idea!
> 
> 
> Thanks,
> Toni

LMTP can do uid/gid switching per user.

Aki


Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Toni Mueller


Hi Aki,

On Mon, Dec 28, 2020 at 03:37:33PM +0200, Aki Tuomi wrote:
> What you are describing will not be solved by looking at dovecot
> source code.

ok.

> Can you describe your configuration more? Maybe you are running
> dovecot in chroot or something? Can you consider using LMTP instead of
> LDA?

I want to have as much information about the users and their mailboxes
as possible in an SQL database (I use Pg), so I can easily move things
around, change permissions and what-not.

I thought about using LMTP, but so far shyed away from it because I
suspected that it would be unable to do uid/gid switching on a per-user
basis. But I'll check this idea out as well.

I have not done anything special to the Debian installation, but
checking if that contains an unwanted chroot somewhere, is a good idea!


Thanks,
Toni



Re: Very slow mail download/notification with dovecot 2.3.7 and Thunderbird​

2020-12-28 Thread Thorsten Reichelt
Hello Aki!

Thank you, I will give it a try.

Regards,
  Thorsten

> Try adding `mail_debug=yes` to your dovecot config and check logs
>
> Aki


Re: Very slow mail download/notification with dovecot 2.3.7 and Thunderbird​

2020-12-28 Thread Thorsten Reichelt
Hi!

Thank you very much!
This parameter (check_all_folders_for_new) was actually the solution to
my problem that not all new mails were reported.

Regards
  Thorsten


> On 28/12/2020 09:44, Matthias Fechner wrote:
>> Am 27.12.2020 um 16:11 schrieb Juri Haberland:
>>> I can't help you with your performance problem, but for Thunderbird to
>>> check all folders, you need to set "mail.check_all_imap_folders_for_new"
>>> to 'true' in the Thunderbird config editor.
>> I think the setting is:
>> mail.server.default.check_all_folders_for_new;true
> Both settings exist, but you are right, my setting is deprecated:
>



Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Christian Schmidt

Hi,

Toni Mueller, 27.12.20:

16:04:16 dovecot: lda(u...@example.com)<5291>: Error: 
Mailbox INBOX: Failed to autocreate mailbox: Mailbox INBOX: 
open(/var/mail/u...@example.com) failed: Permission denied (euid=12345(mailbox) 
egid=12345(mailbox) missing +w perm: /var/mail, we're not in group 8(mail), dir owned by 
0:8 mode=0775)
16:04:16 dovecot: lda(u...@example.com)<5291>: 
msgid=<20201226224933.014...@laptop.example.com>: save failed to open mailbox INBOX: 
Mailbox INBOX: Failed to autocreate mailbox: Mailbox INBOX: open(/var/mail/u...@example.com) 
failed: Permission denied (euid=12345(mailbox) egid=12345(mailbox) missing +w perm: /var/mail, 
we're not in group 8(mail), dir owned by 0:8 mode=0775)
16:04:16 postfix/pipe[5284]: 8CD6CE072E: to=, 
orig_to=, relay=dovecot, delay=62083, delays=62083/0.04/0/0.04, 
dsn=4.3.0, status=deferred (temporary failure)


In /etc/postfix/master.cf, I have this to call it:

dovecot   unix  -   n   n   -   -   pipe
   flags=DRhu user=_mailbox argv=/usr/lib/dovecot/deliver -f ${sender} -d 
${user}@${domain} -a ${recipient}


I've tried strace-ing dovecot-lda, but it didn't really help me to
understand why it discards the result of the userdb lookup.


Can anyone please provide a cluebat, please?


I'd change the setup towards postfix handing over the messages to 
dovecot via lmtp.


You can easily achive this by setting
relay_domains = btree:/etc/postfix/relay-transport
in your postfix configuration and creating a file 
/etc/postfix/relay-transport:

your_mail_domain  lmtp:unix:private/lmtp-dovecot

Mit freundlichen Grüßen
Christian Schmidt

--
No signature available.


Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Aki Tuomi


> On 28/12/2020 15:06 Toni Mueller  wrote:
> 
>  
> Hi Tamsy,
> 
> On Mon, Dec 28, 2020 at 09:47:54AM +, Toni Mueller wrote:
> > On Mon, Dec 28, 2020 at 09:52:17AM +0700, Tamsy wrote:
> > > Try this:
> > > 
> > >    mail_home = /path-to-mailboxen/%d/%n
> > >    mail_location = maildir:~/Maildir:LAYOUT=fs
> > > 
> > > and
> > > 
> > > namespace inbox {
> > >    separator = /
> > >    prefix    =
> > >    inbox = yes
> > >    subscriptions = yes
> > >    list  = yes
> > >    type   = private
> > >    hidden    = no
> > > }
> > 
> > thank you for the idea.
> > 
> > I'll give it a try (there was another variable needed to be set to avoid
> > clashes with "new", but the name escapes me atm), although it doesn't
> > cover a number of special cases that I have, where the location of the
> > mailboxen does not follow this pattern.
> > 
> > In the end, I want the database to be the single source of truth.
> 
> well, I tried, but with no luck. LDA still wants to deliver to
> /var/mail, as before.
> 
> I am pretty sure that it must work somehow to fetch all data from a
> database, because it did before. It would be really strange if someone
> would have culled that functionaility. I am just not yet sure whether
> it's just me not getting it right, or whether there's actually a bug.
> 
> Next stop: Read Dovecot's source code (I dread that), unless someone
> comes up with a better idea.
> 
> Please.
> 
>  
> Thanks,
> Toni

What you are describing will not be solved by looking at dovecot source code. 
Can you describe your configuration more? Maybe you are running dovecot in 
chroot or something? Can you consider using LMTP instead of LDA?

Aki


Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Toni Mueller



Hi Tamsy,

On Mon, Dec 28, 2020 at 09:47:54AM +, Toni Mueller wrote:
> On Mon, Dec 28, 2020 at 09:52:17AM +0700, Tamsy wrote:
> > Try this:
> > 
> >    mail_home = /path-to-mailboxen/%d/%n
> >    mail_location = maildir:~/Maildir:LAYOUT=fs
> > 
> > and
> > 
> > namespace inbox {
> >    separator = /
> >    prefix    =
> >    inbox = yes
> >    subscriptions = yes
> >    list  = yes
> >    type = private
> >    hidden    = no
> > }
> 
> thank you for the idea.
> 
> I'll give it a try (there was another variable needed to be set to avoid
> clashes with "new", but the name escapes me atm), although it doesn't
> cover a number of special cases that I have, where the location of the
> mailboxen does not follow this pattern.
> 
> In the end, I want the database to be the single source of truth.

well, I tried, but with no luck. LDA still wants to deliver to
/var/mail, as before.

I am pretty sure that it must work somehow to fetch all data from a
database, because it did before. It would be really strange if someone
would have culled that functionaility. I am just not yet sure whether
it's just me not getting it right, or whether there's actually a bug.

Next stop: Read Dovecot's source code (I dread that), unless someone
comes up with a better idea.

Please.

 
Thanks,
Toni



Re: .imap folders

2020-12-28 Thread Aki Tuomi
On 28/12/2020 13.10, Elise wrote:
> Op 27-12-20 om 16:16 schreef Aki Tuomi:
> 
>> The .imap directories contain indexes for dovecot. If you want to put
>> them elsewhere, try adding :INDEX=/somewhere/else/%u to your mail
>> location.
> 
> Thanks for this. Where should I put this line or is that part of the
> command line?
> 
> /Elise
> 

in your mail location, where you have specified `mbox:~/...`

We do not recommend using mbox mail format for read-write, as the
support for that is limited.

Aki


0x193B6363B3444206.asc
Description: application/pgp-keys


Re: Very slow mail download/notification with dovecot 2.3.7 and Thunderbird​

2020-12-28 Thread Aki Tuomi


> On 28/12/2020 13:15 Juri Haberland  wrote:
> 
>  
> On 28/12/2020 09:44, Matthias Fechner wrote:
> > Am 27.12.2020 um 16:11 schrieb Juri Haberland:
> >> I can't help you with your performance problem, but for Thunderbird to
> >> check all folders, you need to set "mail.check_all_imap_folders_for_new"
> >> to 'true' in the Thunderbird config editor.
> > 
> > I think the setting is:
> > mail.server.default.check_all_folders_for_new;true
> 
> Both settings exist, but you are right, my setting is deprecated:
> 
> From
> http://kb.mozillazine.org/Checking_for_new_messages_in_other_folders_%28Thunderbird%29#IMAP:
> >  Thunderbird used to support setting 
> > mail.check_all_imap_folders_for_new to true to make it check every remote 
> > folder for new mail. The downside was there is no way to exclude a specific 
> > folder (such as a junk mail folder). However, that setting was replaced in 
> > version 5.0 with server-specific ones. Set 
> > mail.server.default.check_all_folders_for_new to true instead to make it 
> > effective for all accounts using the Config Editor. 
> 
> 
> Regards,
>   Juri

Try adding `mail_debug=yes` to your dovecot config and check logs

Aki


Re: Very slow mail download/notification with dovecot 2.3.7 and Thunderbird​

2020-12-28 Thread Juri Haberland
On 28/12/2020 09:44, Matthias Fechner wrote:
> Am 27.12.2020 um 16:11 schrieb Juri Haberland:
>> I can't help you with your performance problem, but for Thunderbird to
>> check all folders, you need to set "mail.check_all_imap_folders_for_new"
>> to 'true' in the Thunderbird config editor.
> 
> I think the setting is:
> mail.server.default.check_all_folders_for_new;true

Both settings exist, but you are right, my setting is deprecated:

From
http://kb.mozillazine.org/Checking_for_new_messages_in_other_folders_%28Thunderbird%29#IMAP:
>  Thunderbird used to support setting mail.check_all_imap_folders_for_new 
> to true to make it check every remote folder for new mail. The downside was 
> there is no way to exclude a specific folder (such as a junk mail folder). 
> However, that setting was replaced in version 5.0 with server-specific ones. 
> Set mail.server.default.check_all_folders_for_new to true instead to make it 
> effective for all accounts using the Config Editor. 


Regards,
  Juri


Re: LDA ignores virtual mailbox settings

2020-12-28 Thread Toni Mueller


Hi Tamsy,

(your message was formatted a bit strangely)

On Mon, Dec 28, 2020 at 09:52:17AM +0700, Tamsy wrote:
> Try this:
> 
>    mail_home = /path-to-mailboxen/%d/%n
>    mail_location = maildir:~/Maildir:LAYOUT=fs
> 
> and
> 
> namespace inbox {
>    separator = /
>    prefix    =
>    inbox = yes
>    subscriptions = yes
>    list  = yes
>    type   = private
>    hidden    = no
> }

thank you for the idea.

I'll give it a try (there was another variable needed to be set to avoid
clashes with "new", but the name escapes me atm), although it doesn't
cover a number of special cases that I have, where the location of the
mailboxen does not follow this pattern.

In the end, I want the database to be the single source of truth.


Thanks,
Toni


Re: Very slow mail download/notification with dovecot 2.3.7 and Thunderbird​

2020-12-28 Thread Matthias Fechner

Am 27.12.2020 um 16:11 schrieb Juri Haberland:

I can't help you with your performance problem, but for Thunderbird to
check all folders, you need to set "mail.check_all_imap_folders_for_new"
to 'true' in the Thunderbird config editor.


I think the setting is:
mail.server.default.check_all_folders_for_new;true

Gruß
Matthias

--

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook