Re: Authentication Problem with dovecot-2.3.0.1

2018-03-07 Thread Aki Tuomi


On 07.03.2018 22:07, Odhiambo Washington wrote:
> I am a little confused here.
>
> I have been running 2.2.34 which I installed in /opt/dovecot2.2
> I installed 2.3.0.1 to /opt/dovecot23
>
> I then used config files from /opt/dovecot2.2/etc/dovecot to
> /opt/dovecot2.3/etc/dovecot and all I did was sed -i.BAK
> 's/dovecot2.2/dovecot2.3/g'. Dovecot started and was running file.
>
> Next, I manually crafted config files for 2.3.0.1 based on the example
> config files provided which diff-ing those with what I had for 2.2.34.
> I doub't if I missed something crucial during the process.
>
> 1. I realized that I cannot start 2.3.0.1 when I enable submission,
> since my Exim MTA is already using that port. This persists even if I
> tell the submission protocol to use a different port than 587. I
> tested 2587, but it would appear that 587 is hard-coded!
>
> 2. I realize that "unix_listener auth-client" service ceased to exist!
>
> 3. *I realized that while 2.2.34 runs with default_pass_scheme =
> MD5-CRYPT, 2.3.0.1 would not run with it.*
> *
> *
> 4. I have run dovecot -n from my 2.2.x installation and 2.3.x
> installation and here is the diff from the two files.
>
> I am confused why authentication is failing with dovecot-2.3.0.1 when
> it uses 2.3.x config files using MD5-CRYPT scheme while it is
> succeeding with dovecot-2.2.34 using the same.
> *Mar 07 22:30:22 auth: Info: sql(user.n...@domain.name
> ,192.168.55.97,<4CETl9dmscvAqDdh>):
> Requested DIGEST-MD5 scheme, but we have only MD5-CRYPT*
>
> Maybe the problem is elsewhere??? I need a 3rd eye to help me.
>
> For now
>
> root@gw:~wash/public_html # sdiff dovecot-2.2.txt dovecot-2.3.txt | less
> # 2.2.34 (874deae): /opt/dovecot2.2/etc/dovecot/dovecot.conf  | #
> 2.3.0.1 (ffd8a29): /opt/dovecot2.3/etc/dovecot/dovecot.conf
> # OS: FreeBSD 9.3-STABLE i386  ufs                              # OS:
> FreeBSD 9.3-STABLE i386  ufs
> # Hostname: localhost                                         <
> auth_cache_size = 20 M                                         
> auth_cache_size = 20 M
> auth_master_user_separator = *                                 
> auth_master_user_separator = *
> auth_mechanisms = plain login digest-md5                       
> auth_mechanisms = plain login digest-md5
> auth_socket_path = /var/run/dovecot/auth-userdb               
>  auth_socket_path = /var/run/dovecot/auth-userdb
> base_dir = /var/run/dovecot/                                   
> base_dir = /var/run/dovecot/
> default_login_user = dovecot                                   
> default_login_user = dovecot
> disable_plaintext_auth = no                                   
>  disable_plaintext_auth = no
> first_valid_gid = 0                                           
>  first_valid_gid = 0
> first_valid_uid = 26                                           
> first_valid_uid = 26
> hostname = gw                                                 hostname
> = gw
> info_log_path = /var/log/dovecot.log                           
> info_log_path = /var/log/dovecot.log
> mail_location = maildir:/var/spool/virtual/%d/%n/Maildir:INDE 
>  mail_location = maildir:/var/spool/virtual/%d/%n/Maildir:INDE
> mail_plugins = " quota"                                       <
> namespace inbox {                                             
>  namespace inbox {
>   inbox = yes                                                   
>  inbox = yes
>   location =                                                     
> location =
>   mailbox Drafts {                                               
> mailbox Drafts {
>     special_use = \Drafts                                         
>  special_use = \Drafts
>   }                                                               }
>   mailbox Junk {                                                 
> mailbox Junk {
>     special_use = \Junk                                           
>  special_use = \Junk
>   }                                                               }
>   mailbox Sent {                                                 
> mailbox Sent {
>     special_use = \Sent                                           
>  special_use = \Sent
>   }                                                               }
>   mailbox "Sent Messages" {                                     
>  mailbox "Sent Messages" {
>     special_use = \Sent                                           
>  special_use = \Sent
>   }                                                               }
>   mailbox Trash {                                               
>  mailbox Trash {
>     special_use = \Trash                                           
> special_use = \Trash
>   }                                                               }
>   prefix =                                                        prefix =
> }                                                               }
> passdb {                                                        passdb {
>   args = 

Re: Virtual Mailboxes redux

2018-03-07 Thread Aki Tuomi


On 08.03.2018 03:09, @lbutlr wrote:
> On 2018-03-06 (14:41 MST), "@lbutlr"  wrote:
>>> and using "doveadm search mailbox $VIRTUAL_MAILBOX”
>> # doveadm search mailbox "@virtual.day" -u kremels 
>> #
> Any clues on this? As far as I can tell from the documentation and the list 
> this should work, but it is not.
>
You actually have a mailbox called '@virtual.day'?

Aki


Re: Virtual Mailboxes redux

2018-03-07 Thread @lbutlr
On 2018-03-06 (14:41 MST), "@lbutlr"  wrote:
> 
>> and using "doveadm search mailbox $VIRTUAL_MAILBOX”
> 
> # doveadm search mailbox "@virtual.day" -u kremels 
> #

Any clues on this? As far as I can tell from the documentation and the list 
this should work, but it is not.

-- 
'What good is a candle at noonday?' --Sourcery



last login tracking

2018-03-07 Thread David Mehler
Hello,

I've got dovecot going with postfix and MySQL database for user and
domain storage. Dovecot handles the authentication.

My last login is not working, does anyone have a table example and
configs? I looked at the wiki page on the lastlogin plugin but
obviously what I'm doing isn't working, I keep getting message write
was unsuccessful for the lastlogin ip.

I'd appreciate any help.

Thanks.
Dave.

#doveconf -n
# 2.2.34 (874deae): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.22 (22940fb7)
# OS: FreeBSD 11.1-RELEASE-p4 amd64
# Hostname: localhost
auth_cache_size = 10 M
auth_default_realm = example.com
auth_mechanisms = plain login
auth_realms = example.com example2.com
dict {
  acl = proxy:mysql:/usr/local/etc/dovecot/shared-folders.conf
  lastlogin = proxy:mysql:/usr/local/etc/dovecot/last-login.conf
  sqlquota = proxy:mysql:/usr/local/etc/dovecot/quota.conf
}
first_valid_gid = 999
first_valid_uid = 999
hostname = mail.example.com
imap_idle_notify_interval = 10 mins
last_valid_gid = 999
last_valid_uid = 999
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
lda_original_recipient_header = X-Original-To
listen = 127.0.0.1 xxx.xxx.xxx.xxx
lmtp_rcpt_check_quota = yes
mail_access_groups = vmail
mail_fsync = never
mail_gid = vmail
mail_home = /home/vmail/mailboxes/%d/%n
mail_location = maildir:~/mail:LAYOUT=fs
mail_plugins = acl mail_log notify quota quota_clone trash virtual welcome zlib
mail_privileged_group = vmail
mail_server_admin = mailto:postmas...@example.com
mail_uid = vmail
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 imapflags notify imapsieve vnd.dovecot.imapsieve
namespace {
  location = 
maildir:/home/vmail/public/:CONTROL=~/mail/public:INDEX=~/mail/public
  mailbox TestFolder {
auto = subscribe
comment = Public Folder for message sharing
  }
  prefix = Public/
  separator = /
  subscriptions = yes
  type = public
}
namespace {
  list = children
  location = maildir:%%h/Maildir:INDEXPVT=~/Maildir/shared/%%u
  prefix = shared/%%u/
  separator = /
  subscriptions = no
  type = shared
}
namespace inbox {
  inbox = yes
  location =
  mailbox Archive {
auto = no
special_use = \Archive
  }
  mailbox Archives {
auto = subscribe
special_use = \Archive
  }
  mailbox "Deleted Messages" {
auto = no
autoexpunge = 30 days
special_use = \Trash
  }
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = no
autoexpunge = 30 days
special_use = \Junk
  }
  mailbox "Junk E-mail" {
auto = no
autoexpunge = 30 days
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox "Sent Items" {
auto = no
special_use = \Sent
  }
  mailbox "Sent Messages" {
auto = no
special_use = \Sent
  }
  mailbox Spam {
auto = subscribe
autoexpunge = 30 days
special_use = \Junk
  }
  mailbox Trash {
auto = subscribe
autoexpunge = 30 days
special_use = \Trash
  }
  mailbox virtual/All {
comment = All my messages
special_use = \All
  }
  prefix =
  separator = /
  type = private
}
namespace virtual {
  location = 
virtual:/usr/local/etc/dovecot/virtual:INDEX=~/virtual:CONTROL=~/virtual
  prefix = virtual/
  separator = /
}
passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  acl = vfile:/usr/local/etc/dovecot/global-acls:cache_secs=300
  acl_anyone = allow
  acl_globals_only = yes
  acl_shared_dict = proxy::acl
  imapsieve_mailbox1_before = file:/home/vmail/sieve/global/learn-spam.sieve
  imapsieve_mailbox1_causes = COPY
  imapsieve_mailbox1_name = Spam
  imapsieve_mailbox2_before = file:/home/vmail/sieve/global/learn-ham.sieve
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_from = Spam
  imapsieve_mailbox2_name = *
  last_login_dict = proxy::lastlogin
  last_login_key = last-login/%u
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  mail_log_fields = uid box msgid size
  quota = count:User quota
  quota_clone_dict = proxy::sqlquota
  quota_exceeded_message = Storage quota for this account has been
exceeded, please try again later.
  quota_grace = 10%%
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_vsizes = true
  quota_warning = storage=100%% quota-exceeded 100 %u
  quota_warning2 = storage=95%% quota-warning 95 %u
  quota_warning3 = storage=90%% quota-warning 90 %u
  quota_warning4 = storage=85%% quota-warning 85 %u
  quota_warning5 = storage=75%% quota-warning 75 %u
  sieve = ~/.dovecot.sieve
  sieve_before = /home/vmail/sieve/before.d
  sieve_default = /home/vmail/sieve/default.sieve
  sieve_dir = 

(Solved) Re: Authentification fails in dovecot 2.3.0.1

2018-03-07 Thread Volker Wysk
Hi!

"Downgrading is possible to v2.2.27 and later. (v2.2.27 accidentally broke 
dovecot.index* backwards compatibility a bit.) "

I've thrown caution to the winds, and downgraded back to 2.2.22, by turning off 
the Dovecot-PPA, deinstalling 2.3.0.1, and installing 2.2.22 again from the 
Ubuntu package sources. Then I could at least log in to the dovecot server 
again.

But i still needed Pigeonhole 0.4.14, and in 2.2.22 there is only 0.4.13. "IMAP 
Sieve" is not added before 0.4.14. I have a Kubuntu 16.04.3 LTS System, and the 
contained version is only 2.2.22. So I downloaded and installed the needed 
dovecot packages from the newer Ubuntu version 17.10. That's version 2.2.27.

And now - I can log in, and there are no complaints about the 
IMAPSieve-configuration not being recognized. (I need IMAPSieve for the 
training of a spam filter). Now I can continue with that spam filter.

So far, I habe no problems with the broken indexes - yet(??) (see above).

Eventually it can be said that the problem is probably an incompatibility 
between the dovecot wich ich packaged for Ubuntu, and the version from the 
dovecot PPA.

Tschüß
Volker



AppArmor profile for Dovecot on Debian Stretch

2018-03-07 Thread André Rodier
Hello all,

Is there any guide to help in the configuration of Dovecot for AppArmor
on Debian / Ubuntu ? Or maybe does any of you already have something
that works?

I am actually adding AppArmor on an email server project, and I had some
trouble with the versions from Debian.

I would like to avoid - if possible - the long try and error process for
each Dovecot executable.

I am using IMAP, LMTP, Sieve and ManageSieve, with LDAP users. The full
project reference is here: https://github.com/progmaticltd/homebox

ii  dovecot-core   1:2.2.27-3+deb9u2 amd64
ii  dovecot-imapd  1:2.2.27-3+deb9u2 amd64
ii  dovecot-ldap   1:2.2.27-3+deb9u2 amd64
ii  dovecot-lmtpd  1:2.2.27-3+deb9u2 amd64
ii  dovecot-managesieved   1:2.2.27-3+deb9u2 amd64
ii  dovecot-pop3d  1:2.2.27-3+deb9u2 amd64
ii  dovecot-sieve  1:2.2.27-3+deb9u2 amd64

Thanks for your advices
André


Authentication Problem with dovecot-2.3.0.1

2018-03-07 Thread Odhiambo Washington
I am a little confused here.

I have been running 2.2.34 which I installed in /opt/dovecot2.2
I installed 2.3.0.1 to /opt/dovecot23

I then used config files from /opt/dovecot2.2/etc/dovecot to
/opt/dovecot2.3/etc/dovecot and all I did was sed -i.BAK
's/dovecot2.2/dovecot2.3/g'. Dovecot started and was running file.

Next, I manually crafted config files for 2.3.0.1 based on the example
config files provided which diff-ing those with what I had for 2.2.34. I
doub't if I missed something crucial during the process.

1. I realized that I cannot start 2.3.0.1 when I enable submission, since
my Exim MTA is already using that port. This persists even if I tell the
submission protocol to use a different port than 587. I tested 2587, but it
would appear that 587 is hard-coded!

2. I realize that "unix_listener auth-client" service ceased to exist!

3. *I realized that while 2.2.34 runs with default_pass_scheme = MD5-CRYPT,
2.3.0.1 would not run with it.*

4. I have run dovecot -n from my 2.2.x installation and 2.3.x installation
and here is the diff from the two files.

I am confused why authentication is failing with dovecot-2.3.0.1 when it
uses 2.3.x config files using MD5-CRYPT scheme while it is succeeding with
dovecot-2.2.34 using the same.
*Mar 07 22:30:22 auth: Info: sql(user.n...@domain.name
,192.168.55.97,<4CETl9dmscvAqDdh>): Requested
DIGEST-MD5 scheme, but we have only MD5-CRYPT*

Maybe the problem is elsewhere??? I need a 3rd eye to help me.

For now

root@gw:~wash/public_html # sdiff dovecot-2.2.txt dovecot-2.3.txt | less
# 2.2.34 (874deae): /opt/dovecot2.2/etc/dovecot/dovecot.conf  | # 2.3.0.1
(ffd8a29): /opt/dovecot2.3/etc/dovecot/dovecot.conf
# OS: FreeBSD 9.3-STABLE i386  ufs  # OS:
FreeBSD 9.3-STABLE i386  ufs
# Hostname: localhost <
auth_cache_size = 20 M
auth_cache_size = 20 M
auth_master_user_separator = *
auth_master_user_separator = *
auth_mechanisms = plain login digest-md5
auth_mechanisms = plain login digest-md5
auth_socket_path = /var/run/dovecot/auth-userdb
 auth_socket_path = /var/run/dovecot/auth-userdb
base_dir = /var/run/dovecot/base_dir =
/var/run/dovecot/
default_login_user = dovecot
default_login_user = dovecot
disable_plaintext_auth = no
 disable_plaintext_auth = no
first_valid_gid = 0
 first_valid_gid = 0
first_valid_uid = 26
first_valid_uid = 26
hostname = gw hostname = gw
info_log_path = /var/log/dovecot.log
info_log_path = /var/log/dovecot.log
mail_location = maildir:/var/spool/virtual/%d/%n/Maildir:INDE
 mail_location = maildir:/var/spool/virtual/%d/%n/Maildir:INDE
mail_plugins = " quota"   <
namespace inbox {   namespace
inbox {
  inbox = yes inbox =
yes
  location =  location =
  mailbox Drafts {mailbox
Drafts {
special_use = \Drafts
 special_use = \Drafts
  }   }
  mailbox Junk {  mailbox
Junk {
special_use = \Junk
 special_use = \Junk
  }   }
  mailbox Sent {  mailbox
Sent {
special_use = \Sent
 special_use = \Sent
  }   }
  mailbox "Sent Messages" {   mailbox
"Sent Messages" {
special_use = \Sent
 special_use = \Sent
  }   }
  mailbox Trash { mailbox
Trash {
special_use = \Trash
special_use = \Trash
  }   }
  prefix =prefix =
}   }
passdb {passdb {
  args = /opt/dovecot2.2/etc/dovecot/passwd.master_users.ext  |   args =
/opt/dovecot2.3/etc/dovecot/passwd.master_users.ext
  driver = passwd-filedriver =
passwd-file
  master = yesmaster =
yes
  pass = yes  pass = yes
}   }
passdb {passdb {
  args = /opt/dovecot2.2/etc/dovecot/dovecot-sql.conf.ext |   args =
/opt/dovecot2.3/etc/dovecot/dovecot-sql.conf.ext
  driver = sqldriver =
sql
}   }

Re: Coredump: Panic: file smtp-address.c: line 530 (smtp_address_write): assertion failed: (smtp_char_is_qpair(*p))

2018-03-07 Thread Stephan Bosch
Op 3/6/2018 om 2:46 AM schreef Stephan Bosch:
> Op 3/5/2018 om 3:14 PM schreef Ralf Hildebrandt:
>> Got a coredump:
>>
>> Mar  5 15:09:42 mail-cbf dovecot: 
>> lmtp(backup@backup.invalid)<15425><2B+kCaZPnVpBPAAAplP5LA>: Fatal: master: 
>> service(lmtp): child 15425 killed with signal 6 (core dumped)
> Hmm, yes, I think this an unnecessary RFC5322 -> RFC5321 address
> translation. Will look at making a fix tomorrow.

There is a fix pending review.

Regards,

Stephan.


Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Stephan Bosch
Op 3/7/2018 om 6:28 PM schreef Philipp Berger:
> Interesting, the documentation and the build-in help of dovecot-lda do
> not mention -r exists :)
>
> case 'r':
>
>   /* final recipient address */
>
>   if (smtp_address_parse_path(ctx.pool, optarg,
>
>   SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART |
>
>   SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL,
>
>   _rcpt_to, ) < 0) {
>
>   i_fatal_status(EX_USAGE,
>
>   "Invalid -a parameter: %s", errstr);
>
>
> Btw: Should the error message not read "Invalid -r parameter: %s" instead?

Yes, both problems fixed. Thanks.

Full documentation is here: https://wiki2.dovecot.org/LDA

>
> I think the problem is the different handling in Postfix and Dovecot:
> Postfix seems to automatically strip the quotes out of the username,
> at least for SQL lookup (but does the splitting correctly, which
> Dovecot 2.3 does NOT).

Can you specify which split is wrong in your opinion? If the MTA strips
necessary quotes before it is passed to dovecot- lda, Dovecot will
reject the address. That is not wrong.

> Dovecot does not strip quotes.

That depends on what Dovecot is working operating on. When it is
provided as a username (-d), it will not strip quotes. If it is an email
address (-a, -r, -f), it will strip quotes if they're unnecessary.
Internally, it uses an unquoted, split representation (localpart and
domain separately). Once it needs to compose the split addresses back
into a string, quotes are added only when needed.

> What is the recommended (i.e. endorsed by its developers) way for
> Dovecot to deal with Mail addresses containing Quotation marks? Strip
> them out? Keep them? Since they are disabled by default
> (auth_username_chars), it seems like stripping, but then the splitting
> of local part and domain does not work correctly.
> Am I really the first one to play around with this? Does it make sense
> to prepare patches for example for fixing the splitting?

Only if it is broken or breaks compatibility for existing setups in a
bad way (e.g. Dovecot allows some address syntax violations commonly
seen for some Asian ISPs).

> On a side note: Has support for UTF8 in local parts already landed in
> Dovecot? I could not find up-to-date information on this topic.

Not yet. We will be tending to that pretty soon though.

Regards,

Stephan.

>
> Am 07-Mar-18 um 15:50 schrieb Stephan Bosch:
>>
>>
>> Op 7-3-2018 om 15:40 schreef Stephan Bosch:
>>>
>>>
>>> Op 7-3-2018 om 13:46 schreef Philipp Berger:
 I wrapped the LDA command in a script. I can see that Postfix passes
 "@@mydomain.tld" as the -d argument, without quotes.
 I then adapted the script to specifically replace this address with
 "@"@mydomain.tld, but this results in the following error message by
 Dovecot:

  auth: Info: userdb(?): Username character disallowed by
 auth_username_chars: 0x22 (username: "@"@mydomain.tld)

 So what would be the appropriate quoting/setting for this address?
>>>
>>> Adding " to auth_username_chars would help.
>>>
>>> But why are you trying to accept such incredibly horrible
>>> email-addresses/usernames?
>>>
>> Also, -d is used to provide the username. For -d, you could leave out
>> the double quotes and provide the full e-mail address--including the
>> required quotes--to the -r argument.
>>
>> It all depends on what your userdb expects.
>>
>> Regards,
>>
>> Stephan.
>>
 Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:
>
> Op 6-3-2018 om 14:34 schreef Philipp Berger:
>> I upgraded to Dovecot 2.3.0.1 as advised, but it still seems
>> broken. In
>> the Postfix log I now see:
>>
>> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD
>> from
>>  -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
>> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
>> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
>> {RelayedInbound}, [someIp]:11439 [someIp]  ->
>> <"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
>> <22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
>> K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
>> Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
>> to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
>> delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
>> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
>> Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
>> to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
>> dsn=5.1.1, status=bounced (user unknown)
>> Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
>> message-id=<20180306124903.ea37e2da1...@mydomain.tld>
>> Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
>> non-delivery notification: EA37E2DA1F80
>> Mar  6 13:49:04 myhost postfix/qmgr[21911]: 

Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Philipp Berger
Interesting, the documentation and the build-in help of dovecot-lda do
not mention -r exists :)

case 'r':

/* final recipient address */

if (smtp_address_parse_path(ctx.pool, optarg,

SMTP_ADDRESS_PARSE_FLAG_ALLOW_LOCALPART |

SMTP_ADDRESS_PARSE_FLAG_BRACKETS_OPTIONAL,

_rcpt_to, ) < 0) {

i_fatal_status(EX_USAGE,

"Invalid -a parameter: %s", errstr);


Btw: Should the error message not read "Invalid -r parameter: %s" instead?

I think the problem is the different handling in Postfix and Dovecot:
Postfix seems to automatically strip the quotes out of the username, at
least for SQL lookup (but does the splitting correctly, which Dovecot
2.3 does NOT).
Dovecot does not strip quotes.

What is the recommended (i.e. endorsed by its developers) way for
Dovecot to deal with Mail addresses containing Quotation marks? Strip
them out? Keep them? Since they are disabled by default
(auth_username_chars), it seems like stripping, but then the splitting
of local part and domain does not work correctly.
Am I really the first one to play around with this? Does it make sense
to prepare patches for example for fixing the splitting?

On a side note: Has support for UTF8 in local parts already landed in
Dovecot? I could not find up-to-date information on this topic.

Kind regards,
Philipp

Am 07-Mar-18 um 15:50 schrieb Stephan Bosch:
>
>
> Op 7-3-2018 om 15:40 schreef Stephan Bosch:
>>
>>
>> Op 7-3-2018 om 13:46 schreef Philipp Berger:
>>> I wrapped the LDA command in a script. I can see that Postfix passes
>>> "@@mydomain.tld" as the -d argument, without quotes.
>>> I then adapted the script to specifically replace this address with
>>> "@"@mydomain.tld, but this results in the following error message by
>>> Dovecot:
>>>
>>>  auth: Info: userdb(?): Username character disallowed by
>>> auth_username_chars: 0x22 (username: "@"@mydomain.tld)
>>>
>>> So what would be the appropriate quoting/setting for this address?
>>
>> Adding " to auth_username_chars would help.
>>
>> But why are you trying to accept such incredibly horrible
>> email-addresses/usernames?
>>
> Also, -d is used to provide the username. For -d, you could leave out
> the double quotes and provide the full e-mail address--including the
> required quotes--to the -r argument.
>
> It all depends on what your userdb expects.
>
> Regards,
>
> Stephan.
>
>>> Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:

 Op 6-3-2018 om 14:34 schreef Philipp Berger:
> I upgraded to Dovecot 2.3.0.1 as advised, but it still seems
> broken. In
> the Postfix log I now see:
>
> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD from
>  -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
> {RelayedInbound}, [someIp]:11439 [someIp]  ->
> <"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
> <22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
> K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
> Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
> to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
> delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
> Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
> to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
> dsn=5.1.1, status=bounced (user unknown)
> Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
> message-id=<20180306124903.ea37e2da1...@mydomain.tld>
> Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
> non-delivery notification: EA37E2DA1F80
> Mar  6 13:49:04 myhost postfix/qmgr[21911]: EA37E2DA1F80: from=<>,
> size=9830, nrcpt=1 (queue active)
> Mar  6 13:49:04 myhost postfix/qmgr[21911]: B8CA22DA1B37: removed
> Mar  6 13:49:04 myhost postfix/pipe[2282]: EA37E2DA1F80:
> to=, relay=dovecot, delay=0.07,
> delays=0.05/0/0/0.02, dsn=5.3.0, status=bounced (command line usage
> error. Command output: lda: Fatal: Invalid -f parameter: Missing
> domain )
>
> I can see in my MySQL Log that Dovecot queried at the same time
> with %n
> = "" (empty) and %d = "@mydomain.tld". So now the "@" is dropped
> entirely.
>
> What does the "Fatal: Invalid -f parameter: Missing domain" tell
> us? Do
> I need to change the way Postfix calls Dovecot? Add more quotes? :D
 Can you check what Postfix is feeding to Dovecot exactly (i.e.,
 whether it is properly escaped)? Maybe wrap dovecot-lda in some shell
 script and see what is passed.

 Regards,

 Stephan.

> Kind regards,
> Philipp
>
> Am 04-Mar-18 um 21:12 schrieb 

Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Stephan Bosch



Op 7-3-2018 om 15:40 schreef Stephan Bosch:



Op 7-3-2018 om 13:46 schreef Philipp Berger:

I wrapped the LDA command in a script. I can see that Postfix passes
"@@mydomain.tld" as the -d argument, without quotes.
I then adapted the script to specifically replace this address with
"@"@mydomain.tld, but this results in the following error message by
Dovecot:

 auth: Info: userdb(?): Username character disallowed by
auth_username_chars: 0x22 (username: "@"@mydomain.tld)

So what would be the appropriate quoting/setting for this address?


Adding " to auth_username_chars would help.

But why are you trying to accept such incredibly horrible 
email-addresses/usernames?


Also, -d is used to provide the username. For -d, you could leave out 
the double quotes and provide the full e-mail address--including the 
required quotes--to the -r argument.


It all depends on what your userdb expects.

Regards,

Stephan.


Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:


Op 6-3-2018 om 14:34 schreef Philipp Berger:
I upgraded to Dovecot 2.3.0.1 as advised, but it still seems 
broken. In

the Postfix log I now see:

Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD from
 -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
{RelayedInbound}, [someIp]:11439 [someIp]  ->
<"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
<22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
dsn=5.1.1, status=bounced (user unknown)
Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
message-id=<20180306124903.ea37e2da1...@mydomain.tld>
Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
non-delivery notification: EA37E2DA1F80
Mar  6 13:49:04 myhost postfix/qmgr[21911]: EA37E2DA1F80: from=<>,
size=9830, nrcpt=1 (queue active)
Mar  6 13:49:04 myhost postfix/qmgr[21911]: B8CA22DA1B37: removed
Mar  6 13:49:04 myhost postfix/pipe[2282]: EA37E2DA1F80:
to=, relay=dovecot, delay=0.07,
delays=0.05/0/0/0.02, dsn=5.3.0, status=bounced (command line usage
error. Command output: lda: Fatal: Invalid -f parameter: Missing
domain )

I can see in my MySQL Log that Dovecot queried at the same time 
with %n

= "" (empty) and %d = "@mydomain.tld". So now the "@" is dropped
entirely.

What does the "Fatal: Invalid -f parameter: Missing domain" tell 
us? Do

I need to change the way Postfix calls Dovecot? Add more quotes? :D

Can you check what Postfix is feeding to Dovecot exactly (i.e.,
whether it is properly escaped)? Maybe wrap dovecot-lda in some shell
script and see what is passed.

Regards,

Stephan.


Kind regards,
Philipp

Am 04-Mar-18 um 21:12 schrieb Stephan Bosch:

Op 3/1/2018 om 2:07 PM schreef Philipp Berger:

Dear all,

I have a working setup with Postfix + Dovecot, storing users in a
MySQL
table.

I ran into problems setting up and using a mail address like
a"@"b...@mydomain.tld, which by RFC should be valid, but leads to
problems
in Dovecot. From my debugging, I can see that on the lookup, Dovecot
replaces %n with "a" (quotes added by me) and %d with 
"b...@mydomain.tld"

(quotes added by me). So the original quotes are gone, and the
domain/user split is incorrect.

I am not sure of Postfix passes the address without quotes to
Dovecot or
whether Dovecot can not handle quotes correctly, but I was hoping 
that

someone with more insight into Dovecot could help me out here.

System Info: Debian 9, Postifx 3.1.6-0+deb9u1, Dovecot 
2.2.27-3+deb9u1

Postfix master.cf for Dovecot:
dovecot unix  -   n   n   -   - pipe
    flags=DRhu user=virtual:virtual
argv=/usr/lib/dovecot/dovecot-lda -f
${sender} -d ${user}@${nexthop}

I am grateful for any hints :)

Thank you in advance, kind regards,
Yeah, Dovecot v2.2 is doing some funky stuff with SMTP address 
parsing.
Dovecot v2.3 should do a better job. I am still not sure if this 
can be

fixed well for Dovecot v2.2.

Regards,

Stephan.










Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Stephan Bosch



Op 7-3-2018 om 13:46 schreef Philipp Berger:

I wrapped the LDA command in a script. I can see that Postfix passes
"@@mydomain.tld" as the -d argument, without quotes.
I then adapted the script to specifically replace this address with
"@"@mydomain.tld, but this results in the following error message by
Dovecot:

     auth: Info: userdb(?): Username character disallowed by
auth_username_chars: 0x22 (username: "@"@mydomain.tld)

So what would be the appropriate quoting/setting for this address?


Adding " to auth_username_chars would help.

But why are you trying to accept such incredibly horrible 
email-addresses/usernames?


Regards,

Stephan.


Kind regards,
Philipp

Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:


Op 6-3-2018 om 14:34 schreef Philipp Berger:

I upgraded to Dovecot 2.3.0.1 as advised, but it still seems broken. In
the Postfix log I now see:

Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD from
 -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
{RelayedInbound}, [someIp]:11439 [someIp]  ->
<"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
<22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
dsn=5.1.1, status=bounced (user unknown)
Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
message-id=<20180306124903.ea37e2da1...@mydomain.tld>
Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
non-delivery notification: EA37E2DA1F80
Mar  6 13:49:04 myhost postfix/qmgr[21911]: EA37E2DA1F80: from=<>,
size=9830, nrcpt=1 (queue active)
Mar  6 13:49:04 myhost postfix/qmgr[21911]: B8CA22DA1B37: removed
Mar  6 13:49:04 myhost postfix/pipe[2282]: EA37E2DA1F80:
to=, relay=dovecot, delay=0.07,
delays=0.05/0/0/0.02, dsn=5.3.0, status=bounced (command line usage
error. Command output: lda: Fatal: Invalid -f parameter: Missing
domain )

I can see in my MySQL Log that Dovecot queried at the same time with %n
= "" (empty) and %d = "@mydomain.tld". So now the "@" is dropped
entirely.

What does the "Fatal: Invalid -f parameter: Missing domain" tell us? Do
I need to change the way Postfix calls Dovecot? Add more quotes? :D

Can you check what Postfix is feeding to Dovecot exactly (i.e.,
whether it is properly escaped)? Maybe wrap dovecot-lda in some shell
script and see what is passed.

Regards,

Stephan.


Kind regards,
Philipp

Am 04-Mar-18 um 21:12 schrieb Stephan Bosch:

Op 3/1/2018 om 2:07 PM schreef Philipp Berger:

Dear all,

I have a working setup with Postfix + Dovecot, storing users in a
MySQL
table.

I ran into problems setting up and using a mail address like
a"@"b...@mydomain.tld, which by RFC should be valid, but leads to
problems
in Dovecot. From my debugging, I can see that on the lookup, Dovecot
replaces %n with "a" (quotes added by me) and %d with "b...@mydomain.tld"
(quotes added by me). So the original quotes are gone, and the
domain/user split is incorrect.

I am not sure of Postfix passes the address without quotes to
Dovecot or
whether Dovecot can not handle quotes correctly, but I was hoping that
someone with more insight into Dovecot could help me out here.

System Info: Debian 9, Postifx 3.1.6-0+deb9u1, Dovecot 2.2.27-3+deb9u1
Postfix master.cf for Dovecot:
dovecot unix  -   n   n   -   -   pipe
    flags=DRhu user=virtual:virtual
argv=/usr/lib/dovecot/dovecot-lda -f
${sender} -d ${user}@${nexthop}

I am grateful for any hints :)

Thank you in advance, kind regards,

Yeah, Dovecot v2.2 is doing some funky stuff with SMTP address parsing.
Dovecot v2.3 should do a better job. I am still not sure if this can be
fixed well for Dovecot v2.2.

Regards,

Stephan.








Re: Why does dovecot tell Error: passwd-file(...)failed: No such file or directory?

2018-03-07 Thread Sergio Belkin
Thanks Aki,


That made the trick!

2018-03-07 11:01 GMT-03:00 Aki Tuomi :

> My bad. Userdb does not support scheme keyvalue, just remove it.
>
> Aki
>
> > On 07 March 2018 at 15:57 Sergio Belkin  wrote:
> >
> >
> > Aki,
> >
> > thanks, I fixed typo but error persists:
> > Mar  7 10:55:54 mail dovecot: auth: Debug: auth client connected
> (pid=10828)
> > Mar  7 10:55:55 mail dovecot: auth: Debug: client in:
> > AUTH#0111#011CRAM-MD5#011service=imap#011secured#
> 011session=FIH/6tJm4gDAqHoB#011lip=192.168.122.202#011rip=
> 192.168.122.1#011lport=993#011rport=37090
> > Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
> > CONT#0111#011PDMyOTk2ODcwMzIwNDE3NzcuMTUyMDQzMDk1NUBtYWlsLmV4YW1wbGUuY
> 29tPg==
> > Mar  7 10:55:55 mail dovecot: auth: Debug: client in: CONT
> > Mar  7 10:55:55 mail dovecot: auth: Debug:
> > passwd-file(ser...@example.com,192.168.122.1,):
> > lookup: user=ser...@example.com file=/etc/dovecot/users
> > Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
> > OK#0111#011user=ser...@example.com
> > Mar  7 10:55:55 mail dovecot: auth: Debug: master in:
> > REQUEST#0112148007937#01110828#0111#0114822ce6f85f005835d4d0448b81
> 25868#011session_pid=10829#011request_auth_token
> > Mar  7 10:55:55 mail dovecot: auth: Error:
> > passwd-file(ser...@example.com,192.168.122.1,):
> > stat(scheme=CRAM-MD5 username_format=ser...@example.com
> /etc/dovecot/users)
> > failed: No such file or directory
> > Mar  7 10:55:55 mail dovecot: auth: Debug: master userdb out:
> > USER#0112148007937#
> > 011ser...@example.com#011uid=12345#011gid=12345#011home=/
> home/vmail/ser...@example.com#011auth_token=9ec7a9d5ad07e594e9ed483db5f7fc
> 533bfd7202
> > Mar  7 10:55:55 mail dovecot: imap-login: Login: user=<
> ser...@example.com>,
> > method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10829, TLS,
> > session=
> >
> > TIA
> >
> > 2018-03-07 10:48 GMT-03:00 Aki Tuomi :
> >
> > > Fix typo, you have schme.
> > >
> > > Aki
> > >
> > > On 07.03.2018 15:47, Sergio Belkin wrote:
> > >
> > > Hi,
> > >
> > > I get this error even when user logins succesfully:
> > >
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: client in:
> > > AUTH#0111#011CRAM-MD5#011service=imap#011secured#
> > > 011session=maOgttJmCADAqHoB#011lip=192.168.122.202#011rip=
> > > 192.168.122.1#011lport=993#011rport=36872
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> CONT#0111#
> > > 011PDYyMjM4NTMwODIyODI0MDguMTUyMDQzMDA3NkBtYWlsLmV4YW1wbGUuY29tPg==
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: client in: CONT
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: passwd-file(
> ser...@example.com
> > > ,192.168.122.1,): lookup: user=ser...@example.com
> > > file=/etc/dovecot/users
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> > > OK#0111#011user=ser...@example.com
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: master in:
> > > REQUEST#0112080243713#01110733#0111#011b99fa14550a72c26f219b7dd4ff
> > > a6f27#011session_pid=10736#011request_auth_token
> > > Mar  7 10:41:16 mail dovecot: auth: Error: passwd-file(
> ser...@example.com
> > > ,192.168.122.1,): stat(schme=CRAM-MD5
> username_format=
> > > ser...@example.com /etc/dovecot/users) failed: No such file or
> directory
> > > Mar  7 10:41:16 mail dovecot: auth: Debug: master userdb out:
> > > USER#0112080243713#011ser...@example.com#011uid=12345#
> > > 011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=
> > > 34a7660e0c85afacd29709561b0bc7e024942955
> > >  23011home=/home/vmail/ser...@example.com%23011auth_token=
> 34a7660e0c85afacd29709561b0bc7e024942955>
> > > Mar  7 10:41:16 mail dovecot: imap-login: Login: user=<
> ser...@example.com>,
> > > method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10736,
> TLS,
> > > session=
> > >
> > >
> > > Is that an error, a warning? I don't understand why dovecot tell me
> that
> > > "No such file or directory" because really it does exist.
> > >
> > > Dovecot configuration is as follows:
> > >
> > > auth_debug = yes
> > > auth_mechanisms = cram-md5 plain login
> > > auth_verbose = yes
> > > disable_plaintext_auth = no
> > > first_valid_uid = 1000
> > > mail_location = maildir:/home/vmail/%d/%n/Maildir
> > > mbox_write_locks = fcntl
> > > 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 {
> > >   args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
> > >   driver = passwd-file
> > > }
> > > service auth {
> > >   unix_listener /var/spool/postfix/private/auth {
> > >  

Re: Why does dovecot tell Error: passwd-file(...)failed: No such file or directory?

2018-03-07 Thread Aki Tuomi
My bad. Userdb does not support scheme keyvalue, just remove it.

Aki

> On 07 March 2018 at 15:57 Sergio Belkin  wrote:
> 
> 
> Aki,
> 
> thanks, I fixed typo but error persists:
> Mar  7 10:55:54 mail dovecot: auth: Debug: auth client connected (pid=10828)
> Mar  7 10:55:55 mail dovecot: auth: Debug: client in:
> AUTH#0111#011CRAM-MD5#011service=imap#011secured#011session=FIH/6tJm4gDAqHoB#011lip=192.168.122.202#011rip=192.168.122.1#011lport=993#011rport=37090
> Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
> CONT#0111#011PDMyOTk2ODcwMzIwNDE3NzcuMTUyMDQzMDk1NUBtYWlsLmV4YW1wbGUuY29tPg==
> Mar  7 10:55:55 mail dovecot: auth: Debug: client in: CONT
> Mar  7 10:55:55 mail dovecot: auth: Debug:
> passwd-file(ser...@example.com,192.168.122.1,):
> lookup: user=ser...@example.com file=/etc/dovecot/users
> Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
> OK#0111#011user=ser...@example.com
> Mar  7 10:55:55 mail dovecot: auth: Debug: master in:
> REQUEST#0112148007937#01110828#0111#0114822ce6f85f005835d4d0448b8125868#011session_pid=10829#011request_auth_token
> Mar  7 10:55:55 mail dovecot: auth: Error:
> passwd-file(ser...@example.com,192.168.122.1,):
> stat(scheme=CRAM-MD5 username_format=ser...@example.com /etc/dovecot/users)
> failed: No such file or directory
> Mar  7 10:55:55 mail dovecot: auth: Debug: master userdb out:
> USER#0112148007937#
> 011ser...@example.com#011uid=12345#011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=9ec7a9d5ad07e594e9ed483db5f7fc533bfd7202
> Mar  7 10:55:55 mail dovecot: imap-login: Login: user=,
> method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10829, TLS,
> session=
> 
> TIA
> 
> 2018-03-07 10:48 GMT-03:00 Aki Tuomi :
> 
> > Fix typo, you have schme.
> >
> > Aki
> >
> > On 07.03.2018 15:47, Sergio Belkin wrote:
> >
> > Hi,
> >
> > I get this error even when user logins succesfully:
> >
> > Mar  7 10:41:16 mail dovecot: auth: Debug: client in:
> > AUTH#0111#011CRAM-MD5#011service=imap#011secured#
> > 011session=maOgttJmCADAqHoB#011lip=192.168.122.202#011rip=
> > 192.168.122.1#011lport=993#011rport=36872
> > Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out: CONT#0111#
> > 011PDYyMjM4NTMwODIyODI0MDguMTUyMDQzMDA3NkBtYWlsLmV4YW1wbGUuY29tPg==
> > Mar  7 10:41:16 mail dovecot: auth: Debug: client in: CONT
> > Mar  7 10:41:16 mail dovecot: auth: Debug: passwd-file(ser...@example.com
> > ,192.168.122.1,): lookup: user=ser...@example.com
> > file=/etc/dovecot/users
> > Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> > OK#0111#011user=ser...@example.com
> > Mar  7 10:41:16 mail dovecot: auth: Debug: master in:
> > REQUEST#0112080243713#01110733#0111#011b99fa14550a72c26f219b7dd4ff
> > a6f27#011session_pid=10736#011request_auth_token
> > Mar  7 10:41:16 mail dovecot: auth: Error: passwd-file(ser...@example.com
> > ,192.168.122.1,): stat(schme=CRAM-MD5 username_format=
> > ser...@example.com /etc/dovecot/users) failed: No such file or directory
> > Mar  7 10:41:16 mail dovecot: auth: Debug: master userdb out:
> > USER#0112080243713#011ser...@example.com#011uid=12345#
> > 011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=
> > 34a7660e0c85afacd29709561b0bc7e024942955
> > 
> > Mar  7 10:41:16 mail dovecot: imap-login: Login: user=,
> > method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10736, TLS,
> > session=
> >
> >
> > Is that an error, a warning? I don't understand why dovecot tell me that
> > "No such file or directory" because really it does exist.
> >
> > Dovecot configuration is as follows:
> >
> > auth_debug = yes
> > auth_mechanisms = cram-md5 plain login
> > auth_verbose = yes
> > disable_plaintext_auth = no
> > first_valid_uid = 1000
> > mail_location = maildir:/home/vmail/%d/%n/Maildir
> > mbox_write_locks = fcntl
> > 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 {
> >   args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
> >   driver = passwd-file
> > }
> > service auth {
> >   unix_listener /var/spool/postfix/private/auth {
> > mode = 0666
> >   }
> > }
> > ssl_cert =  > ssl_key =  > userdb {
> >   args = schme=CRAM-MD5 username_format=%u /etc/dovecot/users
> >   driver = passwd-file
> > }
> > userdb {
> >   args = uid=vmail gid=vmail home=/home/vmail/%u
> >   driver = static
> > }
> >
> > EOF
> >
> > Thanks in advance
> > --
> > --
> > Sergio Belkin
> > LPIC-2 Certified - 

Re: Why does dovecot tell Error: passwd-file(...)failed: No such file or directory?

2018-03-07 Thread Sergio Belkin
Aki,

thanks, I fixed typo but error persists:
Mar  7 10:55:54 mail dovecot: auth: Debug: auth client connected (pid=10828)
Mar  7 10:55:55 mail dovecot: auth: Debug: client in:
AUTH#0111#011CRAM-MD5#011service=imap#011secured#011session=FIH/6tJm4gDAqHoB#011lip=192.168.122.202#011rip=192.168.122.1#011lport=993#011rport=37090
Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
CONT#0111#011PDMyOTk2ODcwMzIwNDE3NzcuMTUyMDQzMDk1NUBtYWlsLmV4YW1wbGUuY29tPg==
Mar  7 10:55:55 mail dovecot: auth: Debug: client in: CONT
Mar  7 10:55:55 mail dovecot: auth: Debug:
passwd-file(ser...@example.com,192.168.122.1,):
lookup: user=ser...@example.com file=/etc/dovecot/users
Mar  7 10:55:55 mail dovecot: auth: Debug: client passdb out:
OK#0111#011user=ser...@example.com
Mar  7 10:55:55 mail dovecot: auth: Debug: master in:
REQUEST#0112148007937#01110828#0111#0114822ce6f85f005835d4d0448b8125868#011session_pid=10829#011request_auth_token
Mar  7 10:55:55 mail dovecot: auth: Error:
passwd-file(ser...@example.com,192.168.122.1,):
stat(scheme=CRAM-MD5 username_format=ser...@example.com /etc/dovecot/users)
failed: No such file or directory
Mar  7 10:55:55 mail dovecot: auth: Debug: master userdb out:
USER#0112148007937#
011ser...@example.com#011uid=12345#011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=9ec7a9d5ad07e594e9ed483db5f7fc533bfd7202
Mar  7 10:55:55 mail dovecot: imap-login: Login: user=,
method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10829, TLS,
session=

TIA

2018-03-07 10:48 GMT-03:00 Aki Tuomi :

> Fix typo, you have schme.
>
> Aki
>
> On 07.03.2018 15:47, Sergio Belkin wrote:
>
> Hi,
>
> I get this error even when user logins succesfully:
>
> Mar  7 10:41:16 mail dovecot: auth: Debug: client in:
> AUTH#0111#011CRAM-MD5#011service=imap#011secured#
> 011session=maOgttJmCADAqHoB#011lip=192.168.122.202#011rip=
> 192.168.122.1#011lport=993#011rport=36872
> Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out: CONT#0111#
> 011PDYyMjM4NTMwODIyODI0MDguMTUyMDQzMDA3NkBtYWlsLmV4YW1wbGUuY29tPg==
> Mar  7 10:41:16 mail dovecot: auth: Debug: client in: CONT
> Mar  7 10:41:16 mail dovecot: auth: Debug: passwd-file(ser...@example.com
> ,192.168.122.1,): lookup: user=ser...@example.com
> file=/etc/dovecot/users
> Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> OK#0111#011user=ser...@example.com
> Mar  7 10:41:16 mail dovecot: auth: Debug: master in:
> REQUEST#0112080243713#01110733#0111#011b99fa14550a72c26f219b7dd4ff
> a6f27#011session_pid=10736#011request_auth_token
> Mar  7 10:41:16 mail dovecot: auth: Error: passwd-file(ser...@example.com
> ,192.168.122.1,): stat(schme=CRAM-MD5 username_format=
> ser...@example.com /etc/dovecot/users) failed: No such file or directory
> Mar  7 10:41:16 mail dovecot: auth: Debug: master userdb out:
> USER#0112080243713#011ser...@example.com#011uid=12345#
> 011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=
> 34a7660e0c85afacd29709561b0bc7e024942955
> 
> Mar  7 10:41:16 mail dovecot: imap-login: Login: user=,
> method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10736, TLS,
> session=
>
>
> Is that an error, a warning? I don't understand why dovecot tell me that
> "No such file or directory" because really it does exist.
>
> Dovecot configuration is as follows:
>
> auth_debug = yes
> auth_mechanisms = cram-md5 plain login
> auth_verbose = yes
> disable_plaintext_auth = no
> first_valid_uid = 1000
> mail_location = maildir:/home/vmail/%d/%n/Maildir
> mbox_write_locks = fcntl
> 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 {
>   args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
>   driver = passwd-file
> }
> service auth {
>   unix_listener /var/spool/postfix/private/auth {
> mode = 0666
>   }
> }
> ssl_cert =  ssl_key =  userdb {
>   args = schme=CRAM-MD5 username_format=%u /etc/dovecot/users
>   driver = passwd-file
> }
> userdb {
>   args = uid=vmail gid=vmail home=/home/vmail/%u
>   driver = static
> }
>
> EOF
>
> Thanks in advance
> --
> --
> Sergio Belkin
> LPIC-2 Certified - http://www.lpi.org
>
>
>


-- 
--
Sergio Belkin
LPIC-2 Certified - http://www.lpi.org


Re: Why does dovecot tell Error: passwd-file(...)failed: No such file or directory?

2018-03-07 Thread Aki Tuomi
Fix typo, you have schme.

Aki


On 07.03.2018 15:47, Sergio Belkin wrote:
> Hi,
>
> I get this error even when user logins succesfully:
>
> Mar  7 10:41:16 mail dovecot: auth: Debug: client in:
> AUTH#0111#011CRAM-MD5#011service=imap#011secured#011session=maOgttJmCADAqHoB#011lip=192.168.122.202#011rip=192.168.122.1#011lport=993#011rport=36872
> Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> CONT#0111#011PDYyMjM4NTMwODIyODI0MDguMTUyMDQzMDA3NkBtYWlsLmV4YW1wbGUuY29tPg==
> Mar  7 10:41:16 mail dovecot: auth: Debug: client in: CONT
> Mar  7 10:41:16 mail dovecot: auth: Debug:
> passwd-file(ser...@example.com
> ,192.168.122.1,): lookup:
> user=ser...@example.com 
> file=/etc/dovecot/users
> Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
> OK#0111#011user=ser...@example.com 
> Mar  7 10:41:16 mail dovecot: auth: Debug: master in:
> REQUEST#0112080243713#01110733#0111#011b99fa14550a72c26f219b7dd4ffa6f27#011session_pid=10736#011request_auth_token
> Mar  7 10:41:16 mail dovecot: auth: Error:
> passwd-file(ser...@example.com
> ,192.168.122.1,):
> stat(schme=CRAM-MD5 username_format=ser...@example.com
>  /etc/dovecot/users) failed: No such file
> or directory
> Mar  7 10:41:16 mail dovecot: auth: Debug: master userdb out:
> USER#0112080243713#011ser...@example.com#011uid=12345#011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=34a7660e0c85afacd29709561b0bc7e024942955
> 
> Mar  7 10:41:16 mail dovecot: imap-login: Login:
> user=>,
> method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10736,
> TLS, session=
>
>
> Is that an error, a warning? I don't understand why dovecot tell me
> that "No such file or directory" because really it does exist.
>
> Dovecot configuration is as follows:
>
> auth_debug = yes
> auth_mechanisms = cram-md5 plain login
> auth_verbose = yes
> disable_plaintext_auth = no
> first_valid_uid = 1000
> mail_location = maildir:/home/vmail/%d/%n/Maildir
> mbox_write_locks = fcntl
> 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 {
>   args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
>   driver = passwd-file
> }
> service auth {
>   unix_listener /var/spool/postfix/private/auth {
>     mode = 0666
>   }
> }
> ssl_cert =  ssl_key =  userdb {
>   args = schme=CRAM-MD5 username_format=%u /etc/dovecot/users
>   driver = passwd-file
> }
> userdb {
>   args = uid=vmail gid=vmail home=/home/vmail/%u
>   driver = static
> }
>
> EOF
>
> Thanks in advance
> -- 
> --
> Sergio Belkin
> LPIC-2 Certified - http://www.lpi.org



Why does dovecot tell Error: passwd-file(...)failed: No such file or directory?

2018-03-07 Thread Sergio Belkin
Hi,

I get this error even when user logins succesfully:

Mar  7 10:41:16 mail dovecot: auth: Debug: client in:
AUTH#0111#011CRAM-MD5#011service=imap#011secured#011session=maOgttJmCADAqHoB#011lip=192.168.122.202#011rip=192.168.122.1#011lport=993#011rport=36872
Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
CONT#0111#011PDYyMjM4NTMwODIyODI0MDguMTUyMDQzMDA3NkBtYWlsLmV4YW1wbGUuY29tPg==
Mar  7 10:41:16 mail dovecot: auth: Debug: client in: CONT
Mar  7 10:41:16 mail dovecot: auth: Debug:
passwd-file(ser...@example.com,192.168.122.1,):
lookup: user=ser...@example.com file=/etc/dovecot/users
Mar  7 10:41:16 mail dovecot: auth: Debug: client passdb out:
OK#0111#011user=ser...@example.com
Mar  7 10:41:16 mail dovecot: auth: Debug: master in:
REQUEST#0112080243713#01110733#0111#011b99fa14550a72c26f219b7dd4ffa6f27#011session_pid=10736#011request_auth_token
Mar  7 10:41:16 mail dovecot: auth: Error:
passwd-file(ser...@example.com,192.168.122.1,):
stat(schme=CRAM-MD5 username_format=ser...@example.com /etc/dovecot/users)
failed: No such file or directory
Mar  7 10:41:16 mail dovecot: auth: Debug: master userdb out:
USER#0112080243713#
011ser...@example.com#011uid=12345#011gid=12345#011home=/home/vmail/ser...@example.com#011auth_token=34a7660e0c85afacd29709561b0bc7e024942955
Mar  7 10:41:16 mail dovecot: imap-login: Login: user=,
method=CRAM-MD5, rip=192.168.122.1, lip=192.168.122.202, mpid=10736, TLS,
session=


Is that an error, a warning? I don't understand why dovecot tell me that
"No such file or directory" because really it does exist.

Dovecot configuration is as follows:

auth_debug = yes
auth_mechanisms = cram-md5 plain login
auth_verbose = yes
disable_plaintext_auth = no
first_valid_uid = 1000
mail_location = maildir:/home/vmail/%d/%n/Maildir
mbox_write_locks = fcntl
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 {
  args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users
  driver = passwd-file
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
mode = 0666
  }
}
ssl_cert = http://www.lpi.org


Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Reio Remma

Hello!

Maybe experiment with auth_username_chars:

# List of allowed characters in username. If the user-given username contains
# a character not listed in here, the login automatically fails. This is just
# an extra check to make sure user can't exploit any potential quote escaping
# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
# set this value to empty.
#auth_username_chars = 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@

Good luck,
Reio

On 07.03.18 14:46, Philipp Berger wrote:

I wrapped the LDA command in a script. I can see that Postfix passes
"@@mydomain.tld" as the -d argument, without quotes.
I then adapted the script to specifically replace this address with
"@"@mydomain.tld, but this results in the following error message by
Dovecot:

 auth: Info: userdb(?): Username character disallowed by
auth_username_chars: 0x22 (username: "@"@mydomain.tld)

So what would be the appropriate quoting/setting for this address?

Kind regards,
Philipp

Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:


Op 6-3-2018 om 14:34 schreef Philipp Berger:

I upgraded to Dovecot 2.3.0.1 as advised, but it still seems broken. In
the Postfix log I now see:

Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD from
 -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
{RelayedInbound}, [someIp]:11439 [someIp]  ->
<"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
<22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
dsn=5.1.1, status=bounced (user unknown)
Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
message-id=<20180306124903.ea37e2da1...@mydomain.tld>
Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
non-delivery notification: EA37E2DA1F80
Mar  6 13:49:04 myhost postfix/qmgr[21911]: EA37E2DA1F80: from=<>,
size=9830, nrcpt=1 (queue active)
Mar  6 13:49:04 myhost postfix/qmgr[21911]: B8CA22DA1B37: removed
Mar  6 13:49:04 myhost postfix/pipe[2282]: EA37E2DA1F80:
to=, relay=dovecot, delay=0.07,
delays=0.05/0/0/0.02, dsn=5.3.0, status=bounced (command line usage
error. Command output: lda: Fatal: Invalid -f parameter: Missing
domain )

I can see in my MySQL Log that Dovecot queried at the same time with %n
= "" (empty) and %d = "@mydomain.tld". So now the "@" is dropped
entirely.

What does the "Fatal: Invalid -f parameter: Missing domain" tell us? Do
I need to change the way Postfix calls Dovecot? Add more quotes? :D

Can you check what Postfix is feeding to Dovecot exactly (i.e.,
whether it is properly escaped)? Maybe wrap dovecot-lda in some shell
script and see what is passed.

Regards,

Stephan.


Kind regards,
Philipp

Am 04-Mar-18 um 21:12 schrieb Stephan Bosch:

Op 3/1/2018 om 2:07 PM schreef Philipp Berger:

Dear all,

I have a working setup with Postfix + Dovecot, storing users in a
MySQL
table.

I ran into problems setting up and using a mail address like
a"@"b...@mydomain.tld, which by RFC should be valid, but leads to
problems
in Dovecot. From my debugging, I can see that on the lookup, Dovecot
replaces %n with "a" (quotes added by me) and %d with "b...@mydomain.tld"
(quotes added by me). So the original quotes are gone, and the
domain/user split is incorrect.

I am not sure of Postfix passes the address without quotes to
Dovecot or
whether Dovecot can not handle quotes correctly, but I was hoping that
someone with more insight into Dovecot could help me out here.

System Info: Debian 9, Postifx 3.1.6-0+deb9u1, Dovecot 2.2.27-3+deb9u1
Postfix master.cf for Dovecot:
dovecot unix  -   n   n   -   -   pipe
flags=DRhu user=virtual:virtual
argv=/usr/lib/dovecot/dovecot-lda -f
${sender} -d ${user}@${nexthop}

I am grateful for any hints :)

Thank you in advance, kind regards,

Yeah, Dovecot v2.2 is doing some funky stuff with SMTP address parsing.
Dovecot v2.3 should do a better job. I am still not sure if this can be
fixed well for Dovecot v2.2.

Regards,

Stephan.




Re: Mail addresses with quotes + Postfix

2018-03-07 Thread Philipp Berger
I wrapped the LDA command in a script. I can see that Postfix passes
"@@mydomain.tld" as the -d argument, without quotes.
I then adapted the script to specifically replace this address with
"@"@mydomain.tld, but this results in the following error message by
Dovecot:

    auth: Info: userdb(?): Username character disallowed by
auth_username_chars: 0x22 (username: "@"@mydomain.tld)

So what would be the appropriate quoting/setting for this address?

Kind regards,
Philipp

Am 06-Mar-18 um 15:08 schrieb Stephan Bosch:
>
>
> Op 6-3-2018 om 14:34 schreef Philipp Berger:
>> I upgraded to Dovecot 2.3.0.1 as advised, but it still seems broken. In
>> the Postfix log I now see:
>>
>> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) K00VtLRHdrYw FWD from
>>  -> <"@"@mydomain.tld>, BODY=7BIT 250 2.0.0 from
>> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37
>> Mar  6 13:49:03 myhost amavis[7165]: (07165-10) Passed CLEAN
>> {RelayedInbound}, [someIp]:11439 [someIp]  ->
>> <"@"@mydomain.tld>, Queue-ID: D27792DA167C, Message-ID:
>> <22b95756-e95e-86cf-219c-3b603f758...@mydomain.tld>, mail_id:
>> K00VtLRHdrYw, Hits: -3, size: 7472, queued_as: B8CA22DA1B37, 1863 ms
>> Mar  6 13:49:03 myhost postfix/smtp[2329]: D27792DA167C:
>> to=<@@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10024, delay=2,
>> delays=0.15/0.01/0/1.9, dsn=2.0.0, status=sent (250 2.0.0 from
>> MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8CA22DA1B37)
>> Mar  6 13:49:03 myhost postfix/pipe[2282]: B8CA22DA1B37:
>> to=<@@mydomain.tld>, relay=dovecot, delay=0.2, delays=0.11/0/0/0.09,
>> dsn=5.1.1, status=bounced (user unknown)
>> Mar  6 13:49:03 myhost postfix/cleanup[2280]: EA37E2DA1F80:
>> message-id=<20180306124903.ea37e2da1...@mydomain.tld>
>> Mar  6 13:49:04 myhost postfix/bounce[2334]: B8CA22DA1B37: sender
>> non-delivery notification: EA37E2DA1F80
>> Mar  6 13:49:04 myhost postfix/qmgr[21911]: EA37E2DA1F80: from=<>,
>> size=9830, nrcpt=1 (queue active)
>> Mar  6 13:49:04 myhost postfix/qmgr[21911]: B8CA22DA1B37: removed
>> Mar  6 13:49:04 myhost postfix/pipe[2282]: EA37E2DA1F80:
>> to=, relay=dovecot, delay=0.07,
>> delays=0.05/0/0/0.02, dsn=5.3.0, status=bounced (command line usage
>> error. Command output: lda: Fatal: Invalid -f parameter: Missing
>> domain )
>>
>> I can see in my MySQL Log that Dovecot queried at the same time with %n
>> = "" (empty) and %d = "@mydomain.tld". So now the "@" is dropped
>> entirely.
>>
>> What does the "Fatal: Invalid -f parameter: Missing domain" tell us? Do
>> I need to change the way Postfix calls Dovecot? Add more quotes? :D
>
> Can you check what Postfix is feeding to Dovecot exactly (i.e.,
> whether it is properly escaped)? Maybe wrap dovecot-lda in some shell
> script and see what is passed.
>
> Regards,
>
> Stephan.
>
>>
>> Kind regards,
>> Philipp
>>
>> Am 04-Mar-18 um 21:12 schrieb Stephan Bosch:
>>> Op 3/1/2018 om 2:07 PM schreef Philipp Berger:
 Dear all,

 I have a working setup with Postfix + Dovecot, storing users in a
 MySQL
 table.

 I ran into problems setting up and using a mail address like
 a"@"b...@mydomain.tld, which by RFC should be valid, but leads to
 problems
 in Dovecot. From my debugging, I can see that on the lookup, Dovecot
 replaces %n with "a" (quotes added by me) and %d with "b...@mydomain.tld"
 (quotes added by me). So the original quotes are gone, and the
 domain/user split is incorrect.

 I am not sure of Postfix passes the address without quotes to
 Dovecot or
 whether Dovecot can not handle quotes correctly, but I was hoping that
 someone with more insight into Dovecot could help me out here.

 System Info: Debian 9, Postifx 3.1.6-0+deb9u1, Dovecot 2.2.27-3+deb9u1
 Postfix master.cf for Dovecot:
 dovecot unix  -   n   n   -   -   pipe
    flags=DRhu user=virtual:virtual
 argv=/usr/lib/dovecot/dovecot-lda -f
 ${sender} -d ${user}@${nexthop}

 I am grateful for any hints :)

 Thank you in advance, kind regards,
>>> Yeah, Dovecot v2.2 is doing some funky stuff with SMTP address parsing.
>>> Dovecot v2.3 should do a better job. I am still not sure if this can be
>>> fixed well for Dovecot v2.2.
>>>
>>> Regards,
>>>
>>> Stephan.
>>
>>
>




Re: extra IMAP folders: how to make all clients use the same Sent folder?

2018-03-07 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 28 Feb 2018, Stanislaw Findeisen wrote:


I have just setup IMAP with Maildir, but unfortunately some clients
create their own folders instead of using those specified in
15-mailboxes.conf . What could be the reason?


Because the clients do so.


Here's what it looks like:


B list "" *
* LIST (\HasNoChildren \Sent) "." "Sent Messages"
* LIST (\HasNoChildren) "." Gesendet
* LIST (\HasNoChildren) "." Entw
* LIST (\HasNoChildren \Trash) "." Trash
* LIST (\HasNoChildren) "." Papierkorb
* LIST (\HasNoChildren \Drafts) "." Drafts
* LIST (\HasNoChildren \Sent) "." Sent
* LIST (\HasNoChildren) "." Ausgang
* LIST (\HasNoChildren \Junk) "." Junk
* LIST (\HasNoChildren) "." INBOX
B OK List completed.


Here for example "Gesendet" (meaning "Sent" in German) is a folder
created by some Android client app. This app uses it to store its sent
mail, while another client uses the Sent folder.


Yeah. If the blue traffic sign with the bicycle on it tags the left road, 
many bicycles will choose this way, but some still choose the right road 
with the blue traffic sign with the pedestrian on it.


The "\Sent" is a hint for client, which way to go. Either force your users 
to use another client, re-configure their client manuelly, or - sometimes 
- - the mail client needs to refresh its configuration.



Also, is it correct that all those folders (both pre-made and extra) get
created directly in the user's maildir, alongside cur, new, tmp and
Dovecot index files? Shouldn't there be any subdir?


Yes. What kind of subdir do you expect?

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBWp++r8QnQQNheMxiAQKA+gf9FbHKK8aOvmK2wMKw7KCG2M/tIP/jG3th
5aGdiEzWAoiU9RNlAhW+7I8mzRknnmdoUI5wOGNLUdvlXxbYm0MBUuL8JJufNOCl
7eJ15/J03MWgPMKdANs2TePZNyNEtvkLxKNQJbYw4QY1AtaUXS1brPa8/qaIiHmo
Nts9UWs1c/to1MzMPjWbBjkmlQ6ftKs8q6UkhQ+xv1YdfqD9ObV3xWIJHzWiUDFL
zU7SnpwEm3m8Vj+z47NVFvtDDSk23CarFx3XnVXH56ThFPZU5VXqfsNxdwkY7gRz
3hs3dicwWNLf87jtTDL9o2d0cYj3KqZvgmmMAOapoY/dnq0U993mAA==
=NbrQ
-END PGP SIGNATURE-


Re: Cannot delete folder

2018-03-07 Thread Aki Tuomi


On 06.03.2018 21:55, Yves Goergen wrote:
> Hi there,
>
> I cannot delete IMAP folders in new mailboxes. When trying to delete a
> folder in Thunderbird I get the error message "renaming not supported
> across conflicting directory permissions". Looking up the error on the
> web led me to checking the mailbox directory's permissions. They're
> inconsistent in new mailboxes. While every single directory in an old
> mailbox has "drwx--S---", some of the directories in a new mailbox
> have "drwxr-sr-x" instead. I'm not sure what that means. The folders
> with the later permissions are "Drafts", "Sent" and "Trash". Folders
> with the first permissions are "Junk", "Archives" and "Archives.2018".
> All folders were created by Thunderbird automatically. Now I wanted to
> delete "Archives.2018".
>
> What's the issue here? Why do folders created by the same MUA in the
> same event on the same mail server have different permissions and why
> can't I delete one of them (which would probably move it into the
> trash folder first)?
>
> Dovecot version is 2.2.22 on Ubuntu 16.04, Thunderbird is 52.6.0 on
> Windows 10.
>
> -Yves

Your problem is that your Trash folder appears to be on different volume
than the folder you are attempting to delete.

Aki