Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> Wonder if attached patch fixes it.

Yes.  Thanks!


Re: [Dovecot] doveadm quota recalc don't work

2010-09-24 Thread Timo Sirainen
On 24.9.2010, at 22.51, Thiago Henrique wrote:

> I use 'mdbox' as mailbox format, but my quota backend is 'maildir'. Is
> there a problem?

You can't use Maildir++ quota with mdbox. I guess I should make it give an 
error..

Use dict quota with file backend instead.



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
Wonder if attached patch fixes it. It's about the only bug I can think of in 
the hardlink-copying code. The code in hg happened to fix it already 
differently.



diff
Description: Binary data


Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On 24.9.2010, at 23.27, Mike Abbott wrote:

>> Oh, interesting.. What about if you run it with two users?
> 
> With two users that same assertion trips.  One user runs fine.

And this is with service imap { client_limit = 5 }? It doesn't trigger with 
limit=1?



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> Oh, interesting.. What about if you run it with two users?

With two users that same assertion trips.  One user runs fine.


Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On 24.9.2010, at 23.05, Mike Abbott wrote:

>> What about just:
>> 
>> imaptest clients=10 user=user1 pass=test no_tracking logout=0 copybox=Copies
> 
> No crashes this way.  It seems to need the different users.

Oh, interesting.. What about if you run it with two users? Like:

imaptest user=user1 etc. &
imaptest user=user2 etc.



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> What about just:
> 
> imaptest clients=10 user=user1 pass=test no_tracking logout=0 copybox=Copies

No crashes this way.  It seems to need the different users.

> This is with v2.0.3 release, not hg?

Correct, 2.0.3 plus your asserts from this thread.

> --enable-devel-checks

Doh, that's what I meant to use instead of maintainer-mode.  But it makes no 
difference, except being more verbose.

[Dovecot] doveadm quota recalc don't work

2010-09-24 Thread Thiago Henrique
Hello,

I'm testing Dovecot 2.0.

I plan to use Dovecot 2.0 with thousands of domains per server. My user
base is under virtual MySQL.

When I run `quota doveadm recalc`, Dovecot sets quota to zero:


r...@server:# doveadm -v quota get -u username
Quota nameTypeValue   Limit %
User quotaSTORAGE  1166 1048576 0
User quotaMESSAGE 1   - 0
r...@server:# doveadm -v quota recalc -u username
r...@server:# doveadm -v quota get -u username
Quota nameTypeValue   Limit %
User quotaSTORAGE 0 1048576 0
User quotaMESSAGE 0   - 0


My `dovecot -n` :


r...@box5:/home/thiagoh# cat a
# 2.0.3 (02a9cf90ad02): /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-24-server x86_64 Ubuntu 10.04.1 LTS ext4
auth_debug = yes
auth_debug_passwords = yes
auth_master_user_separator = *
auth_mechanisms = plain login
auth_username_chars =
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz01234567890...@=
auth_username_translation = @=
auth_verbose = yes
auth_verbose_passwords = plain
auth_worker_max_count = 10
disable_plaintext_auth = no
listen = server.com
login_greeting =  Dovecot ready!
mail_debug = yes
mail_gid = dovemail
mail_location = mdbox:/home/%u
mail_plugins = $mail_plugins quota
mail_uid = dovemail
managesieve_sieve_capability = fileinto reject envelope vacation
subaddress comparator-i;ascii-numeric relational regex imap4flags copy
include imapflags notify
mmap_disable = yes
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-sql-master.conf.ext
  driver = sql
  master = yes
  pass = yes
}
plugin {
  autocreate = SPAM
  autosubscribe = SPAM
  quota = maildir:User quota
  quota_rule = *:storage=1GB
  sieve = /var/lib/imap/sieve/%2.256RHu/%u/phpscript.script
  sieve_dir = /var/lib/imap/sieve/%2.256RHu/%u
  sieve_extensions = comparator-i;ascii-numeric copy envelope fileinto
imapflags include notify regex reject relational subaddress vacation
  sieve_max_script_size = 512KB
  sieve_quota_max_scripts = 2
}
protocols = imap pop3 lmtp sieve
service auth-worker {
  user = $default_internal_user
}
service auth {
  process_limit = 1
  process_min_avail = 1
}
service imap-login {
  inet_listener imap {
address = server.com
port = 143
  }
}
service imap {
  process_limit = 1024
  process_min_avail = 10
}
service lmtp {
  inet_listener {
address = server.com
port = 2003
  }
  process_limit = 256
  process_min_avail = 10
}
service managesieve-login {
  inet_listener sieve {
address = server.com
port = 4190
  }
  inet_listener sieve_deprecated {
address = server.com
port = 2000
  }
}
service managesieve {
  process_limit = 20
  process_min_avail = 10
}
service pop3-login {
  inet_listener pop3 {
address = server.com
port = 110
  }
}
service pop3 {
  process_limit = 256
  process_min_avail = 10
}
ssl = no
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
verbose_proctitle = yes
protocol imap {
  imap_idle_notify_interval = 120 s
  imap_max_line_length = 65536
  mail_max_userip_connections = 10
  mail_plugins = $mail_plugins quota imap_quota autocreate
}
protocol lmtp {
  mail_plugins = $mail_plugins sieve quota autocreate
}
protocol sieve {
  mail_plugins = $mail_plugins sieve
  managesieve_implementation_string =  Dovecot Pigeonhole
  managesieve_logout_format = bytes=%i/%o
  managesieve_max_line_length = 65536
  managesieve_sieve_capability = comparator-i;ascii-numeric copy
envelope fileinto imapflags include notify regex reject relational
subaddress vacation
}
protocol pop3 {
  mail_plugins = $mail_plugins quota autocreate
}


I use 'mdbox' as mailbox format, but my quota backend is 'maildir'. Is
there a problem?


Thank you in advance.
Best Regards
--
[]'s
Thiago Henrique
Network Administration
Digirati Networks
K8 Networks



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 22:25 +0100, Timo Sirainen wrote:
> On Fri, 2010-09-24 at 16:18 -0500, Mike Abbott wrote:
> > Seems related to maildir_copy_hardlink().  No crashes with 
> > maildir_copy_with_hardlinks=no.
> 
> This is with v2.0.3 release, not hg? I did some changes already related
> to this code in hg.. I'll check 2.0.3 too.

Nope, can't reproduce with 2.0.3 either. Have you tried with
--enable-devel-checks?




Re: [Dovecot] doveadm-expunge debug message clarifications

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 22:42 +0200, LEVAI Daniel wrote:
> > doveadm tries to access the expire database via the dict socket. You
> > didn't really give enough information about what user you're running
> > doveadm as or if you're using system or virtual users or.. 
> Sorry. I'm running that doveadm command as root, with the -u 
> parameter, where  is a virtual user.

The dict socket is opened only after root privileges are dropped, so its
permissions should have been the same as what the dropped privileges are
(i.e. accessible for the user that the imap processes are typically
running as).

> doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() 
> failed: Cannot load specified object
>   ^^^ I'm curious about this error message. Is it
>   safe to ignore this?

I changed this now to:

Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: Cannot 
load specified object (this is usually intentional, so just ignore this message)

> doveadm(): Debug: expunge: box=sa.spam uid=6435
> doveadm(): Debug: expunge: box=sa.spam uid=6436
> doveadm(): Debug: expunge: box=sa.spam uid=6437
> doveadm(): Debug: expunge: box=sa.spam uid=6438

It expunged these messages. So, everything is working I guess?



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 16:18 -0500, Mike Abbott wrote:
> Seems related to maildir_copy_hardlink().  No crashes with 
> maildir_copy_with_hardlinks=no.

This is with v2.0.3 release, not hg? I did some changes already related
to this code in hg.. I'll check 2.0.3 too.




Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
Seems related to maildir_copy_hardlink().  No crashes with 
maildir_copy_with_hardlinks=no.

Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 15:23 -0500, Mike Abbott wrote:
> > I'll try to narrow it down further (nix the search, turn off quotas, etc.).
> 
> imaptest clients=60 user=user\%d pass=test no_tracking logout=25 
> copybox=Copies
> does it too... (no search commands)

What about just:

imaptest clients=10 user=user1 pass=test no_tracking logout=0 copybox=Copies

And if that does it too, what about with clients=1?




Re: [Dovecot] doveadm-expunge debug message clarifications

2010-09-24 Thread LEVAI Daniel
> On Tue, 2010-09-21 at 15:09 +0200, LEVAI Daniel wrote:
[...]
> > doveadm(root): Debug: expire: Searching only users listed in expire database
[...]
> logging that. I fixed in hg so that it now instead logs:
> expire: Iterating only a single user, ignoring expire database
Great!

> > If I don't specify a user with '-u', then nothing gets expunged, so it
> > doesn't get the list of users from the expire database.
> If you don't use -u or -A then it tries to access the current system
> user's mails.
Aha!

> > doveadm(): Error: net_connect_unix(/var/dovecot//dict) failed:
> > Permission denied
> I improved this error message now in hg to show what user doesn't have
> access.
Great!

> > # ls -la /var/dovecot/dict
> > srw--- 1 root wheel 0 Sep 21 09:47:00 2010 /var/dovecot/dict=
> > ..
> > What is trying to use that socket when I'm expunging mails? Am I
> > supposed to grant my internal_user some privileges to that socket?
> > While I got that error message, the expunge has succeeded.
> doveadm tries to access the expire database via the dict socket. You
> didn't really give enough information about what user you're running
> doveadm as or if you're using system or virtual users or.. 
Sorry. I'm running that doveadm command as root, with the -u 
parameter, where  is a virtual user.
Anyway, I've just read the wiki2 again, and noted that I don't really
need the expire plugin, because it is only needed for the -A option. If
I specify the -u parameter, it doesn't utilize the plugin. So I'm now
using only the doveadm expunge -u ... command, which now gives me this
output:

# /usr/local/bin/doveadm -D expunge -u  mailbox sa.* SAVEDBEFORE 1d
doveadm(root): Debug: Loading modules from directory: /usr/local/lib/dovecot
doveadm(root): Debug: Module loaded: 
/usr/local/lib/dovecot/lib10_quota_plugin.so
doveadm(root): Debug: Loading modules from directory: 
/usr/local/lib/dovecot/doveadm
doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() 
failed: Cannot load specified object
^^^ I'm curious about this error message. Is it
safe to ignore this?
doveadm(root): Debug: Module loaded: 
/usr/local/lib/dovecot/doveadm/lib10_doveadm_quota_plugin.so
doveadm(): Debug: expunge: box=sa.spam uid=6435
doveadm(): Debug: expunge: box=sa.spam uid=6436
doveadm(): Debug: expunge: box=sa.spam uid=6437
doveadm(): Debug: expunge: box=sa.spam uid=6438


The only thing I've changed in the config is that I've removed the
expire plugin from the $mail_plugins variable.


Thanks,
Daniel

-- 
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F


Re: [Dovecot] (Single instance) attachment storage with single-dbox

2010-09-24 Thread Charles Marcus
On 2010-09-24 2:57 PM, Timo Sirainen wrote:
> Maybe add some import/export commands to doveadm which can be used to
> add a bunch of mails to storage without doing it directly on filesystem.

+1

I've always just used cp -rp to restore mail, so yeah, if that would
break SiS, I agree there should be a doveadm command for restoring mails.

-- 

Best regards,

Charles


Re: [Dovecot] LDA + Postfix + LDAP + Sieve (Vacation): Wrong Domain in Reply

2010-09-24 Thread Jerry
On Fri, 24 Sep 2010 11:55:57 -0600
Kendall Gifford  articulated:

> Hello everyone.
> 
> I'm running dovecot (1.2.9) with postfix (2.7.0) on an ubuntu 10.04.1.
> I'm hosting mail for several domains and using the dovecot local
> delivery agent. Everything has been working great.
> 
> However, today I set up a sieve script to send out-of-office replies
> (vacation) for one of our users. I tested it and got the response just
> fine. However, when looking at the "From" header of the auto-reply, I
> noticed that the domain name was wrong.
> 
> My postfix master.cf line for doing local delivery is:
> 
> dovecot   unix  -   n   n   -   -   pipe
>   flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender}
> -d ${us...@${nexthop}
> 
> My LDA configuration is:
> 
> protocol lda {
>   postmaster_address = postmas...@our-primary-domain.com
>   hostname = our-primary-domain.com
>   mail_plugins = sieve
>   quota_full_tempfail = yes
>   deliver_log_format = msgid=%m: %$
>   rejection_reason = Your message to <%t> was automatically
> rejected:%n%r }
> 
> So, our main "administrative" domain is: my-primary-domain.com, the
> mail server being mail.my-primary-domain.com. I sent an email to a
> user: jane...@my-other-domain.com and the LDA with Sieve successfully
> sent me a reply. However, the "From" was: jane...@mail instead of
> jane...@my-other-domain.
> 
> According to: http://wiki.dovecot.org/LDA/Sieve#Vacation_auto-reply
> 
> > Vacation uses envelope sender and envelope recipient ... taken from:
> > ...
> >   V 1.1+
> >   ...
> > Envelope recipient: -a parameter to deliver if given, otherwise
> > -d parameter to deliver. If neither is given (delivering to system
> > users), the $USER environment is used.
> 
> Just for kicks I tried changing my master.cf to use -a instead of -d
> but then all mail delivers to user "mail" completely breaking all mail
> delivery. Anyhow, vacation auto-responders are fundamental to
> operations here and we manage mail for several separate companies. We
> need the "From" address to reflect the domain of the actual company.
> I'm stumped as to why sieve isn't getting/using the envelope sender's
> domain. I'm hoping someone here can point out (a hopefully obvious)
> mistake.
> 
> I've attached my four pertinent config files as etc.tgz only slightly
> scrubbed.
> 
> Any help is greatly appreciated.
> 

You would save yourself a lot of trouble, and the results would be more
accurate, if you simply provided output from the postfinger tool. This
can be found at http://ftp.wl0.org/SOURCES/postfinger. This pertains to
Postfix obviously.

For dovecot, the usually excepted method is to use "dovecot -n". You
can pipe the output to a file so you can share it.

-- 
Jerry ✌
dovecot.u...@seibercom.net

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__


Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> I'll try to narrow it down further (nix the search, turn off quotas, etc.).

imaptest clients=60 user=user\%d pass=test no_tracking logout=25 copybox=Copies
does it too... (no search commands)

And it happens with zero mail_plugins everywhere.

But this does not trip that assertion:
imaptest clients=60 user=user\%d pass=test no_tracking logout=25
(no copy commands)

Here's a backtrace:
0   __kill + 10
1   abort + 177
2   default_fatal_finish + 68
3   i_internal_error_handler + 0
4   i_debug + 0
5   maildir_transaction_save_commit_pre + 2585
6   index_transaction_index_commit + 164
7   mail_index_transaction_commit_full + 155
8   index_transaction_commit + 131
9   mailbox_transaction_commit_get_changes + 56
10  cmd_copy + 848 (cmd-copy.c:157)
11  client_command_input + 36 (imap-client.c:687)
12  client_command_input + 416 (imap-client.c:752)
13  client_handle_input + 134 (imap-client.c:793)
14  client_input + 118 (imap-client.c:844)
15  io_loop_handler_run + 234
16  io_loop_run + 56
17  master_service_run + 27
18  main + 689 (main.c:359)
19  start + 52

FWIW I also turned on maintainer mode, but it made no difference.

What else would you like me to try?

Re: [Dovecot] LDA + Postfix + LDAP + Sieve (Vacation): Wrong Domain in Reply

2010-09-24 Thread Cassidy Larson
I'd check your postfix main.cf config for something obvious. My hunch
is that the dovecot process is handing off the reply message to your
MTA with the correct from address (I'm actually using
/usr/sbin/sendmail for outbound mails/replies) and the MTA is
rewriting the from address.

-c

On Fri, Sep 24, 2010 at 11:55 AM, Kendall Gifford  wrote:
> Hello everyone.
>
> I'm running dovecot (1.2.9) with postfix (2.7.0) on an ubuntu 10.04.1.
> I'm hosting mail for several domains and using the dovecot local
> delivery agent. Everything has been working great.
>
> However, today I set up a sieve script to send out-of-office replies
> (vacation) for one of our users. I tested it and got the response just
> fine. However, when looking at the "From" header of the auto-reply, I
> noticed that the domain name was wrong.
>
> My postfix master.cf line for doing local delivery is:
>
> dovecot   unix  -       n       n       -       -       pipe
>  flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender}
> -d ${us...@${nexthop}
>
> My LDA configuration is:
>
> protocol lda {
>  postmaster_address = postmas...@our-primary-domain.com
>  hostname = our-primary-domain.com
>  mail_plugins = sieve
>  quota_full_tempfail = yes
>  deliver_log_format = msgid=%m: %$
>  rejection_reason = Your message to <%t> was automatically rejected:%n%r
> }
>
> So, our main "administrative" domain is: my-primary-domain.com, the
> mail server being mail.my-primary-domain.com. I sent an email to a
> user: jane...@my-other-domain.com and the LDA with Sieve successfully
> sent me a reply. However, the "From" was: jane...@mail instead of
> jane...@my-other-domain.
>
> According to: http://wiki.dovecot.org/LDA/Sieve#Vacation_auto-reply
>
>> Vacation uses envelope sender and envelope recipient ... taken from:
>> ...
>>   V 1.1+
>>   ...
>>     Envelope recipient: -a parameter to deliver if given, otherwise -d 
>> parameter to deliver. If neither is given (delivering to system users), the 
>> $USER environment is used.
>
> Just for kicks I tried changing my master.cf to use -a instead of -d
> but then all mail delivers to user "mail" completely breaking all mail
> delivery. Anyhow, vacation auto-responders are fundamental to
> operations here and we manage mail for several separate companies. We
> need the "From" address to reflect the domain of the actual company.
> I'm stumped as to why sieve isn't getting/using the envelope sender's
> domain. I'm hoping someone here can point out (a hopefully obvious)
> mistake.
>
> I've attached my four pertinent config files as etc.tgz only slightly 
> scrubbed.
>
> Any help is greatly appreciated.
>
> --
> Kendall Gifford
> zettab...@gmail.com
>


Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> imaptest logout=1 clients=4
> imaptest logout=1 user=tss2 box=shared/tss/INBOX clients=4

Yes, I can reproduce this assertion failure:
Panic: file maildir-save.c: line 79 (maildir_file_move): assertion failed: 
(*mf->tmp_name != '\0')
with:
imaptest clients=60 user=user\%d pass=test no_tracking logout=25 search=100 
copybox=Copies

All of the crash backtraces have cmd_copy in common
I'll try to narrow it down further (nix the search, turn off quotas, etc.).



[Dovecot] (Single instance) attachment storage with single-dbox

2010-09-24 Thread Timo Sirainen
Just a note to myself and whoever else cares, should be added to wiki
once it has its own page about this:

With single-dbox messages can be copied with hard linking. This means
that there can be multiple files that point to the same attachment file.
The attachment is now deleted only once the mail file's link count drops
to zero, so this works fine..

..until someone goes and starts manually copying files or maybe
restoring from backups or whatever, causing the hard links to be
replaced with separate files having link count=1, even when there are
other files pointing to the same attachment file. Now deleting this one
mail will delete the attachment too early.

I can't think of any other reasonable way to handle this though, so
unless someon has some great ideas, I think the solution is to simply
add enough warnings that message store shouldn't be accessed directly.
Maybe add some import/export commands to doveadm which can be used to
add a bunch of mails to storage without doing it directly on filesystem.




[Dovecot] LDA + Postfix + LDAP + Sieve (Vacation): Wrong Domain in Reply

2010-09-24 Thread Kendall Gifford
Hello everyone.

I'm running dovecot (1.2.9) with postfix (2.7.0) on an ubuntu 10.04.1.
I'm hosting mail for several domains and using the dovecot local
delivery agent. Everything has been working great.

However, today I set up a sieve script to send out-of-office replies
(vacation) for one of our users. I tested it and got the response just
fine. However, when looking at the "From" header of the auto-reply, I
noticed that the domain name was wrong.

My postfix master.cf line for doing local delivery is:

dovecot   unix  -   n   n   -   -   pipe
  flags=DRhu user=mail:mail argv=/usr/lib/dovecot/deliver -f ${sender}
-d ${us...@${nexthop}

My LDA configuration is:

protocol lda {
  postmaster_address = postmas...@our-primary-domain.com
  hostname = our-primary-domain.com
  mail_plugins = sieve
  quota_full_tempfail = yes
  deliver_log_format = msgid=%m: %$
  rejection_reason = Your message to <%t> was automatically rejected:%n%r
}

So, our main "administrative" domain is: my-primary-domain.com, the
mail server being mail.my-primary-domain.com. I sent an email to a
user: jane...@my-other-domain.com and the LDA with Sieve successfully
sent me a reply. However, the "From" was: jane...@mail instead of
jane...@my-other-domain.

According to: http://wiki.dovecot.org/LDA/Sieve#Vacation_auto-reply

> Vacation uses envelope sender and envelope recipient ... taken from:
> ...
>   V 1.1+
>   ...
> Envelope recipient: -a parameter to deliver if given, otherwise -d 
> parameter to deliver. If neither is given (delivering to system users), the 
> $USER environment is used.

Just for kicks I tried changing my master.cf to use -a instead of -d
but then all mail delivers to user "mail" completely breaking all mail
delivery. Anyhow, vacation auto-responders are fundamental to
operations here and we manage mail for several separate companies. We
need the "From" address to reflect the domain of the actual company.
I'm stumped as to why sieve isn't getting/using the envelope sender's
domain. I'm hoping someone here can point out (a hopefully obvious)
mistake.

I've attached my four pertinent config files as etc.tgz only slightly scrubbed.

Any help is greatly appreciated.

-- 
Kendall Gifford
zettab...@gmail.com


etc.tgz
Description: GNU Zip compressed data


Re: [Dovecot] Trouble creating shared virtual folders

2010-09-24 Thread Timo Sirainen
On Thu, 2010-09-23 at 18:42 +0100, Daniela Silva wrote:

> I've tried to do this with virtual mailboxes, but I had problems with 
> permissions, I removed write permissions from folder "virtual_folders" 

This should work.

> but if I do that dovecot creates "virtual_folders_indexes" without write 
> permissions too, which in this case are needed. 

This sounds like a bug I fixed already. I did a quick test and it worked
ok with me. You didn't mention what Dovecot version you're running.
Maybe it's already fixed.



Re: [Dovecot] IMAP connection timeout value?

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 10:24 +0530, Sherin George wrote:
> Hello,
> 
> I am also in  a similar position.
> 
> I have a server sitting behind hardware firewall which is configured
> to timeout all connections in 30 minutes.
> 
> So, I would like to set dovecot to 30 minutes.

Dovecot never disconnects IDLEing connections, because several clients
expect to be able to do that. But I think you can configure kernel to
send keepalive notifications more often (default is every 2,5h IIRC) and
then it would notice died connections sooner.




Re: [Dovecot] Unsubscribing from public folders

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 10:21 -0700, aditsu wrote:
> 
> Also, you haven't commented on my last phrase: "please let me know the
> best
> way to fix the configuration/subscriptions." Specifically:
> - Should I switch the separator to "."?

Probably would cause just more problems.

> - If I don't, then how to edit the subscription files? Should
> Public-NIB.foo.bar become Public-NIB/foo.bar or Public-NIB/foo/bar?

Public-NIB/foo.bar

>  And what
> about INBOX.foo.bar?

That's ok.

> - Anything else I can do? 

Nope.

The special case here is that Public-NIB/'s subscriptions go to the
parent namespace's subscriptions file. So each entry that belongs to it
must begin with the namespace prefix (Public-NIB/). For everything else
it uses the internal separator, which is always '.'. That allows
changing namespace separator without breaking all subscriptions. (But
changing namespace prefix for subscriptions=no namespace breaks
subscriptions, as has happened with you when changing from "Public-NIB."
to "Public-NIB/".)



Re: [Dovecot] Unsubscribing from public folders

2010-09-24 Thread aditsu


Timo Sirainen wrote:
> 
> I think what happened was that you switched namespace separator from "."
> to "/", which then caused these prefixes to change in subscriptions file
> from Public-NIB.* to Public-NIB/*. It's actually kind of an accident that
> those Public-NIB.* entries in the subscriptions file even work.. It wasn't
> intended to work that way. Subscriptions for subscriptions=no namespaces
> are handled in a bit kludgy way. So, this isn't really a bug. :) Maybe
> some day in future separator changes can be handled better for
> subscriptions=no namespaces..
> 

Well, I don't remember switching any namespace separator, but I may have
done it at some point when switching from Courier to Dovecot. Anyway,
Dovecot 1.1 ran this way for a long time with no issues, only after the
upgrade to 1.2 I noticed the problem.

Also, you haven't commented on my last phrase: "please let me know the best
way to fix the configuration/subscriptions." Specifically:
- Should I switch the separator to "."?
- If I don't, then how to edit the subscription files? Should
Public-NIB.foo.bar become Public-NIB/foo.bar or Public-NIB/foo/bar? And what
about INBOX.foo.bar?
- Anything else I can do?

Thanks
Adrian
-- 
View this message in context: 
http://old.nabble.com/Unsubscribing-from-public-folders-tp29779347p29800810.html
Sent from the Dovecot mailing list archive at Nabble.com.



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 12:07 -0500, Mike Abbott wrote:
> imap(pid 72709 user specmail773): Panic: file maildir-save.c: line 79 
> (maildir_file_move): assertion failed: (*mf->tmp_name != '\0')

I added one more assert, but I doubt that catches this:
http://hg.dovecot.org/dovecot-2.0/rev/c7a5d25dceb6

This really looks like memory corruption, but since it could be anywhere
in the code it's pretty difficult to find where without running via
valgrind or similar.

Can you figure out if you can reproduce it with X features but not with
X-1 features? Like with/without quota enabled, or with/without some IMAP
commands in your tests?




Re: [Dovecot] inbox doesn't exist, and quota calculation error

2010-09-24 Thread Mike Abbott
>> lda(pid 8212 user user3): Error: Opening INBOX failed: Mailbox doesn't 
>> exist: INBOX
>> [...]
>> tag NO Mailbox doesn't exist: INBOX
> 
> For newly created users that don't have the Maildir directory created
> yet?

No, for users who already have their Maildir.

> This is with Maildir++ quota?

Yes.

> Did OSX have valgrind yet?

Dunno.

Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
> So are you saying that this directory was actually created by Dovecot?

Yes.  No migration, no Courier.

> Are these easy to reproduce?

Yes, on my system.  I'll try imaptest.

> user1 is accessing user2's INBOX?


Not intentionally.  User1 and user2 happen to be logged in at the same time and 
were assigned to the same imap process, that's all.  They know nothing about 
each other and there are no namespaces or public folders or any of that.

> Does one of these asserts catch it?

imap(pid 72709 user specmail773): Panic: file maildir-save.c: line 79 
(maildir_file_move): assertion failed: (*mf->tmp_name != '\0')
imap(pid 72770 user specmail52): Panic: file maildir-save.c: line 79 
(maildir_file_move): assertion failed: (*mf->tmp_name != '\0')



Re: [Dovecot] inbox doesn't exist, and quota calculation error

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 10:31 -0500, Mike Abbott wrote:
> Perhaps related to the other errors I just reported, I also see a few of 
> these in the dovecot-2.0.3 logs:
> lda(pid 8212 user user3): Error: Opening INBOX failed: Mailbox doesn't exist: 
> INBOX
> lda(pid 8212 user user3): msgid=<201009240906510365.1gj1fpfhrh...@mail>: save 
> failed to INBOX: Mailbox doesn't exist: INBOX
> lda(pid 8212 user user3): Error: BUG: Saving failed to unknown storage
> 
> and some clients report receiving this IMAP error:
> tag NO Mailbox doesn't exist: INBOX

For newly created users that don't have the Maildir directory created
yet? I guess there could be some race condition there in the initial
INBOX creation.. This is with normal mail_location=maildir:~/Maildir or
something?

> although in general mail delivery and IMAP work, and these users'
> Maildir++ directories do exist and look OK.  This error did not occur
> for the user1 or user2 in the other report.

I think that happens only once and afterwards the INBOX is created and
stuff works ok?

> And here's a third kind of error:
> imap(pid 5722 user user4): Error: stat(/path/to/mail/user4/tmp/ͼ) failed: No 
> such file or directory
> imap(pid 5722 user user4): Error: Internal quota calculation error
> 
> That path looks like a memory munge.

Yeah, it does look like some memory corruption or something. And yeah,
possibly also related to that filename="" bug. This is with Maildir++
quota? Did OSX have valgrind yet (or do you have something equivalent)?



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 16:51 +0100, Timo Sirainen wrote:
> 
> > imap(pid 5720 user user1): Error: 
> > open(/path/to/mail/user2/tmp/1285335855.M242128P1165.my.mail.server,S=41045,W=41755)
> >  failed: No such file or directory
> > imap(pid 5721 user user2): Error: Maildir: Found unwanted directory 
> > /path/to/mail/user2/cur/:2,FST, but rmdir() failed: Directory not empty
> > imap(pid 5721 user user2): Disconnected: Internal error occurred. Refer to 
> > server log for more information. [2010-09-24 09:07:23] bytes=1268/173293
> 
> Oh! Now I get it. The entire tmp/ directory gets renamed to ":2,FST",
> not the new/ directory as I thought. Now, how can that happen..

Does one of these asserts catch it?
http://hg.dovecot.org/dovecot-2.0/rev/c2d50bd35dc4




Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 10:16 -0500, Mike Abbott wrote:
> Hm, I found more revealing errors after sending that message.  These are 
> scrubbed a little differently, to show two user names:

Are these easy to reproduce?

> imap(pid 5720 user user1): Error: 
> open(/path/to/mail/user2/tmp/1285336854.M157825P5720.my.mail.server) failed: 
> No such file or directory

Something deletes a saved/copied message before the transaction
finishes..

> imap(pid 5720 user user1): Error: Maildir: Symlink destination doesn't exist: 
> /path/to/mail/user2/cur/1285336100.M879758P1166.my.mail.server,S=41045,W=41755:2,FS

What? A symlink? Dovecot doesn't create symlinks.

> imap(pid 5720 user user1): Error: 
> open(/path/to/mail/user2/tmp/1285335855.M242128P1165.my.mail.server,S=41045,W=41755)
>  failed: No such file or directory
> imap(pid 5721 user user2): Error: Maildir: Found unwanted directory 
> /path/to/mail/user2/cur/:2,FST, but rmdir() failed: Directory not empty
> imap(pid 5721 user user2): Disconnected: Internal error occurred. Refer to 
> server log for more information. [2010-09-24 09:07:23] bytes=1268/173293

Oh! Now I get it. The entire tmp/ directory gets renamed to ":2,FST",
not the new/ directory as I thought. Now, how can that happen..

> Note that user1 != user2.  

user1 is accessing user2's INBOX? I don't think it should make a
difference though.

> Seems like this might be caused by having:
> service imap {
>   client_limit = 5
>   service_count = 0
> }

I tried with that and e.g.:

imaptest logout=1 clients=4
imaptest logout=1 user=tss2 box=shared/tss/INBOX clients=4

Worked ok without errors in Ubuntu. I could try again on OSX when I get
home.



Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 09:59 -0500, Mike Abbott wrote:

> ./:2,FST:
> total 88
> drwx--  3 vmail  vmail102 Sep 24 09:00 .
> drwx--  8 vmail  vmail272 Sep 24 09:06 ..
> -rw---  5 vmail  vmail  41045 Sep 24 08:44 
> 1285335855.M242128P1165.my.mail.server,S=41045,W=41755
> #
> 
> Dovecot must have created this non-Maildir++-ish directory, but why,
> why in cur/ not tmp/, and why didn't it clean it up?  (Not the
> "Directory not empty" error specifically; I mean in the larger sense.)

I've heard some people having similar directories in cur/ directory..
It's always been with people who have migrated from Courier, so I've
thought that the problem was that they just had accidentally
misconfigured something in the past and just didn't notice those extra
dirs with Courier.

So are you saying that this directory was actually created by Dovecot?
The directory name is ":2,FST" i.e. the base filename is empty. I guess
this could happen if readdir() returns a "" directory entry while
reading new/ and then Dovecot does:

rename(".../new/", ".../cur/:2,")

that's about the only explanation I can think of for this.. I'll add a
check against this anyway just to be sure. :)



Re: [Dovecot] Possible to split message store location?

2010-09-24 Thread Timo Sirainen
On Fri, 2010-09-24 at 15:55 +0200, Pierre wrote:
> Yes, but I'm thinking about putting mails in different places, for instance:
> 
> unread mails are delivered to server1
> read mails go to server2
> old mails go to server3...
> 
> question 1: can we set more than one alternative storage place (cf 
> alternative_storage in dovecot wiki) ?

No.

> question 2: can we split deliver, then ?

New mails are always delivered to primary storage.

Also this works only when using dbox storage format, it won't work for
maildir.




[Dovecot] inbox doesn't exist, and quota calculation error

2010-09-24 Thread Mike Abbott
Perhaps related to the other errors I just reported, I also see a few of these 
in the dovecot-2.0.3 logs:
lda(pid 8212 user user3): Error: Opening INBOX failed: Mailbox doesn't exist: 
INBOX
lda(pid 8212 user user3): msgid=<201009240906510365.1gj1fpfhrh...@mail>: save 
failed to INBOX: Mailbox doesn't exist: INBOX
lda(pid 8212 user user3): Error: BUG: Saving failed to unknown storage

and some clients report receiving this IMAP error:
tag NO Mailbox doesn't exist: INBOX

although in general mail delivery and IMAP work, and these users' Maildir++ 
directories do exist and look OK.  This error did not occur for the user1 or 
user2 in the other report.


And here's a third kind of error:
imap(pid 5722 user user4): Error: stat(/path/to/mail/user4/tmp/ͼ) failed: No 
such file or directory
imap(pid 5722 user user4): Error: Internal quota calculation error

That path looks like a memory munge.

Re: [Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
Hm, I found more revealing errors after sending that message.  These are 
scrubbed a little differently, to show two user names:

imap(pid 5720 user user1): Error: 
open(/path/to/mail/user2/tmp/1285336854.M157825P5720.my.mail.server) failed: No 
such file or directory
imap(pid 5720 user user1): Error: Maildir: Symlink destination doesn't exist: 
/path/to/mail/user2/cur/1285336100.M879758P1166.my.mail.server,S=41045,W=41755:2,FS
imap(pid 5720 user user1): Error: 
open(/path/to/mail/user2/tmp/1285335855.M242128P1165.my.mail.server,S=41045,W=41755)
 failed: No such file or directory
imap(pid 5720 user user1): Error: Maildir: Symlink destination doesn't exist: 
/path/to/mail/user2/cur/1285336337.M656599P1166.my.mail.server,S=41045,W=41755:2,FST
imap(pid 5720 user user1): Error: 
open(/path/to/mail/user2/tmp/1285335855.M242128P1165.my.mail.server,S=41045,W=41755)
 failed: No such file or directory
imap(pid 5720 user user1): Error: Maildir: Symlink destination doesn't exist: 
/path/to/mail/user2/cur/1285336337.M656599P1166.my.mail.server,S=41045,W=41755:2,FST
imap(pid 5720 user user1): Error: 
open(/path/to/mail/user2/tmp/1285335855.M242128P1165.my.mail.server,S=41045,W=41755)
 failed: No such file or directory
imap(pid 5721 user user2): Error: Maildir: Found unwanted directory 
/path/to/mail/user2/cur/:2,FST, but rmdir() failed: Directory not empty
imap(pid 5721 user user2): Disconnected: Internal error occurred. Refer to 
server log for more information. [2010-09-24 09:07:23] bytes=1268/173293

Note that user1 != user2.  Seems like this might be caused by having:
service imap {
  client_limit = 5
  service_count = 0
}

[Dovecot] unwanted maildir directory

2010-09-24 Thread Mike Abbott
Dovecot-2.0.3 reported:

Error: Maildir: Found unwanted directory /path/to/mail/user/cur/:2,FST, but 
rmdir() failed: Directory not empty

and sure enough, this directory really does exist and contain a valid message 
file:

# cd /path/to/mail/user/cur/
# ls -lR
total 384
drwx--   8 vmail  vmail272 Sep 24 09:06 .
drwx--  13 vmail  vmail442 Sep 24 09:06 ..
-rw---   5 vmail  vmail  41045 Sep 24 08:44 
1285336100.M879758P1166.my.mail.server,S=41045,W=41755:2,RST
-rw---   5 vmail  vmail  41045 Sep 24 08:44 
1285336100.M910424P1166.my.mail.server,S=41045,W=41755:2,RST
-rw---   5 vmail  vmail  41045 Sep 24 08:44 
1285336337.M656599P1166.my.mail.server,S=41045,W=41755:2,ST
-rw---   5 vmail  vmail  41045 Sep 24 08:44 
1285336355.M88818P1164.my.mail.server,S=41045,W=41755:2,FS
-rw---   1 vmail  vmail  14953 Sep 24 09:00 
1285336838.M483116P5720.my.mail.server,S=14953,W=15225:2,
drwx--   3 vmail  vmail102 Sep 24 09:00 :2,FST

./:2,FST:
total 88
drwx--  3 vmail  vmail102 Sep 24 09:00 .
drwx--  8 vmail  vmail272 Sep 24 09:06 ..
-rw---  5 vmail  vmail  41045 Sep 24 08:44 
1285335855.M242128P1165.my.mail.server,S=41045,W=41755
#

Dovecot must have created this non-Maildir++-ish directory, but why, why in 
cur/ not tmp/, and why didn't it clean it up?  (Not the "Directory not empty" 
error specifically; I mean in the larger sense.)

Re: [Dovecot] Possible to split message store location?

2010-09-24 Thread Pierre

On 24/sep - 14:55, Patrick Westenberg wrote:
> Pierre schrieb:
>> On 23/sep - 08:17, Patrick Westenberg wrote:
>>> You can set a different maildir (or home location) in your userdb which
>>> points to a different mountpoint.
>>
>> Ok, and then how to get back emails when reading from IMAP, when emails
>> are split in different places ?
>
> It works the same way.
> If a maildir is stored in the userdb and queried from the user_query,
> it overrides the mail_location set in your configuration file.

Yes, but I'm thinking about putting mails in different places, for instance:

unread mails are delivered to server1
read mails go to server2
old mails go to server3...

question 1: can we set more than one alternative storage place (cf 
alternative_storage in dovecot wiki) ?
question 2: can we split deliver, then ?

I read something about replication, but does not feet my needs.
Also, delivering in other places is not a pb, the issue resides in fetching the 
good emails. May I do it using namespaces ? How ?


Re: [Dovecot] Dovecot pop3 segfault problems

2010-09-24 Thread Ken A



On 9/24/2010 5:27 AM, enid vx wrote:


and now, can you respond to Timos request for a backtrace:

On 2010-09-21 10:16 AM, Timo Sirainen  wrote:

Are these coming only from pop3 processes? Are you running imap? It's
anyway difficult to say anything about segfaults without a gdb
backtrace. See http://dovecot.org/bugreport.html how to get one.


--



Hi all,

after the update I noticed that the error messages didn't go away for a
little time. Also seeing the high load and high kernel cpu usage I did some
changes to the /etc/fstab (adding noatime,nodiratime) to /var /home
partitions.
Also the dovecot -n now is like this:
auth_mechanisms = plain login
default_login_user = dovecot
disable_plaintext_auth = no
dotlock_use_excl = yes
mail_access_groups = mail
mail_fsync = never
mail_location = mbox:~/.:INBOX=/var/mail/%u
mmap_disable = yes
passdb {
   driver = pam
}
ssl_cert =

You might try running 'vmstat 2', 'iostat -x', etc..
It sounds to me like a disk i/o problem, but we are just guessing unless 
we know more about the hardware and utilization.
A simple fix might be to add a fast local drive and move /var/mail to 
it's own spindle, assuming you don't have this configuration already.


Ken



Again thank you for your support.
Enid



--
Ken Anderson
Pacific Internet - http://www.pacific.net


Re: [Dovecot] Possible to split message store location?

2010-09-24 Thread Patrick Westenberg

Pierre schrieb:

On 23/sep - 08:17, Patrick Westenberg wrote:

You can set a different maildir (or home location) in your userdb which
points to a different mountpoint.


Ok, and then how to get back emails when reading from IMAP, when emails
are split in different places ?


It works the same way.
If a maildir is stored in the userdb and queried from the user_query,
it overrides the mail_location set in your configuration file.


Re: [Dovecot] Possible to split message store location?

2010-09-24 Thread Pierre


On 23/sep - 08:17, Patrick Westenberg wrote:
> 
> On Wed, 22 Sep 2010 23:03:58 -0400, Edward Carraro 
> wrote:
> 
> > This could lead to a possible bottleneck eventually and we were wondering
> > if
> > it's possible to have dovecot
> > direct x number of users to one message store location while others get
> > their mail on a different mount?
> 
> You can set a different maildir (or home location) in your userdb which
> points to a different mountpoint.

Ok, and then how to get back emails when reading from IMAP, when emails
are split in different places ?


Re: [Dovecot] Dovecot pop3 segfault problems

2010-09-24 Thread Charles Marcus
On 2010-09-24 6:27 AM, enid vx wrote:
> I see that for about 2-3 days now the error has gone away, and
> dovecot is running ok, but the high load is continually present, and
> I suspect of disk I/O latency.

So, any stats on how busy your server is? Dovecot is very efficient -
much more so at least than Courier-imap. Many people report both a huge
increase in speed and huge decrease in server load after upgrading from
it. My servers aren't very busy so I only noticed the huge increase in
performance...

-- 

Best regards,

Charles


Re: [Dovecot] Dovecot pop3 segfault problems

2010-09-24 Thread enid vx
>
> and now, can you respond to Timos request for a backtrace:
>
> On 2010-09-21 10:16 AM, Timo Sirainen  wrote:
> > Are these coming only from pop3 processes? Are you running imap? It's
> > anyway difficult to say anything about segfaults without a gdb
> > backtrace. See http://dovecot.org/bugreport.html how to get one.
>
> --
>
>
Hi all,

after the update I noticed that the error messages didn't go away for a
little time. Also seeing the high load and high kernel cpu usage I did some
changes to the /etc/fstab (adding noatime,nodiratime) to /var /home
partitions.
Also the dovecot -n now is like this:
auth_mechanisms = plain login
default_login_user = dovecot
disable_plaintext_auth = no
dotlock_use_excl = yes
mail_access_groups = mail
mail_fsync = never
mail_location = mbox:~/.:INBOX=/var/mail/%u
mmap_disable = yes
passdb {
  driver = pam
}
ssl_cert = 

Re: [Dovecot] dovecot+sieve redirect action signal 11 while user homedir not defined

2010-09-24 Thread Maciej Uhlig

On 2010-09-23 17:08, Timo Sirainen wrote:

On Thu, 2010-09-23 at 15:33 +0100, Timo Sirainen wrote:
   

On Thu, 2010-09-23 at 15:00 +0200, Maciej Uhlig wrote:
 

2010-09-23T09:25:23+02:00 st1/192.168.10.201 dovecot: [ID 583609
mail.error] master: Error: service(lmtp): child 15524 killed with signal
11 (core not dumped)

in case user home directory is (erroneously) undefined.
   

I can't reproduce this.
 

Stephan suggested this is probably because of duplicate database. This
probably fixes it: http://hg.dovecot.org/dovecot-2.0/rev/75e466740c57
   


Yes, this fixed the issue.  Thank you Timo and Stephan :-)