Re: [Dovecot] lmtp problem with wrong index path

2013-02-25 Thread dalevizo
On Mon 25/02/2013 16:39, Timo Sirainen wrote:
> Since you're using directors, you can use mail_nfs_index=no and 
> mail_nfs_storage=no. The performance will be better.

Ok but that'll have to wait until we've fully migrated from our current
MX servers with direct access to the mailboxes to lmtp.

> The main problem here is that you create indexes using %u, but there are 3 
> different valid %us: uid, mail and mailAlternateAddress. So you're most 
> likely hitting problems for users whose mails are being delivered using 
> mailAlternateAddress. Those alias expansions should normally be handled by 
> your MTA.

Alas no. The MTA does handle alias expansions :

root@vader:lmtp $ ldapsearch -h deer -x mail=dalev...@otenet.gr uid uidNumber 
gidNumber mail mailAlternateAddress mailPath folderPath -LLL 
dn: uid=daleviz1,ou=people,dc=otenet,dc=gr
uid: daleviz1
uidNumber: 69757
gidNumber: 647
mail: dalev...@otenet.gr
mailAlternateAddress: dovecott...@otenet.gr
mailPath: /var/mail/U/V/H/daleviz1
folderPath: /var/mail/folders/U/V/H/daleviz1

root@vader:lmtp $ telnet deneb.otenet.gr 25
Trying 83.235.66.54...
Connected to deneb.otenet.gr (83.235.66.54).
Escape character is '^]'.
220 ESMTP
helo otenet.gr
250 deneb.otenet.gr
mail from:
250 2.1.0 Ok
rcpt to:
250 2.1.5 Ok
data
354 End data with .
test mail
.
250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as E78418E0023
quit
221 2.0.0 Bye
Connection closed by foreign host.

Feb 26 00:19:07 deneb postfix/lmtp[19885]: E78418E0023: 
to=, orig_to=, 
relay=pop08.otenet.gr[83.235.66.47]:24, delay=0.03, delays=0.01/0/0/0.02, 
dsn=2.0.0, status=sent (250 2.0.0  GgW/NcziK1GCKwAADehEhg 
Saved)

Feb 26 00:19:07 pop08 dovecot: lmtp(11138, dalev...@otenet.gr): 
GgW/NcziK1GCKwAADehEhg: msgid=unspecified: saved mail to INBOX

> With the above config you should be able to solve this by not using %u but 
> the LDAP's mail field. So something like (with cleaning up the whole config):
> 
> user_attrs = \
>   =user=%{ldap:mail}, \
>   =home=%{ldap:folderPath}, \
>   =quota_rule=*:storage=%{ldap:mailQuota}M, \
>   =uid=%{ldap:uidNumber}, \
>   =gid=%{ldap:gidNumber}, \
>   
> =mail=mbox:~/:INBOX=%{ldap:mailPath}:INDEX=/indexes/%1M{ldap:mail}/%2.1M{ldap:mail}/%3.1M{ldap:mail}/%{ldap:mail}

I tried it but unfortunately the problem remains :

Feb 26 00:02:28 pop08 dovecot: lmtp(26796, 
dinos.mpalani...@3230.syzefxis.gov.gr): Error: 
stat(/var/index/dovecot/7/8/3/ama...@3230.syzefxis.go
v.gr/.imap/INBOX/dovecot.index.log) failed: Permission denied 
(euid=10117261() egid=165() missing +x perm: 
/var/index/dovecot
/7/8/3/ama...@3230.syzefxis.gov.gr, dir owned by 10117262:165 mode=0700)
Feb 26 00:02:28 pop08 dovecot: lmtp(26796, 
dinos.mpalani...@3230.syzefxis.gov.gr): Error: 
stat(/var/index/dovecot/7/8/3/ama...@3230.syzefxis.go
v.gr/.imap/INBOX/dovecot.index) failed: Permission denied 
(euid=10117261() egid=165() missing +x perm: 
/var/index/dovecot/7/8
/3/ama...@3230.syzefxis.gov.gr, dir owned by 10117262:165 mode=0700)
Feb 26 00:02:28 pop08 dovecot: lmtp(26796, 
dinos.mpalani...@3230.syzefxis.gov.gr): QYsqEkjfK1GsaAAADehEhg: sieve: 
msgid=<19dfa2f0f211951c56596c
9600194...@otenet.gr>: stored mail into mailbox 'INBOX'

These two users, dinos.mpalani...@3230.syzefxis.gov.gr and
ama...@3230.syzefxis.gov.gr have nothing in common apart from belonging
to the same domain.

root@vader:lmtp $ ldapsearch -h deer -x 
mail=dinos.mpalani...@3230.syzefxis.gov.gr uid uidNumber gidNumber mail 
mailAlternateAddress mailPath f
olderPath -LLL  
   
dn: uid=3230_syzefxis_gov_gr_user_003,ou=people,dc=otenet,dc=gr
uid: 3230_syzefxis_gov_gr_user_003
uidNumber: 10117261
gidNumber: 165
mail: dinos.mpalani...@3230.syzefxis.gov.gr
mailPath: /var/mail/C/3/6/3230_syzefxis_gov_gr_user_003
folderPath: /var/mail/folders/C/3/6/3230_syzefxis_gov_gr_user_003

root@vader:lmtp $ ldapsearch -h deer -x mail=ama...@3230.syzefxis.gov.gr uid 
uidNumber gidNumber mail mailAlternateAddress mailPath folderPath 
-LLL
dn: uid=3230_syzefxis_gov_gr_user_002,ou=people,dc=otenet,dc=gr
uid: 3230_syzefxis_gov_gr_user_002
uidNumber: 10117262
gidNumber: 165
mail: ama...@3230.syzefxis.gov.gr
mailPath: /var/mail/C/3/6/3230_syzefxis_gov_gr_user_002
folderPath: /var/mail/folders/C/3/6/3230_syzefxis_gov_gr_user_002

However as you can see it tries to write to amalia's index while delivering to 
dinos.mpalanikas.
Of course we're only talking about 1 failure in 578 successful deliveries 
however that server currently only serves less than 5% of our customres right 
now and we're worried that if we go full scale the problem will simply become 
greater.

> Easier of course would be if you could determine mailPath using a static 
> template, then you could just use the global mail_location and %u directly, 
> because the %u gets normalized to same as "mail" field.

Indeed but I think that would mean getting rid of our lega

Re: [Dovecot] Mbox corruption - Inbox beginning with 'FFrom' or 'FrFrom'

2013-06-24 Thread dalevizo
Yeah that's because by mistake we put quota both in 10-mail.conf and
20-imap.conf, however I don't see how that could be the cause of the
problem.

D.

On Thu 20/06/2013 10:23, Benny Pedersen wrote:
> Dimos Alevizos skrev den 2013-06-19 15:00:
> 
> >protocol imap {
> >  imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
> >  mail_max_userip_connections = 100
> >  mail_plugins = quota imap_quota quota notify mail_log
> >}
> 
> quota listed 2 times
> 
> -- 
> senders that put my email into body content will deliver it to my
> own trashcan, so if you like to get reply, dont do it


Re: [Dovecot] Mbox corruption - Inbox beginning with 'FFrom' or 'FrFrom'

2013-06-24 Thread dalevizo
Thanx I'll try the patch as soon as possible and I'll let you know.
It is indeed very rare. We're only seeing 4-5 corruptions in about 13
million logins per day.
I've been trying to convince our design team that we should move to
maildir, but the truth is that it's quite a change, and we're way too
busy to deal with everything else AND a migration from mbox to maildir.

D.

On Mon 24/06/2013 13:16, Timo Sirainen wrote:
> On 19.6.2013, at 16.00, Dimos Alevizos  wrote:
> 
> > we're having some problems with our dovecot setup.
> > I've seen similar problems in the mailing list some years ago but alas 
> > wasn't able to find a solution.
> > 
> > Our setup is as follows :
> > An MX farm (postfix) sends mails via LMTP to a director farm (dovecot 
> > 2.1.12) which proxies pop3/imap/lmtp traffic to a dovecot farm (dovecot 
> > 2.1.16).
> > All mailboxes and indexes are on NFS and all servers are Centos.
> > 
> > The problem is that at times we see mailboxes (all of them are in mbox 
> > format) beginning with FFrom or FrFrom and of course dovecot says it's not 
> > a valid mbox file.
> 
> This is quite an old bug, but it happens rarely enough that I haven't been 
> able to reproduce and fix it. Actually people hadn't complained about it for 
> a long time now, so I had assumed it had somehow gotten fixed already.
> 
> With the attached debug patch it should crash instead of (completely) 
> corrupting the mbox file. Debugging the resulting core file with gdb could be 
> useful in figuring this out.
> 
> Although I wouldn't recommend mbox format for any big installation anyway..
> 


> 
>