Re: no login with MySQL

2015-09-13 Thread Andreas Meyer


Benny Pedersen  schrieb am 14.09.15 um 01:17:17 Uhr:

> Andreas Meyer skrev den 2015-09-13 22:52:
> 
> > Don't understand it.
> 
> in mysql shell you self need to expand %u
> 
> since there is possible no user email that is %u

Yes, of course. Too much stress today.

But I solved my problems with mysql, auth, dovecot_lda
and postfix deferred mail by just setting
mail_home = /var/spool/vhosts/%d/%n
in dovecot.conf again.

And the old queries work again. Now is bedtime.
Thank you everybody!

  Andreas


Re: no login with MySQL

2015-09-13 Thread Benny Pedersen

Andreas Meyer skrev den 2015-09-13 22:52:


Don't understand it.


in mysql shell you self need to expand %u

since there is possible no user email that is %u

:-)


Re: no login with MySQL

2015-09-13 Thread Tobias Franzén

On 2015-09-13 22:52, Andreas Meyer wrote:

Christian Kivalo  schrieb am 13.09.15 um 22:08:04 Uhr:


I think the query-string für MySQL would overwrite this mail_location,
right? But how do I define it in the query?

yes thats how it should work but your query (looking at the query result
from your first email) overwrites the mail_location with
"/var/spool/vhosts/nimmini.de/" without a username.


With my setup "mail" and "home" is returned from the userdb query from
mysql

home: /srv/mail/%u
mail: /srv/mail/%u/Maildir

The query-strings for virtual users look like this:

password_query = SELECT username AS username, password FROM mailbox
WHERE username = '%u' AND active = 1
user_query = SELECT maildir, uid, gid, concat('*:storage=', quota) AS
quota_rule, concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM
mailbox WHERE username = '%u'

what about
user_query = SELECT CONCAT(maildir, SUBSTRING_INDEX(username,'@',+1)) as
mail, uid, gid, concat('*:storage=', quota) AS quota_rule,
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE
username = '%u'

With this query above I can login again with Roundcube and claws-mail but
with the mysql-client I get:

mysql> SELECT CONCAT(maildir, SUBSTRING_INDEX(username,'@',+1)) as mail, uid, 
gid, concat('*:storage=', quota) AS quota_rule, concat('Trash:storage=+', 
quota_trash) AS quota_rule2 FROM mailbox WHERE username = '%u';
Empty set (0,00 sec)

This is my old query with wich I couldn't log in.
mysql> SELECT maildir, uid, gid, concat('*:storage=', quota) AS quota_rule, 
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE username 
= '%u';
Empty set (0,00 sec)


The SUBSTRING_INDEX returns everything left of the '@' from field
username, that should give you something like

+--+--+--+---++
| mail | uid  | gid  | quota_rule
| quota_rule2|
+--+--+--+---++
| /var/spool/vhosts/nimmini.de/a.meyer | 5000 | 5000 | *:storage=5242880
| Trash:storage=+100 |
+--+--+--+---++

which hopefully is the path to your maildir.

I get am Emty set

Don't understand it.

   Andreas


Hi Andreas,

Make sure to return a "home" attribute, and only optionally a "mail" 
attribute, from your SQL user query.


Your "home" attribute for user "a.me...@nimmini.de" should return 
"/var/spool/vhosts/nimmini.de/a.meyer", and only if you want to override 
the global mail_location specify a "mail" attribute to return something 
like "maildir:/var/spool/vhosts/nimmini.de/a.meyer/Maildir". There is no 
"maildir" attribute used from the SQL query, to my knowledge.


If you want to have the maildir stored directly in the user's home 
folder, e.g. "/var/spool/vhosts/nimmini.de/a.meyer", and your global 
mail_location already is "maildir:~/", then you only need to return a 
proper "home" attribute from SQL.


BR
Tobias


Re: no login with MySQL

2015-09-13 Thread Andreas Meyer
Christian Kivalo  schrieb am 13.09.15 um 22:08:04 Uhr:

> > I think the query-string für MySQL would overwrite this mail_location,
> > right? But how do I define it in the query?
> 
> yes thats how it should work but your query (looking at the query result 
> from your first email) overwrites the mail_location with 
> "/var/spool/vhosts/nimmini.de/" without a username.
> 
> >> With my setup "mail" and "home" is returned from the userdb query from
> >> mysql
> >> 
> >> home: /srv/mail/%u
> >> mail: /srv/mail/%u/Maildir
> > 
> > The query-strings for virtual users look like this:
> > 
> > password_query = SELECT username AS username, password FROM mailbox
> > WHERE username = '%u' AND active = 1
> > user_query = SELECT maildir, uid, gid, concat('*:storage=', quota) AS
> > quota_rule, concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM
> > mailbox WHERE username = '%u'
> 
> what about
> user_query = SELECT CONCAT(maildir, SUBSTRING_INDEX(username,'@',+1)) as 
> mail, uid, gid, concat('*:storage=', quota) AS quota_rule, 
> concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE 
> username = '%u'

With this query above I can login again with Roundcube and claws-mail but
with the mysql-client I get:

mysql> SELECT CONCAT(maildir, SUBSTRING_INDEX(username,'@',+1)) as mail, uid, 
gid, concat('*:storage=', quota) AS quota_rule, concat('Trash:storage=+', 
quota_trash) AS quota_rule2 FROM mailbox WHERE username = '%u';
Empty set (0,00 sec)

This is my old query with wich I couldn't log in.
mysql> SELECT maildir, uid, gid, concat('*:storage=', quota) AS quota_rule, 
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE 
username = '%u';
Empty set (0,00 sec)

> 
> The SUBSTRING_INDEX returns everything left of the '@' from field 
> username, that should give you something like
> 
> +--+--+--+---++
> | mail | uid  | gid  | quota_rule
> | quota_rule2|
> +--+--+--+---++
> | /var/spool/vhosts/nimmini.de/a.meyer | 5000 | 5000 | *:storage=5242880 
> | Trash:storage=+100 |
> +--+--+--+---++
> 
> which hopefully is the path to your maildir.

I get am Emty set

Don't understand it.

  Andreas


Re: no login with MySQL

2015-09-13 Thread Christian Kivalo



On 2015-09-13 21:05, Andreas Meyer wrote:

Hello!

Christian Kivalo  schrieb am 13.09.15 um 19:51:38 
Uhr:



> Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: user
> a.me...@nimmini.de: Initialization failed: Namespace '': Home
> directory not set for user. Can't expand ~/ for mail root dir in: ~/
> Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: Invalid user
> settings. Refer to server log for more information.

i see an error here "Error: Invalid user settings" relating to the 
users

mail_location direcory.

Is "mail_location" (and not so important "mail_home") defined?


In dovecot.conf mail_location = maildir:~/ is set. This works with
the system-users defined in the passwd file.

I think the query-string für MySQL would overwrite this mail_location,
right? But how do I define it in the query?


yes thats how it should work but your query (looking at the query result 
from your first email) overwrites the mail_location with 
"/var/spool/vhosts/nimmini.de/" without a username.



With my setup "mail" and "home" is returned from the userdb query from
mysql

home: /srv/mail/%u
mail: /srv/mail/%u/Maildir


The query-strings for virtual users look like this:

password_query = SELECT username AS username, password FROM mailbox
WHERE username = '%u' AND active = 1
user_query = SELECT maildir, uid, gid, concat('*:storage=', quota) AS
quota_rule, concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM
mailbox WHERE username = '%u'


what about
user_query = SELECT CONCAT(maildir, SUBSTRING_INDEX(username,'@',+1)) as 
mail, uid, gid, concat('*:storage=', quota) AS quota_rule, 
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE 
username = '%u'


The SUBSTRING_INDEX returns everything left of the '@' from field 
username, that should give you something like


+--+--+--+---++
| mail | uid  | gid  | quota_rule
| quota_rule2|

+--+--+--+---++
| /var/spool/vhosts/nimmini.de/a.meyer | 5000 | 5000 | *:storage=5242880 
| Trash:storage=+100 |

+--+--+--+---++

which hopefully is the path to your maildir.

There is no mail_loation defined. I thought if maildir is queried, the 
%u
would expand to the mail_location of the user. Where the users only 
with

the local part of the address exist in the filesystem.


I don't know a setting called "maildir" dovecot expects a field "mail" 
to be returned by your sql query or uses the default one (set in 
10-mail.conf).


maybe even this works, but it too will only return the path without the 
username
user_query = SELECT maildir AS mail, uid, gid, concat('*:storage=', 
quota) AS quota_rule, concat('Trash:storage=+', quota_trash) AS 
quota_rule2 FROM mailbox WHERE username = '%u'


%u is the user@domain username
%n is the username without the @domain part


/var/spool/vhosts/nimmini.de/a.meyer

whereas /var/spool/vhosts is a symlink to /home/vhosts.

This setup worked fine sometime ago and I wanted to reactivate MySQL
for dovecot. Now the query doesn't work anymore, the location seems
to be invalid.

location=maildir:~/
instead of
/var/spool/vhosts/nimmini.de/%u.


> Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Namespace inbox:
> type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes,
> subscriptions=yes location=maildir:~/

on one of my accounts this same line looks like this:
imap(a...@kivalo.at): Debug: Namespace inbox: type=private, prefix=,
sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
location=maildir:/srv/mail/a...@kivalo.at/Maildir:LAYOUT=fs

where location is the "mail_location" setting from 10-mail.conf and is
overridden by the userdb from sql for every user.

it's probably enough to set the option mail_location in 10-mail.conf 
to

an absolute path.


I cannot set the absolute path in mail_location, because I have
systemusers and virtual users.

Don't know how to set mail_location in the query-string for MySQL,
if the expandation of %u is not enough. %u would expand to the full
address a.me...@nimmini.de whereas the location looks like
/var/spool/vhosts/nimmini.de/a.meyer



Don't know what to do.

Regards

  Andreas


- christian


Re: no login with MySQL

2015-09-13 Thread Andreas Meyer
Hello!

Christian Kivalo  schrieb am 13.09.15 um 19:51:38 Uhr:

> > Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: user
> > a.me...@nimmini.de: Initialization failed: Namespace '': Home
> > directory not set for user. Can't expand ~/ for mail root dir in: ~/
> > Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: Invalid user
> > settings. Refer to server log for more information.
> 
> i see an error here "Error: Invalid user settings" relating to the users 
> mail_location direcory.
> 
> Is "mail_location" (and not so important "mail_home") defined?

In dovecot.conf mail_location = maildir:~/ is set. This works with
the system-users defined in the passwd file.

I think the query-string für MySQL would overwrite this mail_location,
right? But how do I define it in the query?

> With my setup "mail" and "home" is returned from the userdb query from 
> mysql
> 
> home: /srv/mail/%u
> mail: /srv/mail/%u/Maildir

The query-strings for virtual users look like this:

password_query = SELECT username AS username, password FROM mailbox WHERE 
username = '%u' AND active = 1
user_query = SELECT maildir, uid, gid, concat('*:storage=', quota) AS 
quota_rule, concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox 
WHERE username = '%u'

There is no mail_loation defined. I thought if maildir is queried, the %u
would expand to the mail_location of the user. Where the users only with
the local part of the address exist in the filesystem.

/var/spool/vhosts/nimmini.de/a.meyer

whereas /var/spool/vhosts is a symlink to /home/vhosts.

This setup worked fine sometime ago and I wanted to reactivate MySQL
for dovecot. Now the query doesn't work anymore, the location seems
to be invalid.

location=maildir:~/
instead of
/var/spool/vhosts/nimmini.de/%u.

> > Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Namespace inbox:
> > type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes,
> > subscriptions=yes location=maildir:~/
> 
> on one of my accounts this same line looks like this:
> imap(a...@kivalo.at): Debug: Namespace inbox: type=private, prefix=, 
> sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes 
> location=maildir:/srv/mail/a...@kivalo.at/Maildir:LAYOUT=fs
> 
> where location is the "mail_location" setting from 10-mail.conf and is 
> overridden by the userdb from sql for every user.
> 
> it's probably enough to set the option mail_location in 10-mail.conf to 
> an absolute path.

I cannot set the absolute path in mail_location, because I have
systemusers and virtual users.

Don't know how to set mail_location in the query-string for MySQL,
if the expandation of %u is not enough. %u would expand to the full
address a.me...@nimmini.de whereas the location looks like
/var/spool/vhosts/nimmini.de/a.meyer

Don't know what to do.

Regards

  Andreas


Re: no login with MySQL

2015-09-13 Thread Christian Kivalo



On 2015-09-13 13:58, Andreas Meyer wrote:

Hello!

Setup again to authenticate my users with MySQL but can't login.

Sep 13 11:55:49 auth: Info:
passwd-file(a.me...@nimmini.de,95.88.63.177,):
unknown user
Sep 13 11:55:49 auth: Info:
passwd-file(a.me...@nimmini.de,95.88.63.177,):
unknown user
Sep 13 11:55:49 imap-login: Info: Login: user=,
method=CRAM-MD5, rip=95.88.63.177, lip=46.38.231.143, mpid=30826, TLS,
TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: user
a.me...@nimmini.de: Initialization failed: Namespace '': Home
directory not set for user. Can't expand ~/ for mail root dir in: ~/
Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: Invalid user
settings. Refer to server log for more information.


i see an error here "Error: Invalid user settings" relating to the users 
mail_location direcory.


Is "mail_location" (and not so important "mail_home") defined?

With my setup "mail" and "home" is returned from the userdb query from 
mysql


home: /srv/mail/%u
mail: /srv/mail/%u/Maildir

see http://wiki2.dovecot.org/VirtualUsers/Home


Sep 13 11:55:49 auth: Debug: auth client connected (pid=30825)
Sep 13 11:55:49 auth: Debug: client in: AUTH1   CRAM-MD5
 service=imapsecured session=R7Qe9J0fTgBfWD+x
lip=46.38.231.143   rip=95.88.63.177lport=143 rport=45646
Sep 13 11:55:49 auth: Debug: client passdb out: CONT1
PDkzMDcwNTI5Mzk5NTk1NTYuMTQ0MjEzODE0OUBiaXRtYWNoaW5lMT4=
Sep 13 11:55:49 auth: Debug: client in: CONT
Sep 13 11:55:49 auth: Debug:
passwd-file(a.me...@nimmini.de,95.88.63.177,):
lookup: user=a.me...@nimmini.de file=/etc/dovecot/passwd
Sep 13 11:55:49 auth-worker(30822): Debug:
sql(a.me...@nimmini.de,95.88.63.177): query: SELECT username AS
username, password FROM mailbox WHERE username = 'a.me...@nimmini.de'
AND active = 1
Sep 13 11:55:49 auth: Debug: client passdb out: OK  1
user=a.me...@nimmini.de
Sep 13 11:55:49 auth: Debug: master in: REQUEST 997457921   30821
 1   dc2456b4ee1453e5458806ab92da9ee7session_pid=30826
  request_auth_token
Sep 13 11:55:49 auth: Debug:
passwd-file(a.me...@nimmini.de,95.88.63.177,):
lookup: user=a.me...@nimmini.de file=/etc/dovecot/passwd
Sep 13 11:55:49 auth-worker(30822): Debug:
passwd-file(a.me...@nimmini.de,95.88.63.177): SELECT maildir, uid,
gid, concat('*:storage=', quota) AS quota_rule,
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox
WHERE username = 'a.me...@nimmini.de'
Sep 13 11:55:49 auth: Debug: master userdb out: USER997457921
 a.me...@nimmini.de  maildir=/var/spool/vhosts/nimmini.de/
uid=5000gid=5000quota_rule=*:storage=5242880
quota_rule2=Trash:storage=+100
auth_token=2a4c8e78ff8fcf3f9599eecbefb6a5605f22abe5
Sep 13 11:55:49 imap: Debug: Loading modules from directory:
/usr/lib64/dovecot/modules
Sep 13 11:55:49 imap: Debug: Module loaded:
/usr/lib64/dovecot/modules/lib01_acl_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded:
/usr/lib64/dovecot/modules/lib02_imap_acl_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded:
/usr/lib64/dovecot/modules/lib10_quota_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded:
/usr/lib64/dovecot/modules/lib11_imap_quota_plugin.so
Sep 13 11:55:49 imap: Debug: Added userdb setting:
plugin/maildir=/var/spool/vhosts/nimmini.de/
Sep 13 11:55:49 imap: Debug: Added userdb setting:
plugin/quota_rule=*:storage=5242880
Sep 13 11:55:49 imap: Debug: Added userdb setting:
plugin/quota_rule2=Trash:storage=+100
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Effective uid=5000,
gid=5000, home=
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota root: name=User
quota backend=maildir args=
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota rule: root=User
quota mailbox=* bytes=5368709120 messages=0
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota rule: root=User
quota mailbox=Trash bytes=+102400 messages=0
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota grace:
root=User quota bytes=53687091 (1%)




Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Namespace inbox:
type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes,
subscriptions=yes location=maildir:~/


on one of my accounts this same line looks like this:
imap(a...@kivalo.at): Debug: Namespace inbox: type=private, prefix=, 
sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes 
location=maildir:/srv/mail/a...@kivalo.at/Maildir:LAYOUT=fs


where location is the "mail_location" setting from 10-mail.conf and is 
overridden by the userdb from sql for every user.


it's probably enough to set the option mail_location in 10-mail.conf to 
an absolute path.



This is what claws-mail says:

[12:22:48] IMAP4< * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR
LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=CRAM-MD5]
Dovecot ready.
[12:22:48] IMAP4> 1 STARTTLS
[12:22:48] IMAP4< 1 OK Begin TLS negotiation now.
* IMAP connection is un-authenticated
[12:22:48] IMAP4> 2 CAPABILITY
[12:22:48] IMAP4< * CAPABILITY IMAP4rev1

Re: concerning dovecot settings for high volume server

2015-09-13 Thread Rajesh M
thanks very much urban. this was very helpful.

i have around 12500 users spread over 3 independent servers each having around 
4000+ users
i am using qmailtoaster, vpopmail, spamassassin and dovecot.

in future i am planning to consolidate all using a HA cluster.

if it is ok with you could you kindly share some information about your email 
server configuration. if you do not wish to put it on the list then you can 
directly email me.

1) is your email volume high ?
2) server hardware to support  28000 users
3) mailserver software - exim or postfix ??.
4) antispam software like spamassassin if any

also if you have faced any email re-download issues with dovecot sometimes 
randomly incase of pop3 users storing emails on the server ?


thanks
rajesh



- Original Message -
From: Urban Loesch [mailto:b...@enas.net]
To: dovecot@dovecot.org
Sent: Sun, 13 Sep 2015 09:33:14 +0200
Subject: Re: concerning dovecot settings for high volume server

Hi,

I have running dovecot with about 28k users.
Here comes my relevant config for pop3 and imap from "doveconf -n".
No problems so far.

-- snip --
default_client_limit = 2000
...

service imap-login {
   inet_listener imap {
 port = 143
   }
   process_limit = 256
   process_min_avail = 50
   service_count = 1
}
service imap {
   process_limit = 2048
   process_min_avail = 50
   service_count = 1
   vsz_limit = 512 M
}
...

service pop3-login {
   inet_listener pop3 {
 port = 110
   }
   process_limit = 256
   process_min_avail = 25
   service_count = 1
}
service pop3 {
   process_limit = 256
   process_min_avail = 25
   service_count = 1
}
...

protocol imap {
   imap_client_workarounds = tb-extra-mailbox-sep
   imap_id_log = *
   imap_logout_format = bytes=%i/%o session=<%{session}>
   mail_max_userip_connections = 40
   mail_plugins = " quota mail_log notify zlib imap_quota imap_zlib"
}

...
protocol pop3 {
   mail_plugins = " quota mail_log notify zlib"
   pop3_logout_format = bytes_sent=%o top=%t/%p, retr=%r/%b, del=%d/%m,
\ size=%s uidl_hash=%u session=<%{session}>
}
-- snip --

Regards
Urban


Am 12.09.2015 um 20:53 schrieb Rajesh M:
> hi
>
> centos 6 64 bit
>
> hex core processor with hyperthreading ie display shows 12 cores
> 16 gb ram
> 600 gb 15000 rpm drive
>
> we are having around 4000 users on a server
>
>
> i wish to allow 1500 pop3 and 1500 imap connections simultaneously.
>
> need help regarding the settings to handle the above
>
> imap-login, pop3-login
> imap pop3 service settings
>
> i recently i got an error
> imap-login: Error: read(imap) failed: Remote closed connection (process_limit 
> reached?)
>
>
> my current dovecot config file
>
> # 2.2.7: /etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-431.23.3.el6.x86_64 x86_64 CentOS release 6.5 (Final)
> auth_cache_negative_ttl = 0
> auth_cache_ttl = 0
> auth_mechanisms = plain login digest-md5 cram-md5
> default_login_user = vpopmail
> disable_plaintext_auth = no
> first_valid_gid = 89
> first_valid_uid = 89
> log_path = /var/log/dovecot.log
> login_greeting = ready.
> mail_max_userip_connections = 50
> mail_plugins = " quota"
> 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
> namespace {
>inbox = yes
>location =
>prefix =
>separator = .
>type = private
> }
> passdb {
>args = cache_key=%u webmail=127.0.0.1
>driver = vpopmail
> }
> plugin {
>quota = maildir:ignore=Trash
>quota_rule = ?:storage=0
> }
> protocols = imap pop3
> service imap-login {
>client_limit = 256
>process_limit = 400
>process_min_avail = 4
>service_count = 0
>vsz_limit = 512 M
> }
> service pop3-login {
>client_limit = 1000
>process_limit = 400
>process_min_avail = 12
>service_count = 0
>vsz_limit = 512 M
> }
> ssl_cert =  ssl_dh_parameters_length = 2048
> ssl_key =  userdb {
>args = cache_key=%u quota_template=quota_rule=*:backend=%q
>driver = vpopmail
> }
> protocol imap {
>imap_client_workarounds = delay-newmail
>mail_plugins = " quota imap_quota"
> }
> protocol pop3 {
>pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
>pop3_fast_size_lookups = yes
>pop3_lock_session = no
>pop3_no_flag_updates = yes
> }
>
>
> thanks very much,
>
> rajesh
>


Re: BINARY capability not working correctly?

2015-09-13 Thread Stephan Bosch
Op 9/13/2015 om 12:19 PM schreef Jouko Nikula:
> Hello,
>
> I have trouble with some attachments not working on Horde and
> Roundcube. I made a ticket to Roundcube webmail and they tracked down
> it to Dovecot not responding correctly to BINARY FETCH:
>
> http://trac.roundcube.net/ticket/1490532
>
> What is causing Dovecot to answer NIL? Is there an issue in Dovecot?

A few questions to facilitate debugging:

- Do your logs show anything that may be related to this issue?
- What is the output of `dovecot -n` ?

> If I want to disable to BINARY capability in Dovecot I need to use
> imap_capabilities. I found out that I could add capabilities with
> syntax
> imap_capabilities= +FOO
> but it seems I can't use similar syntax (imap_capabilities= -FOO) to
> remove capabilities? If I list all capabilities like:
>
> imap_capabilities= IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID
> ENABLE IDLE AUTH=PLAIN SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS
> THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT
> CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC
> ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE
> MOVE QUOTA
>
> I understood that this will result in listing all capabilities already
> pre-login. Is this a problem?

Not that I know of.

Regards,

Stephan.


no login with MySQL

2015-09-13 Thread Andreas Meyer
Hello!

Setup again to authenticate my users with MySQL but can't login.

Sep 13 11:55:49 auth: Info: 
passwd-file(a.me...@nimmini.de,95.88.63.177,): unknown user
Sep 13 11:55:49 auth: Info: 
passwd-file(a.me...@nimmini.de,95.88.63.177,): unknown user
Sep 13 11:55:49 imap-login: Info: Login: user=, 
method=CRAM-MD5, rip=95.88.63.177, lip=46.38.231.143, mpid=30826, TLS, TLSv1 
with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: user a.me...@nimmini.de: 
Initialization failed: Namespace '': Home directory not set for user. Can't 
expand ~/ for mail root dir in: ~/
Sep 13 11:55:49 imap(a.me...@nimmini.de): Error: Invalid user settings. Refer 
to server log for more information.



Sep 13 11:55:49 auth: Debug: auth client connected (pid=30825)
Sep 13 11:55:49 auth: Debug: client in: AUTH1   CRAM-MD5
service=imapsecured session=R7Qe9J0fTgBfWD+xlip=46.38.231.143   
rip=95.88.63.177lport=143 rport=45646
Sep 13 11:55:49 auth: Debug: client passdb out: CONT1   
PDkzMDcwNTI5Mzk5NTk1NTYuMTQ0MjEzODE0OUBiaXRtYWNoaW5lMT4=
Sep 13 11:55:49 auth: Debug: client in: CONT
Sep 13 11:55:49 auth: Debug: 
passwd-file(a.me...@nimmini.de,95.88.63.177,): lookup: 
user=a.me...@nimmini.de file=/etc/dovecot/passwd
Sep 13 11:55:49 auth-worker(30822): Debug: 
sql(a.me...@nimmini.de,95.88.63.177): query: SELECT username AS username, 
password FROM mailbox WHERE username = 'a.me...@nimmini.de' AND active = 1
Sep 13 11:55:49 auth: Debug: client passdb out: OK  1   
user=a.me...@nimmini.de
Sep 13 11:55:49 auth: Debug: master in: REQUEST 997457921   30821   1   
dc2456b4ee1453e5458806ab92da9ee7session_pid=30826   
request_auth_token
Sep 13 11:55:49 auth: Debug: 
passwd-file(a.me...@nimmini.de,95.88.63.177,): lookup: 
user=a.me...@nimmini.de file=/etc/dovecot/passwd
Sep 13 11:55:49 auth-worker(30822): Debug: 
passwd-file(a.me...@nimmini.de,95.88.63.177): SELECT maildir, uid, gid, 
concat('*:storage=', quota) AS quota_rule, concat('Trash:storage=+', 
quota_trash) AS quota_rule2 FROM mailbox WHERE username = 'a.me...@nimmini.de'
Sep 13 11:55:49 auth: Debug: master userdb out: USER997457921   
a.me...@nimmini.de  maildir=/var/spool/vhosts/nimmini.de/   uid=5000
gid=5000quota_rule=*:storage=5242880  
quota_rule2=Trash:storage=+100  
auth_token=2a4c8e78ff8fcf3f9599eecbefb6a5605f22abe5
Sep 13 11:55:49 imap: Debug: Loading modules from directory: 
/usr/lib64/dovecot/modules
Sep 13 11:55:49 imap: Debug: Module loaded: 
/usr/lib64/dovecot/modules/lib01_acl_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded: 
/usr/lib64/dovecot/modules/lib02_imap_acl_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded: 
/usr/lib64/dovecot/modules/lib10_quota_plugin.so
Sep 13 11:55:49 imap: Debug: Module loaded: 
/usr/lib64/dovecot/modules/lib11_imap_quota_plugin.so
Sep 13 11:55:49 imap: Debug: Added userdb setting: 
plugin/maildir=/var/spool/vhosts/nimmini.de/
Sep 13 11:55:49 imap: Debug: Added userdb setting: 
plugin/quota_rule=*:storage=5242880
Sep 13 11:55:49 imap: Debug: Added userdb setting: 
plugin/quota_rule2=Trash:storage=+100
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Effective uid=5000, gid=5000, 
home=
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota root: name=User quota 
backend=maildir args=
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota rule: root=User quota 
mailbox=* bytes=5368709120 messages=0
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota rule: root=User quota 
mailbox=Trash bytes=+102400 messages=0
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Quota grace: root=User quota 
bytes=53687091 (1%)
Sep 13 11:55:49 imap(a.me...@nimmini.de): Debug: Namespace inbox: type=private, 
prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes 
location=maildir:~/


This is what claws-mail says:

[12:22:48] IMAP4< * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS 
ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=CRAM-MD5] Dovecot ready. 
[12:22:48] IMAP4> 1 STARTTLS 
[12:22:48] IMAP4< 1 OK Begin TLS negotiation now. 
* IMAP connection is un-authenticated
[12:22:48] IMAP4> 2 CAPABILITY 
[12:22:48] IMAP4< * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE IDLE AUTH=PLAIN AUTH=CRAM-MD5 
[12:22:48] IMAP4< 2 OK Pre-login capabilities listed, post-login capabilities 
have more. 
[12:22:48] IMAP4> Logging a.me...@nimmini.de to mail.nimmini.de using CRAM-MD5
** IMAP Fehler auf mail.nimmini.de: parse error (sehr wahrscheinlich ein nicht 
RFC-konformer Server)
** IMAP4-Verbindung unterbrochen
[12:22:48] IMAP4< Error logging in to mail.nimmini.de

When I set auth_type PLAIN in Roundcube, login fails too.

The SELECTS in the database are ok:

mysql> SELECT maildir, uid, gid, concat('*:storage=', quota) AS quota_rule, 
concat('Trash:storage=+', quota_trash) AS quota_rule2 FROM mailbox WHERE 
username = 'a.me...@nimmini.de';  
+---+--+

BINARY capability not working correctly?

2015-09-13 Thread Jouko Nikula
Hello,

I have trouble with some attachments not working on Horde and
Roundcube. I made a ticket to Roundcube webmail and they tracked down
it to Dovecot not responding correctly to BINARY FETCH:

http://trac.roundcube.net/ticket/1490532

What is causing Dovecot to answer NIL? Is there an issue in Dovecot?

If I want to disable to BINARY capability in Dovecot I need to use
imap_capabilities. I found out that I could add capabilities with
syntax
imap_capabilities= +FOO
but it seems I can't use similar syntax (imap_capabilities= -FOO) to
remove capabilities? If I list all capabilities like:

imap_capabilities= IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID
ENABLE IDLE AUTH=PLAIN SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS
THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT
CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC
ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE
MOVE QUOTA

I understood that this will result in listing all capabilities already
pre-login. Is this a problem?

Thanks,
Jouko Nikula


Re: concerning dovecot settings for high volume server

2015-09-13 Thread Urban Loesch

Hi,

I have running dovecot with about 28k users.
Here comes my relevant config for pop3 and imap from "doveconf -n".
No problems so far.

-- snip --
default_client_limit = 2000
...

service imap-login {
  inet_listener imap {
port = 143
  }
  process_limit = 256
  process_min_avail = 50
  service_count = 1
}
service imap {
  process_limit = 2048
  process_min_avail = 50
  service_count = 1
  vsz_limit = 512 M
}
...

service pop3-login {
  inet_listener pop3 {
port = 110
  }
  process_limit = 256
  process_min_avail = 25
  service_count = 1
}
service pop3 {
  process_limit = 256
  process_min_avail = 25
  service_count = 1
}
...

protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  imap_id_log = *
  imap_logout_format = bytes=%i/%o session=<%{session}>
  mail_max_userip_connections = 40
  mail_plugins = " quota mail_log notify zlib imap_quota imap_zlib"
}

...
protocol pop3 {
  mail_plugins = " quota mail_log notify zlib"
  pop3_logout_format = bytes_sent=%o top=%t/%p, retr=%r/%b, del=%d/%m, 
\ size=%s uidl_hash=%u session=<%{session}>

}
-- snip --

Regards
Urban


Am 12.09.2015 um 20:53 schrieb Rajesh M:

hi

centos 6 64 bit

hex core processor with hyperthreading ie display shows 12 cores
16 gb ram
600 gb 15000 rpm drive

we are having around 4000 users on a server


i wish to allow 1500 pop3 and 1500 imap connections simultaneously.

need help regarding the settings to handle the above

imap-login, pop3-login
imap pop3 service settings

i recently i got an error
imap-login: Error: read(imap) failed: Remote closed connection (process_limit 
reached?)


my current dovecot config file

# 2.2.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-431.23.3.el6.x86_64 x86_64 CentOS release 6.5 (Final)
auth_cache_negative_ttl = 0
auth_cache_ttl = 0
auth_mechanisms = plain login digest-md5 cram-md5
default_login_user = vpopmail
disable_plaintext_auth = no
first_valid_gid = 89
first_valid_uid = 89
log_path = /var/log/dovecot.log
login_greeting = ready.
mail_max_userip_connections = 50
mail_plugins = " quota"
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
namespace {
   inbox = yes
   location =
   prefix =
   separator = .
   type = private
}
passdb {
   args = cache_key=%u webmail=127.0.0.1
   driver = vpopmail
}
plugin {
   quota = maildir:ignore=Trash
   quota_rule = ?:storage=0
}
protocols = imap pop3
service imap-login {
   client_limit = 256
   process_limit = 400
   process_min_avail = 4
   service_count = 0
   vsz_limit = 512 M
}
service pop3-login {
   client_limit = 1000
   process_limit = 400
   process_min_avail = 12
   service_count = 0
   vsz_limit = 512 M
}
ssl_cert =