# Cannot login using SquirrelMail

## guyfromcanada

Hello all,

I'm trying to run a mail server on my box at home. By following various guides, I have this configuration:

A domain with an MX Record

Sendmail for SMTP

Dovecot for IMAP

SquirrelMail or webmail

I have everything installed and (to my limited knowledge) installed correctly.

When I try to login, I always get: 

 *Quote:*   

> ERROR
> 
> Unknown user or password incorrect.

 

I've tried logging in with just the username, username@ipaddress, and username@domain.com, but I still get the same error.

My configtest.php states that everything is working correctly, so there shouldn't be any problems, right?

Can someone help me out? I don't know what logs to post or anything, so let me know.

--Nathan

----------

## magic919

Turn up the logging on Dovecot so you can see the auth problem.

----------

## guyfromcanada

Here's the log that I get. It doesn't seem to say a whole lot though.

dovecot: Apr 14 15:12:24 Info: Dovecot v1.0.rc15 starting up

dovecot: Apr 14 15:12:45 Info: imap-login: Aborted login: user=<nathan>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

----------

## bunder

check your max connections per-ip setting for dovecot.

cheers

----------

## guyfromcanada

I think it is set correctly, though I'm not sure of the exact line to edit.

Any other ideas?

Cheers,

GuyFromCanada

----------

## guyfromcanada

Alright, I fixed that problem by making /etc/pam.d/dovecot and adding

```
auth    required        pam_unix.so

account required        pam_unix.so
```

to that file, then creating /home/USER/.maildir and setting the proper permissions.

Cheers,

--Nathan

----------

## guyfromcanada

Ok, so I can log in and everything. But when I try to send an email to myself, it just sits there for a long time.

And my log shows:

```
dovecot: Apr 14 15:48:01 Info: imap-login: Login: user=<nathan>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

dovecot: Apr 14 15:48:01 Info: IMAP(nathan): Disconnected: Logged out

dovecot: Apr 14 15:48:17 Info: imap-login: Login: user=<nathan>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

dovecot: Apr 14 15:48:17 Info: IMAP(nathan): Disconnected: Logged out

dovecot: Apr 14 15:48:18 Info: imap-login: Login: user=<nathan>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured

dovecot: Apr 14 15:48:18 Info: IMAP(nathan): Disconnected: Logged out

dovecot: Apr 14 15:48:18 Info: IMAP(nathan): Disconnected: Logged out

dovecot: Apr 14 15:48:18 Info: imap-login: Login: user=<nathan>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
```

Why would it keep disconnecting me? Is that what's causing the problem?

Cheers,

GuyFromCanada

----------

## bunder

can you post your dovecot configuration file?

thanks

----------

## guyfromcanada

Alright, here goes:

```

## Dovecot configuration file

#base_dir = /var/run/dovecot/

protocols = pop3 imap

protocol pop3 {

  listen = *:10100

  ssl_listen = *:10995

}

#listen = [::]

disable_plaintext_auth = no

#shutdown_clients = yes

##

## Logging

##

log_path =/var/log/dovecot

#info_log_path =

#log_timestamp = "%b %d %H:%M:%S "

#syslog_facility = mail

##

## SSL settings

##

#ssl_listen =

#ssl_disable = no

#ssl_cert_file = /etc/ssl/certs/dovecot.pem

#ssl_key_file = /etc/ssl/private/dovecot.pem

#ssl_key_password =

#ssl_ca_file =

#ssl_verify_client_cert = no

#ssl_parameters_regenerate = 168

#ssl_cipher_list = ALL:!LOW

#verbose_ssl = no

##

## Login processes

##

#login_dir = /var/run/dovecot/login

#login_chroot = yes

#login_user = dovecot

#login_process_size = 32

login_process_per_connection = yes

#login_processes_count = 3

login_max_processes_count = 128

login_max_connections = 256

login_greeting = Dovecot ready.

#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c

#login_log_format = %$: %s

##

## Mailbox locations and namespaces

##

mail_location = maildir:~/.maildir

#namespace private {

   #separator =

   #prefix =

   #location =

   #inbox = yes

   #hidden = yes

#}

#mail_extra_groups =

#mail_full_filesystem_access = no

##

## Mail processes

##

#mail_debug = no

#mail_log_prefix = "%Us(%u): "

#mail_read_mmaped = no

#mmap_disable = no

#mmap_no_write = no

#lock_method = fcntl

#mail_drop_priv_before_exec = no

#verbose_proctitle = no

#first_valid_uid = 500

#last_valid_uid = 0

#first_valid_gid = 1

#last_valid_gid = 0

#max_mail_processes = 1024

#mail_process_size = 256

#mail_max_keyword_length = 50

#umask = 0077

#valid_chroot_dirs =

#mail_chroot =

##

## Mailbox handling optimizations

##

#mail_cache_fields =

#mail_never_cache_fields =

#mail_cache_min_mail_count = 0

#mailbox_idle_check_interval = 30

#mail_save_crlf = no

##

## Maildir-specific settings

##

#maildir_stat_dirs = no

#maildir_copy_with_hardlinks = no

##

## mbox-specific settings

##

#mbox_read_locks = fcntl

#mbox_write_locks = dotlock fcntl

#mbox_lock_timeout = 300

#mbox_dotlock_change_timeout = 120

#mbox_dirty_syncs = yes

#mbox_very_dirty_syncs = no

#mbox_lazy_writes = yes

#mbox_min_index_size = 0

##

## dbox-specific settings

##

#dbox_rotate_size = 2048

#dbox_rotate_min_size = 16

#dbox_rotate_days = 0

##

## IMAP specific settings

##

protocol imap {

  #login_executable = /usr/libexec/dovecot/imap-login

  #mail_executable = /usr/libexec/dovecot/imap

  #imap_max_line_length = 65536

  #mail_plugins =

  #mail_plugin_dir = /usr/lib/dovecot/imap

  #login_greeting_capability = no

  #imap_capability =

  #imap_client_workarounds = outlook-idle

}

##

## POP3 specific settings

##

protocol pop3 {

  #login_executable = /usr/libexec/dovecot/pop3-login

  #mail_executable = /usr/libexec/dovecot/pop3

  #pop3_no_flag_updates = no

  #pop3_enable_last = no

  #pop3_reuse_xuidl = no

  #pop3_lock_session = no

  pop3_uidl_format = %08Xu%08Xu

  #pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s

  #mail_plugins =

  #mail_plugin_dir = /usr/lib/dovecot/pop3

  #pop3_client_workarounds =

}

##

## LDA specific settings

##

protocol lda {

  postmaster_address = nathan.wiens<SPLAT>gmail.com

  #hostname =

  #mail_plugins =

  #mail_plugin_dir = /usr/lib/dovecot/lda

  #sendmail_path = /usr/lib/sendmail

  #auth_socket_path = /var/run/dovecot/auth-master

}

##

## Authentication processes

##

#auth_executable = /usr/libexec/dovecot/dovecot-auth

#auth_process_size = 256

#auth_cache_size = 0

#auth_cache_ttl = 3600

#auth_realms =

#auth_default_realm =

#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@

#auth_username_translation =

#auth_username_format =

#auth_master_user_separator =

#auth_anonymous_username = anonymous

#auth_verbose = no

#auth_debug = no

#auth_debug_passwords = no

#auth_worker_max_count = 30

#auth_krb5_keytab =

auth default {

mechanisms = plain

passdb pam {

}

userdb passwd {

}

socket listen {

}

#  client {

#  path = /var/spool/postfix/private/auth

#  mode = 660

#  user = postfix

#  group = postfix

# }

#auth default2 {

  # Space separated list of wanted authentication mechanisms:

  #   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi

 # mechanisms = plain

  #passdb passwd-file {

    # File contains a list of usernames, one per line

    #args = /etc/dovecot.deny

    #deny = yes

  #}

  #passdb pam {

  #}

  #passdb passwd {

  #}

  #passdb shadow {

  #}

  #passdb bsdauth {

    # [cache_key=<key>] - See cache_key in PAM for explanation.

    #args =

  #}

  #passdb passwd-file {

    # Path for passwd-file

    #args =

  #}

  #passdb checkpassword {

    # Path for checkpassword binary

    #args =

  #}

  #passdb sql {

    # Path for SQL configuration file, see doc/dovecot-sql.conf for example

    #args = /etc/dovecot-sql.conf

  #}

  #passdb ldap {

    # Path for LDAP configuration file, see doc/dovecot-ldap.conf for example

    #args =

  #}

  #passdb vpopmail {

    # [cache_key=<key>] - See cache_key in PAM for explanation.

    #args =

  #}

  #userdb passwd {

  #}

  #userdb passwd-file {

    # Path for passwd-file

    #args =

  #}

  #userdb static {

    #args =

  #}

  #userdb sql {

    # Path for SQL configuration file, see doc/dovecot-sql.conf for example

    #args = /etc/dovecot-sql.conf

  #}

  #userdb ldap {

    # Path for LDAP configuration file, see doc/dovecot-ldap.conf for example

    #args =

  #}

  # vpopmail

  # http://wiki.dovecot.org/AuthDatabase/VPopMail

  #userdb vpopmail {

  #}

  #userdb prefetch {

  #}

  #user = root

  #chroot =

  #count = 1

  #ssl_require_client_cert = no

  #ssl_username_from_cert = no

  #socket listen {

    #master {

      # Master socket is typically used to give Dovecot's local delivery

      # agent access to userdb so it can find mailbox locations. It can

      # however also be used to disturb regular user authentications.

      # WARNING: Giving untrusted users access to master socket may be a

      # security risk, don't give too wide permissions to it!

      #path = /var/run/dovecot/auth-master

      #mode = 0600

      # Default user/group is the one who started dovecot-auth (root)

      #user =

      #group =

    #}

    #client {

      # The client socket is generally safe to export to everyone. Typical use

      # is to export it to your SMTP server so it can do SMTP AUTH lookups

      # using it.

      #path = /var/run/dovecot/auth-client

      #mode = 0660

    #}

  #}

}

#auth external {

#  socket connect {

#    master {

#      path = /var/run/dovecot/auth-master

#    }

#  }

#}

##

## Dictionary server settings

##

dict {

  #quota = mysql:/etc/dovecot-dict-quota.conf

}

##

## Plugin settings

##

plugin {

  #quota = maildir

  #acl = vfile:/etc/dovecot-acls

  #convert_mail = mbox:%h/mail

  #trash = /etc/dovecot-trash.conf

```

I took out a lot of the commenting, but left in the commented code. Should all that stuff be commented? Or do I have to configure that all?

I hope you can see what's wrong.

Thanks in advance,

--GuyFromCanada

----------

## guyfromcanada

bump?

----------

## magic919

I'll repeat my previous.  You need to increase the logging level in Dovecot to see what goes on during the auth process.  Hint - look for verbose.

----------

## guyfromcanada

Alright, I turned on auth verbose as well as debug verbose. From what I see in the log, it still tells me nothing about why it's disconnecting me, or why it hangs when I try and email. Here's what I got:

```
dovecot: Apr 17 21:53:50 Info: auth(default): client in: AUTH   1       PLAIN   service=IMAP    secured lip=::ffff:127.0.0.1    rip=::ffff:127.0.0.1    resp$

dovecot: Apr 17 21:53:50 Info: auth(default): pam(nathan,::ffff:127.0.0.1): lookup service=IMAP

dovecot: Apr 17 21:53:50 Info: auth(default): client out: OK    1       user=nathan

dovecot: Apr 17 21:53:50 Info: auth(default): master in: REQUEST        3       10750   1

dovecot: Apr 17 21:53:50 Info: auth(default): passwd(nathan,::ffff:127.0.0.1): lookup

dovecot: Apr 17 21:53:50 Info: auth(default): master out: USER  3       nathan  system_user=nathan      uid=1000        gid=100 home=/home/nathan

dovecot: Apr 17 21:53:50 Info: imap-login: Login: user=<nathan>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured

dovecot: Apr 17 21:53:50 Info: IMAP(nathan): Disconnected: Logged out
```

Over and over. It doesn't look like there are any errors.

But sending email would be a problem with sendmail, right? Does sendmail give any logs?

Is there like a squirrelmail log or sendmail that I can post?

Cheers,

--GuyFromCanada

----------

## magic919

Just do the one thing at a time.  Sort out Dovecot and then move on.

For this log you've posted, did the password show up as rejected?  Secondary Q - Are you able to use another mail client for testing purposes?

----------

## guyfromcanada

According to the logs, there are no errors given, it looks like I logged in, and then logged out, but there were no warnings or errors.

I can log into squirrelmail fine, so I doubt that passwords is an issue. I just can't send or receive mail.

I also tried using pine, and in the help file, it said that if you leave the smtp server blank, it'll use sendmail. I tried to send an email to my gmail account, and according to pine it sent successfully, but I did not receive it.

Any ideas?

Cheers,

--GuyFromCanada

----------

## guni

 *guyfromcanada wrote:*   

> Alright, I fixed that problem by making /etc/pam.d/dovecot and adding
> 
> ```
> auth    required        pam_unix.so
> 
> ...

 

Thnx this helped.

----------

## pteppic

Can we see /etc/procmailrc and /etc/mail/sendmail.mc

Can you send mail with /sbin/sendmail <user>

Is there anything in /var/spool/mqueue/ (unsent mail)

Is there anything in /var/mail/<your user name>

----------

## guyfromcanada

For sure.

Here's my /etc/procmailrc:

```
DEFAULT=$HOME/.maildir/

# Use maildir-style mailbox in user's home directory
```

And here's my /etc/mail/sendmail.mc:

```
divert(-1)

divert(0)dnl

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl

VERSIONID(`$Id: sendmail-procmail.mc,v 1.2 2004/12/07 01:59:31 g2boojum Exp $')$

OSTYPE(linux)dnl

DOMAIN(generic)dnl

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl

FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl

FEATURE(`local_procmail')dnl

MAILER(local)dnl

MAILER(smtp)dnl

MAILER(procmail)dnl
```

There is nothing in any of those two directories. As for just using the sendmail command, it seems to be hung, not doing anything, so I don't know what to gather out of that.

Thanks for bringing this thread back up.

--Nathan

----------

