Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Is there "extra_field" in passwd-file for email? What generally will be advice on quotas in our case?
dovecot -n: # 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.16 (fed8554) # OS: Linux 4.4.39-std-def-alt0.M80P.1 x86_64 ALT 8.1 Server auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login cram-md5 auth_socket_path = /var/run/dovecot/auth-userdb auth_username_chars = auth_verbose = yes auth_verbose_passwords = plain base_dir = /var/run/dovecot/ debug_log_path = /var/log/dovecot disable_plaintext_auth = no first_valid_gid = 502 first_valid_uid = 502 last_valid_gid = 268999999 last_valid_uid = 268999999 log_path = /var/log/dovecot login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c mail_access_groups = vmail mail_debug = yes mail_gid = 502 mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/ mail_plugins = " quota autocreate" mail_privileged_group = vmail mail_uid = 502 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 index ihave duplicate mime foreverypart extracttext imapflags notify mbox_write_locks = fcntl namespace { list = children location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u prefix = shared/%%u/ separator = / subscriptions = yes type = shared } namespace inbox { inbox = yes location = prefix = separator = / type = private } passdb { driver = pam } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { quota_rule = *:storage=5G recipient_delimiter = + sieve = /etc/dovecot/sieves/default.sieve sieve_default = /etc/dovecot/sieves/default.sieve sieve_dir = ~/sieve sieve_extensions = +notify +imapflags sieve_max_redirects = 8 } protocols = imap pop3 lmtp sieve service auth-worker { user = root } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service dict { unix_listener dict { group = vmail mode = 0600 user = vmail } } service imap-login { inet_listener imap { port = 143 } } service imap { process_limit = 1024 vsz_limit = 256 M } service lmtp { unix_listener lmtp { mode = 0666 } } service managesieve-login { inet_listener sieve { port = 4190 } vsz_limit = 64 M } service pop3-login { inet_listener pop3 { port = 110 } } service pop3 { process_limit = 1024 } ssl_ca = </usr/share/ca-certificates/ca-bundle.crt ssl_cert = </etc/dovecot/server.crt ssl_key = # hidden, use -P to show it userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u } userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = " quota autocreate sieve" } protocol lda { mail_plugins = " quota autocreate sieve quota" plugin { quota = dict:user::file:/var/vmail/glu_vrem/%n/.quotausage } } protocol imap { mail_plugins = " quota autocreate autocreate imap_quota" plugin { autocreate = INBOX autocreate2 = Sent autocreate3 = Trash autocreate4 = Drafts autocreate5 = Junk autosubscribe = INBOX autosubscribe2 = Sent autosubscribe3 = Trash autosubscribe4 = Drafts autosubscribe5 = Junk quota = dict:user::file:/var/vmail/glu_vrem/%n/.quotausage } } protocol sieve { mail_max_userip_connections = 10 managesieve_implementation_string = Dovecot Pigeonhole managesieve_logout_format = bytes=%i/%o managesieve_max_compile_errors = 5 managesieve_max_line_length = 65536 } protocol pop3 { pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_uidl_format = %08Xu%08Xv }
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Is there "extra_field" in passwd-file for email? What generally will be advice on quotas in our case?
dovecot -n: # 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.16 (fed8554) # OS: Linux 4.4.39-std-def-alt0.M80P.1 x86_64 ALT 8.1 Server auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login cram-md5 auth_socket_path = /var/run/dovecot/auth-userdb auth_username_chars = auth_verbose = yes auth_verbose_passwords = plain base_dir = /var/run/dovecot/ debug_log_path = /var/log/dovecot disable_plaintext_auth = no first_valid_gid = 502 first_valid_uid = 502 last_valid_gid = 268999999 last_valid_uid = 268999999 log_path = /var/log/dovecot login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c mail_access_groups = vmail mail_debug = yes mail_gid = 502 mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/ mail_plugins = " quota autocreate" mail_privileged_group = vmail mail_uid = 502 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 index ihave duplicate mime foreverypart extracttext imapflags notify mbox_write_locks = fcntl namespace { list = children location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u prefix = shared/%%u/ separator = / subscriptions = yes type = shared } namespace inbox { inbox = yes location = prefix = separator = / type = private } passdb { driver = pam } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { quota_rule = *:storage=5G recipient_delimiter = + sieve = /etc/dovecot/sieves/default.sieve sieve_default = /etc/dovecot/sieves/default.sieve sieve_dir = ~/sieve sieve_extensions = +notify +imapflags sieve_max_redirects = 8 } protocols = imap pop3 lmtp sieve service auth-worker { user = root } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service dict { unix_listener dict { group = vmail mode = 0600 user = vmail } } service imap-login { inet_listener imap { port = 143 } } service imap { process_limit = 1024 vsz_limit = 256 M } service lmtp { unix_listener lmtp { mode = 0666 } } service managesieve-login { inet_listener sieve { port = 4190 } vsz_limit = 64 M } service pop3-login { inet_listener pop3 { port = 110 } } service pop3 { process_limit = 1024 } ssl_ca = </usr/share/ca-certificates/ca-bundle.crt ssl_cert = </etc/dovecot/server.crt ssl_key = # hidden, use -P to show it userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u } userdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } protocol lmtp { mail_plugins = " quota autocreate sieve" } protocol lda { mail_plugins = " quota autocreate sieve quota" plugin { quota = dict:user::file:/var/vmail/glu_vrem/%n/.quotausage } } protocol imap { mail_plugins = " quota autocreate autocreate imap_quota" plugin { autocreate = INBOX autocreate2 = Sent autocreate3 = Trash autocreate4 = Drafts autocreate5 = Junk autosubscribe = INBOX autosubscribe2 = Sent autosubscribe3 = Trash autosubscribe4 = Drafts autosubscribe5 = Junk quota = dict:user::file:/var/vmail/glu_vrem/%n/.quotausage } } protocol sieve { mail_max_userip_connections = 10 managesieve_implementation_string = Dovecot Pigeonhole managesieve_logout_format = bytes=%i/%o managesieve_max_compile_errors = 5 managesieve_max_line_length = 65536 } protocol pop3 { pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_uidl_format = %08Xu%08Xv }
Turn on auth_debug and auth_verbose and see what it says.
Aki
On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Turn on auth_debug and auth_verbose and see what it says.
Aki
Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd)
On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Turn on auth_debug and auth_verbose and see what it says.
Aki
Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd) On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Turn on auth_debug and auth_verbose and see what it says.
Aki Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd)
or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd) On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Turn on auth_debug and auth_verbose and see what it says.
Aki Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd) or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd) On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote:
Hello! We have passwd=pam, userdb=passwd. passdb { driver = pam #server was entered domain Active Directory } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
How can i use per-user quota? Only passwd-file?
I tried: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } /etc/imap.passwd: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G
Authentication and quota - now OK. But doesn't work sending and receiving mail... postfix say 'Unknown user'...
Turn on auth_debug and auth_verbose and see what it says.
Aki Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
with auth_username_format = %Ln:
Jun 28 14:43:41 auth: Debug: master in: USER 1 iivanov.ia@example.com service=lda
Jun 28 14:43:41 auth-worker(18369): Debug: passwd(iivanov.ia): lookup
Jun 28 14:43:41 auth-worker(18369): Info: passwd(iivanov.ia): unknown user - trying the next userdb
Jun 28 14:43:41 auth-worker(18369): Debug: sql(iivanov.ia): SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid,
CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = 'iivanov.ia' OR email = 'iivanov.ia')
Jun 28 14:43:41 auth-worker(18369): Info: sql(iivanov.ia): unknown user
Maybe %Lu?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:10:07 Тема: Re: Per-user quota (passwd)
Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd) or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd) On 28.06.2017 12:36, Aki Tuomi wrote:
On 28.06.2017 12:25, Evgeniy Korneechev wrote: > Hello! > We have passwd=pam, userdb=passwd. > passdb { > driver = pam #server was entered domain Active Directory > } > userdb { > driver = passwd > override_fields = home=/var/vmail/glu_vrem/%u > } > > How can i use per-user quota? Only passwd-file? > > I tried: > userdb { > args = /etc/imap.passwd > driver = passwd-file > override_fields = home=/var/vmail/glu_vrem/%u > } > /etc/imap.passwd: > administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > > Authentication and quota - now OK. But doesn't work sending and receiving > mail... > postfix say 'Unknown user'... > > > Turn on auth_debug and auth_verbose and see what it says. > > Aki Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
Oh you have multiple db's, I missed that.
Remove auth_username_format, and instead
userdb { args = /etc/imap.passwd username_format=%Ln driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u }
On 29.06.2017 14:35, Evgeniy Korneechev wrote:
with auth_username_format = %Ln:
Jun 28 14:43:41 auth: Debug: master in: USER 1 iivanov.ia@example.com service=lda Jun 28 14:43:41 auth-worker(18369): Debug: passwd(iivanov.ia): lookup Jun 28 14:43:41 auth-worker(18369): Info: passwd(iivanov.ia): unknown user - trying the next userdb Jun 28 14:43:41 auth-worker(18369): Debug: sql(iivanov.ia): SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid,
CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = 'iivanov.ia' OR email = 'iivanov.ia') Jun 28 14:43:41 auth-worker(18369): Info: sql(iivanov.ia): unknown userMaybe %Lu?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:10:07 Тема: Re: Per-user quota (passwd) Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd) or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 Тема: Re: Per-user quota (passwd) On 28.06.2017 12:36, Aki Tuomi wrote: > On 28.06.2017 12:25, Evgeniy Korneechev wrote: >> Hello! >> We have passwd=pam, userdb=passwd. >> passdb { >> driver = pam #server was entered domain Active Directory >> } >> userdb { >> driver = passwd >> override_fields = home=/var/vmail/glu_vrem/%u >> } >> >> How can i use per-user quota? Only passwd-file? >> >> I tried: >> userdb { >> args = /etc/imap.passwd >> driver = passwd-file >> override_fields = home=/var/vmail/glu_vrem/%u >> } >> /etc/imap.passwd: >> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> >> Authentication and quota - now OK. But doesn't work sending and receiving >> mail... >> postfix say 'Unknown user'... >> >> >> Turn on auth_debug and auth_verbose and see what it says. >> >> Aki Also you can set auth_username_format = %Ln to force usernames into lowercase without domain.
Aki
Our solution: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
Users with non-standard quota in passwd-file:
administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
Others from passwd.
Its works! Thanks.
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:40:44 Тема: Re: Per-user quota (passwd)
Oh you have multiple db's, I missed that.
Remove auth_username_format, and instead
userdb { args = /etc/imap.passwd username_format=%Ln driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u }
On 29.06.2017 14:35, Evgeniy Korneechev wrote:
with auth_username_format = %Ln:
Jun 28 14:43:41 auth: Debug: master in: USER 1 iivanov.ia@example.com service=lda Jun 28 14:43:41 auth-worker(18369): Debug: passwd(iivanov.ia): lookup Jun 28 14:43:41 auth-worker(18369): Info: passwd(iivanov.ia): unknown user - trying the next userdb Jun 28 14:43:41 auth-worker(18369): Debug: sql(iivanov.ia): SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid,
CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = 'iivanov.ia' OR email = 'iivanov.ia') Jun 28 14:43:41 auth-worker(18369): Info: sql(iivanov.ia): unknown userMaybe %Lu?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:10:07 Тема: Re: Per-user quota (passwd) Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd) or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote:
Hi! workaround: administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
But this is not a solution for 1000 users ... Maybe is there extra field "userdb_mail=administrator@email.dom" for email to passwd-file?
----- Исходное сообщение ----- > От: "Aki Tuomi" <aki.tuomi@dovecot.fi> > Кому: "dovecot" <dovecot@dovecot.org> > Отправленные: Среда, 28 Июнь 2017 г 12:40:48 > Тема: Re: Per-user quota (passwd) > On 28.06.2017 12:36, Aki Tuomi wrote: >> On 28.06.2017 12:25, Evgeniy Korneechev wrote: >>> Hello! >>> We have passwd=pam, userdb=passwd. >>> passdb { >>> driver = pam #server was entered domain Active Directory >>> } >>> userdb { >>> driver = passwd >>> override_fields = home=/var/vmail/glu_vrem/%u >>> } >>> >>> How can i use per-user quota? Only passwd-file? >>> >>> I tried: >>> userdb { >>> args = /etc/imap.passwd >>> driver = passwd-file >>> override_fields = home=/var/vmail/glu_vrem/%u >>> } >>> /etc/imap.passwd: >>> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >>> >>> Authentication and quota - now OK. But doesn't work sending and receiving >>> mail... >>> postfix say 'Unknown user'... >>> >>> >>> Turn on auth_debug and auth_verbose and see what it says. >>> >>> Aki > Also you can set auth_username_format = %Ln to force usernames into > lowercase without domain. > > Aki
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
Hi. But there is one problem...
protocol lda { mail_plugins = " quota autocreate sieve quota" plugin { quota = dict:user::file:/var/vmail/glu_vrem/%u/.quotausage } } protocol imap { mail_plugins = " quota autocreate autocreate imap_quota" plugin { autocreate = INBOX autocreate2 = Sent autocreate3 = Trash autocreate4 = Drafts autocreate5 = Junk autosubscribe = INBOX autosubscribe2 = Sent autosubscribe3 = Trash autosubscribe4 = Drafts autosubscribe5 = Junk quota = dict:user::file:/var/vmail/glu_vrem/%u/.quotausage } }
Users with non-standard quota in passwd-file:
> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir > administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
Others from passwd.
Files ".quotausage" are created in different directories: /var/vmail/glu_vrem/administrator\DOM/.quotausage /var/vmail/glu_vrem/administrator@email.dom/.quotausage And must in the folder "/var/vmail/glu_vrem/administrator"
How fix it?
----- Исходное сообщение -----
От: "Evgeniy Korneechev" <ekorneechev@altlinux.org> Кому: "Aki Tuomi" <aki.tuomi@dovecot.fi> Копия: "dovecot" <dovecot@dovecot.org> Отправленные: Пятница, 30 Июнь 2017 г 10:39:16 Тема: Re: Per-user quota (passwd)
Our solution: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
Users with non-standard quota in passwd-file:
> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir > administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir
Others from passwd.
Its works! Thanks.
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:40:44 Тема: Re: Per-user quota (passwd)
Oh you have multiple db's, I missed that.
Remove auth_username_format, and instead
userdb { args = /etc/imap.passwd username_format=%Ln driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u }
On 29.06.2017 14:35, Evgeniy Korneechev wrote:
with auth_username_format = %Ln:
Jun 28 14:43:41 auth: Debug: master in: USER 1 iivanov.ia@example.com service=lda Jun 28 14:43:41 auth-worker(18369): Debug: passwd(iivanov.ia): lookup Jun 28 14:43:41 auth-worker(18369): Info: passwd(iivanov.ia): unknown user - trying the next userdb Jun 28 14:43:41 auth-worker(18369): Debug: sql(iivanov.ia): SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid,
CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = 'iivanov.ia' OR email = 'iivanov.ia') Jun 28 14:43:41 auth-worker(18369): Info: sql(iivanov.ia): unknown userMaybe %Lu?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:10:07 Тема: Re: Per-user quota (passwd) Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 Тема: Re: Per-user quota (passwd) or use, as I indicated before, auth_username_format = %Ln
Aki
On 29.06.2017 13:58, Evgeniy Korneechev wrote: > Hi! > workaround: > administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir > administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G > userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir > > But this is not a solution for 1000 users ... > Maybe is there extra field "userdb_mail=administrator@email.dom" for email to > passwd-file? > > ----- Исходное сообщение ----- >> От: "Aki Tuomi" <aki.tuomi@dovecot.fi> >> Кому: "dovecot" <dovecot@dovecot.org> >> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 >> Тема: Re: Per-user quota (passwd) >> On 28.06.2017 12:36, Aki Tuomi wrote: >>> On 28.06.2017 12:25, Evgeniy Korneechev wrote: >>>> Hello! >>>> We have passwd=pam, userdb=passwd. >>>> passdb { >>>> driver = pam #server was entered domain Active Directory >>>> } >>>> userdb { >>>> driver = passwd >>>> override_fields = home=/var/vmail/glu_vrem/%u >>>> } >>>> >>>> How can i use per-user quota? Only passwd-file? >>>> >>>> I tried: >>>> userdb { >>>> args = /etc/imap.passwd >>>> driver = passwd-file >>>> override_fields = home=/var/vmail/glu_vrem/%u >>>> } >>>> /etc/imap.passwd: >>>> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >>>> >>>> Authentication and quota - now OK. But doesn't work sending and receiving >>>> mail... >>>> postfix say 'Unknown user'... >>>> >>>> >>>> Turn on auth_debug and auth_verbose and see what it says. >>>> >>>> Aki >> Also you can set auth_username_format = %Ln to force usernames into >> lowercase without domain. >> >> Aki
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
-- WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
Hi! Just so you know, autocreate/autosubscribe is deprecated, you should use
namespace { mailbox INBOX { auto = subscribe } }
can you run
doveadm user administrator@email.dom
to verify that mail_home gets set correctly?
Aki
On 11.09.2017 14:48, Evgeniy Korneechev wrote:
Hi. But there is one problem...
protocol lda { mail_plugins = " quota autocreate sieve quota" plugin { quota = dict:user::file:/var/vmail/glu_vrem/%u/.quotausage } } protocol imap { mail_plugins = " quota autocreate autocreate imap_quota" plugin { autocreate = INBOX autocreate2 = Sent autocreate3 = Trash autocreate4 = Drafts autocreate5 = Junk autosubscribe = INBOX autosubscribe2 = Sent autosubscribe3 = Trash autosubscribe4 = Drafts autosubscribe5 = Junk quota = dict:user::file:/var/vmail/glu_vrem/%u/.quotausage } }
Users with non-standard quota in passwd-file:
>> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir >> administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir Others from passwd.
Files ".quotausage" are created in different directories: /var/vmail/glu_vrem/administrator\DOM/.quotausage /var/vmail/glu_vrem/administrator@email.dom/.quotausage And must in the folder "/var/vmail/glu_vrem/administrator"
How fix it?
----- Исходное сообщение -----
От: "Evgeniy Korneechev" <ekorneechev@altlinux.org> Кому: "Aki Tuomi" <aki.tuomi@dovecot.fi> Копия: "dovecot" <dovecot@dovecot.org> Отправленные: Пятница, 30 Июнь 2017 г 10:39:16 Тема: Re: Per-user quota (passwd) Our solution: userdb { args = /etc/imap.passwd driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u } userdb { driver = passwd override_fields = home=/var/vmail/glu_vrem/%u }
Users with non-standard quota in passwd-file:
>> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir >> administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir Others from passwd.
Its works! Thanks.
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:40:44 Тема: Re: Per-user quota (passwd) Oh you have multiple db's, I missed that.
Remove auth_username_format, and instead
userdb { args = /etc/imap.passwd username_format=%Ln driver = passwd-file override_fields = home=/var/vmail/glu_vrem/%u }
On 29.06.2017 14:35, Evgeniy Korneechev wrote:
with auth_username_format = %Ln:
Jun 28 14:43:41 auth: Debug: master in: USER 1 iivanov.ia@example.com service=lda Jun 28 14:43:41 auth-worker(18369): Debug: passwd(iivanov.ia): lookup Jun 28 14:43:41 auth-worker(18369): Info: passwd(iivanov.ia): unknown user - trying the next userdb Jun 28 14:43:41 auth-worker(18369): Debug: sql(iivanov.ia): SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid,
CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = 'iivanov.ia' OR email = 'iivanov.ia') Jun 28 14:43:41 auth-worker(18369): Info: sql(iivanov.ia): unknown userMaybe %Lu?
----- Исходное сообщение -----
От: "Aki Tuomi" <aki.tuomi@dovecot.fi> Кому: "dovecot" <dovecot@dovecot.org> Отправленные: Четверг, 29 Июнь 2017 г 14:10:07 Тема: Re: Per-user quota (passwd) Yes.
Aki
On 29.06.2017 14:07, Evgeniy Korneechev wrote:
And if such a user: email (from AD) = ivanov.ia@example.com login (from AD), %n = iivanov %d = DOM %u = iivanov@DOM
?
----- Исходное сообщение ----- > От: "Aki Tuomi" <aki.tuomi@dovecot.fi> > Кому: "dovecot" <dovecot@dovecot.org> > Отправленные: Четверг, 29 Июнь 2017 г 13:59:05 > Тема: Re: Per-user quota (passwd) > or use, as I indicated before, auth_username_format = %Ln > > Aki > > > On 29.06.2017 13:58, Evgeniy Korneechev wrote: >> Hi! >> workaround: >> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir >> administrator@email.dom:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >> userdb_mail=maildir:/var/vmail/glu_vrem/administrator/Maildir >> >> But this is not a solution for 1000 users ... >> Maybe is there extra field "userdb_mail=administrator@email.dom" for email to >> passwd-file? >> >> ----- Исходное сообщение ----- >>> От: "Aki Tuomi" <aki.tuomi@dovecot.fi> >>> Кому: "dovecot" <dovecot@dovecot.org> >>> Отправленные: Среда, 28 Июнь 2017 г 12:40:48 >>> Тема: Re: Per-user quota (passwd) >>> On 28.06.2017 12:36, Aki Tuomi wrote: >>>> On 28.06.2017 12:25, Evgeniy Korneechev wrote: >>>>> Hello! >>>>> We have passwd=pam, userdb=passwd. >>>>> passdb { >>>>> driver = pam #server was entered domain Active Directory >>>>> } >>>>> userdb { >>>>> driver = passwd >>>>> override_fields = home=/var/vmail/glu_vrem/%u >>>>> } >>>>> >>>>> How can i use per-user quota? Only passwd-file? >>>>> >>>>> I tried: >>>>> userdb { >>>>> args = /etc/imap.passwd >>>>> driver = passwd-file >>>>> override_fields = home=/var/vmail/glu_vrem/%u >>>>> } >>>>> /etc/imap.passwd: >>>>> administrator:*:95400500:95400513:Administrator:/home/DOM/administrator:/bin/bash::userdb_quota_rule=*:bytes=10G >>>>> >>>>> Authentication and quota - now OK. But doesn't work sending and receiving >>>>> mail... >>>>> postfix say 'Unknown user'... >>>>> >>>>> >>>>> Turn on auth_debug and auth_verbose and see what it says. >>>>> >>>>> Aki >>> Also you can set auth_username_format = %Ln to force usernames into >>> lowercase without domain. >>> >>> Aki
WBR, Korneechev Evgeniy BaseALT/ALTLinux Team
participants (2)
-
Aki Tuomi
-
Evgeniy Korneechev