Re: quota-status: Issues with uppercase recipient address

2018-03-14 Thread Christoph Lukas

* Aki Tuomi  [2018-03-13 08:56:02 +0200]:




On 12.03.2018 18:44, Christoph Lukas wrote:

* B. Reino  [2018-03-10 23:10:30 +0100]:


On Sat, 10 Mar 2018, Christoph Lukas wrote:


Am 10.03.2018 um 12:20 schrieb Aki Tuomi:

Change mail_location too


That did it!
Thank you very much!



You may also want to correct the sieve directory (it uses %d and %n).



Cheers, changed that as well.
Thank you.


This is the reason you should use

mail_home=/some/directory/%Ld/%Lu (or home in userdb)
mail_location=driver:~/path/
sieve...=~/path

the ~/ expands into mail_home.

Aki


I've changed the following:

sieve = ~/dovecot.sieve
mail_location = sdbox:~

Everything seems to run fine.
The mail_location is a bit non-standard, but it works.


Christoph


Re: quota-status: Issues with uppercase recipient address

2018-03-12 Thread Aki Tuomi


On 12.03.2018 18:44, Christoph Lukas wrote:
> * B. Reino  [2018-03-10 23:10:30 +0100]:
>
>> On Sat, 10 Mar 2018, Christoph Lukas wrote:
>>
>>> Am 10.03.2018 um 12:20 schrieb Aki Tuomi:
 Change mail_location too

>>> That did it!
>>> Thank you very much!
>>>
>>
>> You may also want to correct the sieve directory (it uses %d and %n).
>>
>
> Cheers, changed that as well.
> Thank you.

This is the reason you should use

mail_home=/some/directory/%Ld/%Lu (or home in userdb)
mail_location=driver:~/path/
sieve...=~/path

the ~/ expands into mail_home.

Aki


Re: quota-status: Issues with uppercase recipient address

2018-03-12 Thread Christoph Lukas

* B. Reino  [2018-03-10 23:10:30 +0100]:


On Sat, 10 Mar 2018, Christoph Lukas wrote:


Am 10.03.2018 um 12:20 schrieb Aki Tuomi:

Change mail_location too


That did it!
Thank you very much!



You may also want to correct the sieve directory (it uses %d and %n).



Cheers, changed that as well.
Thank you.


Re: quota-status: Issues with uppercase recipient address

2018-03-10 Thread B. Reino

On Sat, 10 Mar 2018, Christoph Lukas wrote:


Am 10.03.2018 um 12:20 schrieb Aki Tuomi:

Change mail_location too


That did it!
Thank you very much!



You may also want to correct the sieve directory (it uses %d and %n).



Re: quota-status: Issues with uppercase recipient address

2018-03-10 Thread Christoph Lukas
Am 10.03.2018 um 12:20 schrieb Aki Tuomi:
> Change mail_location too
>
>
> ---
> Aki Tuomi
> Dovecot oy

That did it!
Thank you very much!

Best regards,
Christoph


Re: quota-status: Issues with uppercase recipient address

2018-03-10 Thread Aki Tuomi
Change mail_location too

---Aki TuomiDovecot oy
 Original message From: Christoph Lukas  Date: 
10/03/2018  12:37  (GMT+02:00) To: dovecot@dovecot.org Subject: quota-status: 
Issues with uppercase recipient address 
Hello list,

Dovecot Version: 2.2.34 (874deae) on FreeBSD
MTA: Postfix 3.3.0

I've got an issue with the quota-status service:

Something breaks when receiving mail with a recipient address that includes 
non-lowercase characters,
for example f...@example.com instead of f...@example.com:

postfix log:
 postfix/smtp/smtpd[83387]: NOQUEUE: reject_warning: RCPT from 
mout01.posteo.de[185.67.36.65]:
  450 4.7.1 : Recipient address rejected: Invalid user 
settings. Refer to server
  log for more information.; from=<[REDACTED]> to= 
proto=ESMTP helo=

dovecot.log:
 quota-status(f...@example.com): Error: User initialization failed:
  Namespace '': mkdir(/srv/mail/Example.com/foo/mailboxes) failed: Permission 
denied
  (euid=1001(vmail) egid=1001(vmail) missing +w perm: /srv/mail, dir owned by 
0:1001 mode=0755)

The user_query has already been altered to include L, however the issue 
persists.

user_query = \
 SELECT CONCAT('/srv/mail/','%Ld','/','%Ln','/') AS home, \
 1001 AS uid, \
 1001 AS gid, \
 concat('*:bytes=', quota) AS quota_rule \
 FROM mailbox WHERE username = '%Lu' \
 AND active = 1

Thank you for any suggestions.
Christoph


# 2.2.34 (874deae): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.22 (22940fb7)
# OS: FreeBSD 11.1-STABLE amd64  zfs
# Hostname: mail
auth_default_realm = firc.de
auth_mechanisms = plain login
auth_username_chars = 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@+
auth_username_format = 
auth_verbose = yes
base_dir = /var/run/dovecot/
first_valid_gid = 1001
first_valid_uid = 1001
hostname = mail.firc.de
info_log_path = /var/log/dovecot/dovecot-info.log
last_valid_gid = 1001
last_valid_uid = 1001
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
lda_original_recipient_header = X-Original-To
log_path = /var/log/dovecot/dovecot.log
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k
mail_gid = 1001
mail_location = sdbox:/srv/mail/%d/%n
mail_plugins = acl fts fts_solr quota
mail_uid = 1001
mailbox_list_index = yes
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 spamtest spamtestplus imapsieve 
vnd.dovecot.imapsieve
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Entwürfe {
    special_use = \Drafts
  }
  mailbox "Gelöschte Elemente" {
    special_use = \Trash
  }
  mailbox "Gesendete Elemente" {
    special_use = \Sent
  }
  mailbox Junk-E-Mail {
    special_use = \Junk
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  acl = vfile
  acl_shared_dict = file:/srv/mail/dovecot/shared-mailboxes
  antispam_backend = mailtrain
  antispam_mail_notspam = learn_ham
  antispam_mail_sendmail = /usr/local/bin/rspamc
  antispam_mail_sendmail_args = -h;10.0.110.27:11334;-P;[REDACTED]
  antispam_mail_spam = learn_spam
  antispam_spam = Junk
  antispam_trash = Trash
  fts = solr
  fts_autoindex = yes
  fts_solr = url=http://127.0.0.1:8983/solr/dovecot/
  imapsieve_mailbox1_before = 
file:/usr/local/etc/dovecot/sieve/report-spam.sieve
  imapsieve_mailbox1_causes = COPY
  imapsieve_mailbox1_name = Junk
  imapsieve_mailbox2_before = file:/usr/local/etc/dovecot/sieve/report-ham.sieve
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_from = Junk
  imapsieve_mailbox2_name = *
  quota = count:User quota
  quota_grace = 10%%
  quota_rule2 = Trash:storage=+100M
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_vsizes = yes
  sieve = /srv/mail/%d/%n/dovecot.sieve
  sieve_default = /srv/mail/dovecot/default.sieve
  sieve_extensions = +spamtest +spamtestplus
  sieve_global_extensions = +vnd.dovecot.pipe
  sieve_pipe_bin_dir = /usr/local/etc/dovecot/sieve
  sieve_plugins = sieve_imapsieve sieve_extprograms
  sieve_spamtest_max_header = X-Spamd-Result: default: [[:alnum:]]+ 
\[-?[[:digit:]]+\.[[:digit:]]+ / (-?[[:digit:]]+\.[[:digit:]]+)\]
  sieve_spamtest_status_header = X-Spamd-Result: default: [[:alnum:]]+ 
\[(-?[[:digit:]]+\.[[:digit:]]+) / -?[[:digit:]]+\.[[:digit:]]+\]
  sieve_spamtest_status_type = score
}
postmaster_address = postmas...@firc.de
protocols = imap pop3 lmtp sieve
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666