LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-18-2020, 06:33 PM   #1
spenced
Member
 
Registered: Oct 2017
Posts: 43

Rep: Reputation: Disabled
Dovecot authorization fails when trying to connect via Mutt but all suggested Dovecot auth tests work


I can't figure out why the dovecot authorization process is dropping the domain from my username when when attempting to connect through my client (mutt).

I'm using the simple auth-password userdb/passdb for authentication, have disabled auth-system (with PAM) for now, (it was clogging up the logs as I am only trying to setup up a virtual user). More explanation at the end.

Code:
doveadm auth test -x service=imap user@domain.id 
passdb: user@domain.id auth succeeded
extra fields:
  user=user@domain.id
and
Code:
dovecot auth test user@domain.id password
passdb: user@domain.id auth succeeded
extra fields:
  user=user@domain.id
and

Code:
telnet imap.domain.id 143
trying xx.xxx.xx.x
Connected to imap.domain.id
Escape character is '^]'
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot ready.
a login user password
 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY SPECIAL-USE]
Logged in
all good so far

mail.log:
Code:
Apr 18 14:42:32 dserver dovecot: auth: Debug: auth client connected (pid=1153208)
Apr 18 14:42:48 dserver dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011session=9z4GjJejPOpDqz0B#011lip=192.168.1.18#011rip=67.171.61.1#011lport=143#011rport=59964#011resp=AHNwZW5jZXJAZGF2ZXkuaWQAQmVuZGVyYmMx (previous base64 data may contain sensitive data)
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Performing passdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): lookup: user=user@domain.id file=/etc/dovecot/users
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Finished passdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: auth(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Auth request finished
Apr 18 14:42:48 dserver dovecot: auth: Debug: client passdb out: OK#0111#011user=user@domain.id
Apr 18 14:42:48 dserver dovecot: auth: Debug: master in: REQUEST#0112833514497#0111153208#0111#01168847acfe57555a93ec42d643c212c9b#011session_pid=1153448#011request_auth_token
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Performing userdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): lookup: user=user@domain.id file=/etc/dovecot/users
Apr 18 14:42:48 dserver dovecot: auth: Debug: passwd-file(user@domain.id,xx.xx.xx.x,<9z4GjJejPOpDqz0B>): Finished userdb lookup
Apr 18 14:42:48 dserver dovecot: auth: Debug: master userdb out: USER#0112833514497#011user#011uid=500#011gid=5000#011home=/var/vmail/domain/user/#011auth_token=10245b24c5981d5c412658bd640ac3dd0a1c3f57
Apr 18 14:42:48 dserver dovecot: imap-login: Login: user=<user@domain.id>, method=PLAIN, rip=xx.xx.xx.x, lip=192.168.1.18, mpid=1153448
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Effective uid=500, gid=5000, home=/var/vmail/domain.id/user/
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Home dir not found: /var/vmail/domain.id/user/
Apr 18 14:42:48 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Debug: Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir
Apr 18 14:42:48 dserver dovecot: imap(user@domian.id)<1153448><9z4GjJejPOpDqz0B>: Debug: maildir++: root=/var/vmail/domain.id/user//Maildir, index=, indexpvt=, control=, inbox=/var/vmail/domain.id/user//Maildir, alt=
Apr 18 14:42:59 dserver dovecot: imap(user@domain.id)<1153448><9z4GjJejPOpDqz0B>: Logged out in=19 out=520 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
now the failures:

Code:
mutt -f imap://user@domain.id
Password: *******
login failed
mail.log:

Code:
Apr 18 14:52:24 dserver dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Apr 18 14:52:24 dserver dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/lib20_auth_var_expand_crypt.so
Apr 18 14:52:24 dserver dovecot: auth: Debug: Read auth token secret from /var/run/dovecot//auth-token-secret.dat
Apr 18 14:52:24 dserver dovecot: auth: Debug: passwd-file /etc/dovecot/users: Read 1 users in 0 secs
Apr 18 14:52:24 dserver dovecot: auth: Debug: auth client connected (pid=1160786)
Apr 18 14:52:33 dserver dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured=tls#011session=fcvlrpejlutDqz0B#011lip=192.168.1.18#011rip=67.171.61.1#011lport=143#011rport=60310#011local_name=davey.id#011ssl_cipher=TLS_AES_256_GCM_SHA384#011ssl_cipher_bits=256#011ssl_pfs=KxANY#011ssl_protocol=TLSv1.3#011resp=c3BlbmNlcgBzcGVuY2VyAEJlbmRlcmJjMQ== (previous base64 data may contain sensitive data)
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Performing passdb lookup
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): lookup: user=user file=/etc/dovecot/users
Apr 18 14:52:33 dserver dovecot: auth: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): unknown user
Apr 18 14:52:33 dserver dovecot: auth: Debug: passwd-file(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Finished passdb lookup
Apr 18 14:52:33 dserver dovecot: auth: Debug: auth(user,xx.xxx.xx.x,<fcvlrpejlutDqz0B>): Auth request finished
Apr 18 14:52:35 dserver dovecot: auth: Debug: client passdb out: FAIL#0111#011user=user
Apr 18 14:55:24 dserver dovecot: imap-login: Disconnected: Inactivity (auth failed, 1 attempts in 171 secs): user=<user>, method=PLAIN, rip=xx.xxx.xx.x, lip=192.168.1.18, TLS
I want my `passdb` file to include the `@domain.id` in the user field to be able to differentiate same username different domains in one file. And also map my mailboxes as:

~/%d/%n/Maildir

It works correctly when I remove the `@domain.id` from the username field in my `passdb` file. I've read all about how dovecot doesn't care about domains and you can manipulate authentication with `%u` or `%n`

The problem is pretty obvious, my fixes just haven't worked. When logging in through Mutt, auth is dropping the `@domain.id` from the username so its not being authenticated in my passdb file. I have tried all combinations of:
Code:
auth_username_format = %u
auth_username_format = %n
and

Code:
passdb {
  driver = passwd-file
  args = scheme=CRYPT **username_format=%u** /etc/dovecot/passdb
}

passdb {
  driver = passwd-file
  args = scheme=CRYPT **username_format%n** /etc/dovecot/passdb
** is my emphesis

Why would IMAP authentication work differently from my telnet tests than from through Mutt? I did have to temporarily enable cleartext auth to test, but that's not affecting the mismatch of username in my passdb file. Is there somewhere else where username_format (or similar config) is defined? I've scoured everywhere the pass 24 hours.

Any help is greatly appreciated.
 
Old 04-18-2020, 11:04 PM   #2
spenced
Member
 
Registered: Oct 2017
Posts: 43

Original Poster
Rep: Reputation: Disabled
pulling my hair out looking in the wrong spot. the problem is with the way I was accessing by Mutt. Mutt -f is asking to look for a mailbox file, I'm assuming named <user>, so that's what gets sent to the authentication mechanism, ignoring '@domain.id`. Tried it with a different client and was able to successful create/access the account.

thanks for the views
 
  


Reply

Tags
authentication failure, dovecot, server



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GnuTLS-3.6.2 check error tests/anonymous-auth.scm RoLoR Linux From Scratch 1 06-24-2018 04:03 PM
dovecot-auth: pam_succeed_if(dovecot:auth): error retrieving information about user karsel Linux - Newbie 0 12-11-2012 07:44 AM
Postfix - allow non-auth connections from local network, relay mail via SASL AUTH fantasygoat Linux - Server 1 10-14-2011 04:45 PM
Able to connect via SSH but not able to connect via web port 80 Orange Sunshine Linux - Server 9 04-03-2010 07:11 PM
SASL Auth Tests Fail on Mail Server carlosinfl Linux - Server 3 11-24-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration