# dovecot login problem [SOLVED]

## thecooptoo

ive added a user to test this with (npgf2)

and set the users password from the command line

ie 

```

grenada Maildir # passwd npgf2

New UNIX password:

Retype new UNIX password:

passwd: password updated successfully

grenada Maildir #

```

and then im trying to log in using IMAP 

```

grenada Maildir # cat /etc/dovecot/dovecot.conf  |grep -v '#'

protocols = imap

listen = [::]

disable_plaintext_auth = no

log_path = /var/log/dovecot.log

ssl_listen =

ssl_disable = yes

ssl_cert_file = /etc/ssl/dovecot/server.pem

ssl_key_file = /etc/ssl/dovecot/server.key

mail_location = maildir:~/Maildir

protocol imap {

}

protocol pop3 {

pop3_uidl_format = %08Xv%08Xu

}

protocol lda {

  postmaster_address = postmaster@example.com

}

auth_debug = yes

auth_debug_passwords = yes

auth default {

  mechanisms = plain

  passdb passwd {

  }

 userdb passwd {

  }

  user = root

}

dict {

}

plugin {

}

grenada Maildir #

```

and this happens when i try and log in from thunderbird 

```
dovecot: Dec 01 18:34:10 Info: auth(default): client in: AUTH   1       PLAIN   service=IMAP    lip=::ffff:192.168.0.254        rip=::ffff:192.168.0.207

dovecot: Dec 01 18:34:10 Info: auth(default): client out: CONT  1

dovecot: Dec 01 18:34:10 Info: auth(default): client in: CONT   1       AG5wZGMxAHhsbjM0cA==

dovecot: Dec 01 18:34:10 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): lookup

dovecot: Dec 01 18:34:10 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): Password mismatch

dovecot: Dec 01 18:34:10 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): CRYPT(xln34p) != 'x'

dovecot: Dec 01 18:34:12 Info: auth(default): client out: FAIL  1       user=npgf2

dovecot: Dec 01 18:34:12 Info: auth(default): client in: AUTH   2       PLAIN   service=IMAP    lip=::ffff:192.168.0.254        rip=::ffff:192.168.0.207resp=AG5wZGMxAHhsbjM0cA==

dovecot: Dec 01 18:34:12 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): lookup

dovecot: Dec 01 18:34:12 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): Password mismatch

dovecot: Dec 01 18:34:12 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): CRYPT(xln34p) != 'x'

dovecot: Dec 01 18:34:14 Info: auth(default): client out: FAIL  2       user=npgf2

```

the password for testing this is xln34p.

where is the problem ?

----------

## ScOut3R

Something's wrong with the password or the way you are sending the password from the client to dovecot. Are you sending the password from thunderbird in plain mode?

----------

## thecooptoo

use secure connection  in th'bird  is never .

and use secure authentication is unchecked 

( cant find the text file in windows ( whixh is why im doing this )  to show the setup

----------

## Stever

```
dovecot: Dec 01 18:34:10 Info: auth(default): passwd(npgf2,::ffff:192.168.0.207): CRYPT(xln34p) != 'x' 
```

I don't think you can use "passwd" as both your userdb and passdb.  It is getting "x" from the /etc/passwd since passwords are no longer actually stored there.

Take a look here for your other options.

 *Quote:*   

> Passwd
> 
> User is looked up using getpwnam() call, which usually looks into /etc/passwd file, but depending on NSS configuration it may also look up the user from eg. LDAP database.
> 
> Most commonly used as a user database. Many systems use shadow passwords nowadays so it doesn't usually work as a password database. BSDs are an exception to this, they still set the password field even with shadow passwords.
> ...

 

----------

## thecooptoo

this works

```
grenada ~ # dovecot -n

# 1.0.3: /etc/dovecot/dovecot.conf

log_path: /var/log/dovecot.log

protocols: imap

listen: [::]

ssl_disable: yes

ssl_cert_file: /etc/ssl/dovecot/server.pem

ssl_key_file: /etc/ssl/dovecot/server.key

disable_plaintext_auth: no

login_dir: /var/run/dovecot/login

login_executable: /usr/libexec/dovecot/imap-login

mail_location: maildir:~/Maildir

auth default:

  debug: yes

  debug_passwords: yes

  passdb:

    driver: shadow

  userdb:

    driver: passwd

grenada ~ #

```

----------

