macros

2014-07-11 Thread Arkadiusz Miśkiewicz

Does dovecot support any form of macros? I would like to share configuration 
file between several servers. Configs are different only in tiny aspects.

Somethine like:

dovecot-server.conf (different on each server):

%define ID 55
%define SOMETHING SELECT FROM * WHERE something
%define MECHANISMS digest-md5

dovecot-main.conf (common, shared config)
!include dovecot-server.conf

user_query = ${SOMETHING} AND id=${ID}

auth_mechanisms = plain login ${MECHANISMS}

etc

-- 
Arkadiusz Miśkiewicz, arekm / maven.pl


Re: Fatal: master: service(imap): child 20258 killed with signal 6 (core not dumped - set service imap { drop_priv_before_exec=yes })

2014-07-11 Thread Nick Edwards
On 7/11/14, CJ Keist cj.ke...@colostate.edu wrote:
 see inlines, its what we needed, we found dovecots default is great -
for SOHO, but hopeless for ISP size  use which is what you need, I
wish Timo would include a conf file for large organisations, by
defaults we had issues same as you all limits way too low



 service auth {
 client_limit = 2248   -
unix_listener /var/lib/postfix/private/auth {
  mode = 0666
}
unix_listener auth-userdb {
  group = postfix
  mode = 0666
  user = postfix
}
user = root
 }



 service imap-login {
   process_limit = 1024  --
inet_listener imap {
  port = 143
}
inet_listener imaps {
  port = 993
  ssl = yes
}
 }
 service pop3-login {
   process_limit = 1024  
inet_listener pop3 {
  port = 110
}
inet_listener pop3s {
  port = 995
  ssl = yes
}
 }
 ssl_cert = /userM/mail-services/dovecot/etc/ssl/dovecot.pem
 ssl_key = /userM/mail-services/dovecot/etc/ssl/privkey.pem
 userdb {
args = blocking=yes
driver = passwd
 }
 protocol imap {
process_limit = 1024 --  (and bigger for pop3 but pop3 is
more popular here)

mail_max_userip_connections = 50
 }

service anvil {
client_limit = 2251
}



 protocol lda {
mail_plugins = sieve
 }


 --
 C. J. Keist Email: cj.ke...@colostate.edu
 Systems Group Manager   Solaris 10 OS (SAI)
 Engineering Network ServicesPhone: 970-491-0630
 College of Engineering, CSU Fax:   970-491-5569
 Ft. Collins, CO 80523-1301

 All I want is a chance to prove 'Money can't buy happiness'



Re: Differences in Delivered-To header between deliver and LMTP

2014-07-11 Thread Charles Marcus

On 7/10/2014 11:29 AM, Timo Sirainen t...@iki.fi wrote:

On 9.7.2014, at 21.20, Jeff Rice j...@jrice.me wrote:


I'm transitioning my server over from using the deliver LDA and LMTP.  Suddenly 
a bunch of sieve filters stopped working, and I noticed the contents of the 
Delivered-To header are different.

Using Dovecot's deliver LDA, the contents are a bare email address (f...@bar.com).  
Using Dovecot LMTP, they are in brackets (f...@bar.com).  Is there a reason 
why this isn't consistent between the two delivery agents?  It seems like it ought to 
be.

Oh, that's annoying. Dovecot LDA doesn't actually add this header, it was your 
MTA that added it. But looks like I hadn't checked what the MTAs actually write 
to the header when I added this feature to LMTP, and nobody had mentioned this 
before either. I wonder if anybody's system breaks if I just change it now..


If you do this Timo, would you please also consider going ahead and 
adding the 20 or so lines of code you said it would take to also add 
support for the x-original-to header (this specific was in a private 
email to me while our support contract was active), as we discussed on 
this list - and you then discussed with Wietse, back in April or so of 2012:


http://dovecot.org/list/dovecot/2012-April/082585.html

Thanks!

Charles


Re: Fatal: master: service(imap): child 20258 killed with signal 6 (core not dumped - set service imap { drop_priv_before_exec=yes })

2014-07-11 Thread CJ Keist

Thank you.  I will try these settings out and give 2.2 one more shot.


On 7/11/2014 2:04 AM, Nick Edwards wrote:

On 7/11/14, CJ Keist cj.ke...@colostate.edu wrote:
  see inlines, its what we needed, we found dovecots default is great -
for SOHO, but hopeless for ISP size  use which is what you need, I
wish Timo would include a conf file for large organisations, by
defaults we had issues same as you all limits way too low




service auth {

  client_limit = 2248   -

unix_listener /var/lib/postfix/private/auth {
  mode = 0666
}
unix_listener auth-userdb {
  group = postfix
  mode = 0666
  user = postfix
}
user = root
}





service imap-login {

process_limit = 1024  --

inet_listener imap {
  port = 143
}
inet_listener imaps {
  port = 993
  ssl = yes
}
}
service pop3-login {

process_limit = 1024  

inet_listener pop3 {
  port = 110
}
inet_listener pop3s {
  port = 995
  ssl = yes
}
}
ssl_cert = /userM/mail-services/dovecot/etc/ssl/dovecot.pem
ssl_key = /userM/mail-services/dovecot/etc/ssl/privkey.pem
userdb {
args = blocking=yes
driver = passwd
}
protocol imap {

 process_limit = 1024 --  (and bigger for pop3 but pop3 is
more popular here)


mail_max_userip_connections = 50
}


service anvil {
 client_limit = 2251
}




protocol lda {
mail_plugins = sieve
}


--
C. J. Keist Email: cj.ke...@colostate.edu
Systems Group Manager   Solaris 10 OS (SAI)
Engineering Network ServicesPhone: 970-491-0630
College of Engineering, CSU Fax:   970-491-5569
Ft. Collins, CO 80523-1301

All I want is a chance to prove 'Money can't buy happiness'



--
C. J. Keist Email: cj.ke...@colostate.edu
Systems Group Manager   Solaris 10 OS (SAI)
Engineering Network ServicesPhone: 970-491-0630
College of Engineering, CSU Fax:   970-491-5569
Ft. Collins, CO 80523-1301

All I want is a chance to prove 'Money can't buy happiness'


1.2.4 disk full errors

2014-07-11 Thread Iain Hallam
Hi.

A user on a rather old mail system we have filled their disk space,
and Dovecot has started to give lots of errors in the logs about
Expunged message reappeared and Duplicate file entry. The user can
only see a few new messages, not the 33,551 in their inbox.

In the TODO file in the current source code[1], Timo notes that (line 147):

maildir: out-of-disk-space failures apparently cause all kinds of
problems, e.g. Expunged message reappeared, Duplicate file entry?

[1] http://hg.dovecot.org/dovecot-2.2/file/c55c660d6e9d/TODO

Does anyone know what's happening with Dovecot here and how to recover
so that this user can see mail again?

Unforuntately we're on a very old version, 1.2.4. Though there is a
plan for migrating to a newer platform, I need to get this user
accessing email again rather more urgently.

Thanks,

Iain Hallam.


Re: 1.2.4 disk full errors

2014-07-11 Thread Maarten Bezemer


On Fri, 11 Jul 2014, Iain Hallam wrote:


maildir: out-of-disk-space failures apparently cause all kinds of
problems, e.g. Expunged message reappeared, Duplicate file entry?

Does anyone know what's happening with Dovecot here and how to recover
so that this user can see mail again?


Assuming you use Maildir format for storing this user's mails, based on 
your quote of the maildir todo message...


If you manage to add extra disk space, and access to mail is more 
important than e.g. losing message flags etc., then I'd say you can remove 
the dovecot.index / cache files for the maildirs affected. These would be 
regenerated the next time dovecot accesses the maildir. Could take a while 
tho, for that amount of mails..



HTH..

--
Maarten


Replication on dovecot 2.0

2014-07-11 Thread Tom Barber(Alabs)

Hi Guys

I'm running an Ubuntu 12.04 LTS server and not being particually 
inclined to upgrade I'm wondering what options I have for replication as 
it appears to be running dovecot 2.0.19.


I saw the wiki page about replication and whilst it says you should use 
2.2+ it doesn't say what the minimum requirements are, so I tried doing 
what it says but I get:


Fatal: Plugin 'replication' not found from directory 
/usr/lib/dovecot/modules


Any ideas or tips.

Thanks

Tom


Re: Replication on dovecot 2.0

2014-07-11 Thread Robert Schetterer
Am 11.07.2014 18:05, schrieb Tom Barber(Alabs):
 Hi Guys
 
 I'm running an Ubuntu 12.04 LTS server and not being particually
 inclined to upgrade I'm wondering what options I have for replication as
 it appears to be running dovecot 2.0.19.
 
 I saw the wiki page about replication and whilst it says you should use
 2.2+ it doesn't say what the minimum requirements are, so I tried doing
 what it says but I get:
 
 Fatal: Plugin 'replication' not found from directory
 /usr/lib/dovecot/modules
 
 Any ideas or tips.

don t waste time go Ubuntu 14.04 LTS

http://packages.ubuntu.com/trusty/dovecot-core
vers 2.2.9

or recompile/install/upgrade yourself from

http://wiki2.dovecot.org/PrebuiltBinaries#Automatically_Built_Packages
deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.2 main

https://sys4.de/de/blog/2013/06/17/dovecot-patching-mit-debian-und-ubuntu/
( sorry german only )

 
 Thanks
 
 Tom



Best Regards
MfG Robert Schetterer

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


Re: Replication on dovecot 2.0

2014-07-11 Thread Tom Barber(Alabs)

Fair enough, thanks :)



On 11/07/14 17:13, Robert Schetterer wrote:

Am 11.07.2014 18:05, schrieb Tom Barber(Alabs):

Hi Guys

I'm running an Ubuntu 12.04 LTS server and not being particually
inclined to upgrade I'm wondering what options I have for replication as
it appears to be running dovecot 2.0.19.

I saw the wiki page about replication and whilst it says you should use
2.2+ it doesn't say what the minimum requirements are, so I tried doing
what it says but I get:

Fatal: Plugin 'replication' not found from directory
/usr/lib/dovecot/modules

Any ideas or tips.

don t waste time go Ubuntu 14.04 LTS

http://packages.ubuntu.com/trusty/dovecot-core
vers 2.2.9

or recompile/install/upgrade yourself from

http://wiki2.dovecot.org/PrebuiltBinaries#Automatically_Built_Packages
deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.2 main

https://sys4.de/de/blog/2013/06/17/dovecot-patching-mit-debian-und-ubuntu/
( sorry german only )


Thanks

Tom



Best Regards
MfG Robert Schetterer



Re: Fatal: master: service(imap): child 20258 killed with signal 6 (core not dumped - set service imap { drop_priv_before_exec=yes })

2014-07-11 Thread Timo Sirainen
Find the first error/warning that Dovecot logs, which should happen just before 
you reach the limit.

On 10.7.2014, at 21.33, CJ Keist cj.ke...@colostate.edu wrote:

 It's not fixed. Now the limit looks to be around 500 processes and we start 
 to get number of connections exceeded.  Any ideas?
 
 
 
 On 7/10/14, 10:35 AM, CJ Keist wrote:
 I fixed this issue about the process limit in the 10-master.conf file:
 
 default_process_limit = 5000
 default_client_limit = 3
 
 
 On 7/10/14, 10:03 AM, CJ Keist wrote:
 It looks like on the system that once we hit around 200 imap processes
 it stops there and no more imap processes can be created.  Is there a
 number of max imap processes in the config file somewhere.  By the way
 running on OmniOS:
 
 SunOS mail2 5.11 omnios-6de5e81 i86pc i386 i86pc
 
 
 
 On 7/10/14, 9:50 AM, CJ Keist wrote:
 Thanks for the reply. I have seen threads about setting the
 mail_max_userip_connections, I have set this to 5000 and still people
 getting the exceeding connections errorl
 
 
 root@mail2:/userM/mail-services/dovecot/sbin# ./dovecot -n
 # 2.2.13: /userM/mail-services/dovecot/etc/dovecot/dovecot.conf
 # OS: SunOS 5.11 i86pc
 auth_failure_delay = 5 secs
 auth_mechanisms = plain login cram-md5
 auth_worker_max_count = 3000
 base_dir = /userM/mail-services/dovecot/var/run/dovecot/
 disable_plaintext_auth = no
 hostname = mail2.engr.colostate.edu
 managesieve_notify_capability = mailto
 managesieve_sieve_capability = fileinto reject envelope
 encoded-character vacation subaddress comparator-i;ascii-numeric
 relational regex imap4flags copy include variables body enotify
 environment mailbox date ihave duplicate
 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 =
 }
 passdb {
   driver = pam
 }
 passdb {
   driver = passwd
 }
 postmaster_address = c...@engr.colostate.edu
 service auth {
   unix_listener /var/lib/postfix/private/auth {
 mode = 0666
   }
   unix_listener auth-userdb {
 group = postfix
 mode = 0666
 user = postfix
   }
   user = root
 }
 service imap-login {
   inet_listener imap {
 port = 143
   }
   inet_listener imaps {
 port = 993
 ssl = yes
   }
 }
 service pop3-login {
   inet_listener pop3 {
 port = 110
   }
   inet_listener pop3s {
 port = 995
 ssl = yes
   }
 }
 ssl_cert = /userM/mail-services/dovecot/etc/ssl/dovecot.pem
 ssl_key = /userM/mail-services/dovecot/etc/ssl/privkey.pem
 userdb {
   args = blocking=yes
   driver = passwd
 }
 protocol imap {
   mail_max_userip_connections = 5000
 }
 protocol lda {
   mail_plugins = sieve
 }
 
 
 On 7/10/14, 9:45 AM, Reindl Harald wrote:
 
 
 Am 10.07.2014 17:32, schrieb CJ Keist:
 Another problem is people are getting error message from their
 clients stating
 they have exceeded their number of connections.
 
 mail_max_userip_connections = 50
 
 well, how much folders do the have
 
 keep in mind that fpr IDLE you have one connection per user and folder
 10 users with 10 folders behind the same NAT router are 100 connections
 from the same IP
 
 On 7/10/14, 9:09 AM, CJ Keist wrote:
 Added info:  These errors seem to come from users using mbox format.
 
 
 On 7/10/14, 9:04 AM, CJ Keist wrote:
 All,
Just move our mail servers over to a new mail server running
 postfix
 2.11.1 and dovecot 2.2.13 and getting the subject line errors in my
 /var/adm/files.  People are complaining of loosing their
 connections to
 the mail server.
 
 I've been able to google this error but haven't found fix for this
 yet.
   NOt sure where to put the drop-priv option in the config files
 either.
 
 Any suggestions?
 
 Var adm message:
 Jul 10 08:54:29 mail2 dovecot: [ID 583609 mail.crit] imap(chen):
 Fatal:
 master: service(imap): child 20258 killed with signal 6 (core not
 dumped
 - set service imap { drop_priv_before_exec=yes })
 
 Here is config output:
 
 root@mail2:/userM/mail-services/dovecot/sbin# ./dovecot -n
 # 2.2.13: /userM/mail-services/dovecot/etc/dovecot/dovecot.conf
 # OS: SunOS 5.11 i86pc
 auth_failure_delay = 5 secs
 auth_mechanisms = plain login cram-md5
 auth_worker_max_count = 300
 base_dir = /userM/mail-services/dovecot/var/run/dovecot/
 disable_plaintext_auth = no
 hostname = mail2.engr.colostate.edu
 managesieve_notify_capability = mailto
 managesieve_sieve_capability = fileinto reject envelope
 encoded-character vacation subaddress comparator-i;ascii-numeric
 relational regex imap4flags copy include variables body enotify
 environment mailbox date ihave duplicate
 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 

Re: BUG: Authentication client sent unknown handshake command

2014-07-11 Thread Lukas Haase
Hi Timo,

Thank you very much. I really appreciate your response!

I have indeed a non-default socket config because I also let exim4
authenticate against it. So I I am not really able to remove the config.

What makes me wonder is that the problem just appeared recently. I think
I have the config running for 2 years now or so.

I provide doveconf -n in any case, maybe you can spot an issue?

Thanks, Luke

# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-openvz-042stab090.2-amd64 i686 Debian 7.5
auth_mechanisms = plain login
auth_verbose = yes
log_timestamp = %Y-%m-%d %H:%M:%S 
mail_location = maildir:~/Maildir
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date ihave imapflags
namespace {
  hidden = yes
  inbox = no
  list = no
  location = maildir:~/Maildir-root
  prefix =
  separator = .
  subscriptions = yes
  type = private
}
namespace {
  inbox = yes
  location = maildir:~/Maildir
  prefix = INBOX.
  separator = .
  subscriptions = yes
  type = private
}
namespace {
  hidden = no
  inbox = no
  list = yes
  location = maildir:/var/mail/public:INDEX=~/Maildir/public
  prefix = Public.
  separator = .
  subscriptions = no
  type = public
}
namespace {
  hidden = no
  inbox = no
  list = yes
  location = maildir:/var/mail/shared:INDEX=~/Maildir/shared:LAYOUT=fs
  prefix = Shared.
  separator = .
  subscriptions = no
  type = public
}
passdb {
  args = /etc/dovecot/%Ls.passwd
  driver = passwd-file
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
passdb {
  args = failure_show_msg=yes dovecotp
  driver = pam
}
plugin {
  acl = vfile
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_extensions = +imapflags
  sieve_global_path = /etc/dovecot/default.sieve
}
protocols = sieve imap
service auth {
  unix_listener auth-client {
mode = 0666
  }
  user = root
}
service imap-login {
  inet_listener imap {
port = 0
  }
}
service imap {
  executable = /usr/local/sbin/dovecot-imap-fix
}
ssl_ca = /etc/ssl/sub.class1.server.ca.crt
ssl_cert = /etc/ssl/mail.crt
ssl_key = /etc/ssl/mail.key
userdb {
  driver = prefetch
}
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 15
  mail_plugins = acl
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
  hostname = mail.intra.local
  mail_plugins = sieve
  postmaster_address = postmaster@intra.local
}



On 2014-07-10 8:23, Timo Sirainen wrote:
 You have misconfigured Dovecot's auth sockets. Providing doveconf -n
 output would help figuring out the problem. Or just delete all the
 auth-related socket settings from config files and it should work.
 
 On 9.7.2014, at 0.03, Lukas Haase lukasha...@gmx.at wrote:
 
 May I gently push this? The string BUG: Authentication client
 sent unknown handshake command comes from dovecot (presumably it's
 in the source code) so I think it shouldn't be too mysterious
 what's happening here.
 
 Thank you, Luke
 
 On 2014-07-03 19:10, Lukas Haase wrote:
 Hi,
 
 Some time ago my dovecot started to become BUGgy: Evertime I
 restart the system, dovecot is started but I cannot login. I see
 the following information in the logs:
 
 Jul  4 04:04:36 mail dovecot: auth: 
 passwd-file(user,127.11.91.218,nfkQjFT9vwCADFra): no passwd
 file: /etc/dovecot/imap.passwd Jul  4 04:04:36 mail dovecot:
 auth: Error: BUG: Authentication client sent unknown handshake
 command: 
 REQUEST?1183186945?20438?1?a8c7241e7b0778f9f0125da760cd16fa Jul
 4 04:04:36 mail dovecot: imap: Error: Authentication server
 didn't send valid SPID as expected: MECH#011PLAIN#011plaintext 
 Jul  4 04:04:36 mail dovecot: imap: Error: Disconnected from
 auth server, aborting (client-pid=20438 client-id=1) Jul  4
 04:04:36 mail dovecot: imap-login: Internal login failure 
 (pid=20438 id=1) (internal failure, 1 succesful auths):
 user=user, method=PLAIN, rip=127.11.91.218, lip=73.82.101.172,
 mpid=20439, TLS, session=nfkQjFT9vwCADFra
 
 It does not help to restart the client. But when I then restart
 the server service dovecot restart it works again.
 
 But this is very dangerous because the server might reboot and I
 might not immideately have the chance to restart dovecot
 manually.
 
 What's going on here?
 
 mail:/# uname -a Linux mail 2.6.32-openvz-042stab090.2-amd64 #1
 SMP Sat Jun 21 00:22:42 MSK 2014 i686 GNU/Linux mail:/# dovecot
 --version 2.1.7
 
 Thanks, Luke