Dovecot postfix login failure

Discussion in 'Installation/Configuration' started by badmonkey, Feb 10, 2017.

  1. badmonkey

    badmonkey New Member

    OK. There is nothing in the /etc/dovecot/dovecot.conf file referring to /etc/dovecot/dovecot-sql.conf. Here is the file itself:

    Code:
    ## Dovecot configuration file
    
    # If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration
    
    # "doveconf -n" command gives a clean output of the changed settings. Use it
    # instead of copy&pasting files when posting to the Dovecot mailing list.
    
    # '#' character and everything after it is treated as comments. Extra spaces
    # and tabs are ignored. If you want to use either of these explicitly, put the
    # value inside quotes, eg.: key = "# char and trailing whitespace  "
    
    # Default values are shown for each setting, it's not required to uncomment
    # those. These are exceptions to this though: No sections (e.g. namespace {})
    # or plugin settings are added by default, they're listed only as examples.
    # Paths are also just examples with the real defaults being based on configure
    # options. The paths listed here are for configure --prefix=/usr
    # --sysconfdir=/etc --localstatedir=/var
    
    # Protocols we want to be serving.
    protocols = imap pop3 lmtp
    
    # A comma separated list of IPs or hosts where to listen in for connections.
    # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
    # If you want to specify non-default ports or anything more complex,
    # edit conf.d/master.conf.
    #listen = *, ::
    
    # Base directory where to store runtime data.
    #base_dir = /var/run/dovecot/
    
    # Greeting message for clients.
    #login_greeting = Dovecot ready.
    
    # Space separated list of trusted network ranges. Connections from these
    # IPs are allowed to override their IP addresses and ports (for logging and
    # for authentication checks). disable_plaintext_auth is also ignored for
    # these networks. Typically you'd specify your IMAP proxy servers here.
    #login_trusted_networks =
    
    # Sepace separated list of login access check sockets (e.g. tcpwrap)
    #login_access_sockets =
    
    # Show more verbose process titles (in ps). Currently shows user name and
    # IP address. Useful for seeing who are actually using the IMAP processes
    # (eg. shared mailboxes or if same uid is used for multiple accounts).
    #verbose_proctitle = no
    
    # Should all processes be killed when Dovecot master process shuts down.
    # Setting this to "no" means that Dovecot can be upgraded without
    # forcing existing client connections to close (although that could also be
    # a problem if the upgrade is e.g. because of a security fix).
    #shutdown_clients = yes
    
    # If non-zero, run mail commands via this many connections to doveadm server,
    # instead of running them directly in the same process.
    #doveadm_worker_count = 0
    # UNIX socket or host:port used for connecting to doveadm server
    #doveadm_socket_path = doveadm-server
    
    ##
    ## Dictionary server settings
    ##
    
    # Dictionary can be used to store key=value lists. This is used by several
    # plugins. The dictionary can be accessed either directly or though a
    # dictionary server. The following dict block maps dictionary names to URIs
    # when the server is used. These can then be referenced using URIs in format
    # "proxy::<name>".
    
    dict {
      #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
      #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
    }
    
    # Most of the actual configuration gets included below. The filenames are
    # first sorted by their ASCII value and parsed in that order. The 00-prefixes
    # in filenames are intended to make it easier to understand the ordering.
    !include conf.d/*.conf
    
    # A config file can also tried to be included without giving an error if
    # it's not found:
    #!include_try /etc/dovecot/local.conf
    
    
    

    However, the dovecot -n command gives:

    Code:
    # 2.0.9: /etc/dovecot/dovecot.conf
    # OS: Linux 2.6.32-642.13.1.el6.x86_64 x86_64 CentOS release 6.9 (Final)
    auth_verbose = yes
    log_path = /var/log/dovecot.log
    mail_debug = yes
    mbox_write_locks = fcntl
    passdb {
      driver = pam
    }
    passdb {
      args = /etc/dovecot/dovecot-sql.conf
      driver = sql
    }
    service auth {
      unix_listener /var/spool/postfix/private/auth {
        mode = 0666
      }
      unix_listener auth-userdb {
        group = postfix
        mode = 0666
        user = postfix
      }
    }
    ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
    ssl_key = </etc/pki/dovecot/private/dovecot.pem
    userdb {
      driver = passwd
    }
    
     
  2. ahrasis

    ahrasis Well-Known Member

    Code:
    passdb {
      args = /etc/dovecot/dovecot-sql.conf
      driver = sql
    [...]
    userdb {
      driver = passwd
    }
    
    1. Your userdb is not referring to the same file as referred to in passdb which I think it should.
    2. Your /etc/dovecot/dovecot-sql.conf doesn't have the code referred to earlier i.e. for accessing ISPC database.

    I think that are why you cannot access your email from roundcube / squirrelmail.

    I think ISPC should configure that when it is being installed like in Debian / Ubuntu, but I am not so sure with yours since your are using Centos.
     
  3. badmonkey

    badmonkey New Member

    Thank you so much ahrasis. Your suggestion in #1 fixed the login issue. Hurray!!!

    Sending emails from Roundcube works perfectly. Receiving email does not. Nothing shows up in the /var/vmail/domain/username/Maildir/cur folders either. Not even sending email to itself. Ideas?
     
  4. ahrasis

    ahrasis Well-Known Member

    Is your port opened for receiving emails? Try sending email from other services like gmail and see what is reported.
     
  5. badmonkey

    badmonkey New Member

    The port is open. Disabled the firewall to be certain. Sending from gmail results in....nothing. Absolutely nothing happens. No rejection message, no email, nothing in the logs, nothing that I can find.
     
  6. badmonkey

    badmonkey New Member

    Actually.....this is in the dovecot log:

    Code:
    auth: Info: pam([email protected],::1): unknown user

    Even though logging into roundcube was successful. Not sure if that has anything to do with it?
     
  7. ahrasis

    ahrasis Well-Known Member

    1. Any error reported by gmail?
    2. Have you set its dns properly?
    3. Have you tried free tools online to test that like this or use telnet yourself to test like this?
     
  8. badmonkey

    badmonkey New Member

    1. Nothing from gmail
    2. Best I can tell. Triple checked. DNS settings worked on the old server, all that changed was the IP.
    3. First tool says delivery is successful. Unable to send email by telnet.

    <unknown[IP]>: Client host rejected: Server configuration error

    Where to go from here?
     
  9. ahrasis

    ahrasis Well-Known Member

    Do check your postfix smtpd recipient restrictions.
     
  10. badmonkey

    badmonkey New Member

    Code:
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf
    Original form.

    Code:
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

    Shortening to this still doesn't work.
     
  11. ahrasis

    ahrasis Well-Known Member

    Is your server on a vps or behind a router?
     
  12. badmonkey

    badmonkey New Member

    No and not that I know. It is a full unmanaged server.
     
  13. ahrasis

    ahrasis Well-Known Member

    Basically it is your server configuration problem unless you have an unopened port. I would check all installation then all the configuration as suggested in here. In there, the problem are that postfix-mysql is missing and smtpd relay restrictions config is wrong. Other than that, I am not sure.
     
  14. badmonkey

    badmonkey New Member

    OK. Told ya I know very little about the mail stuff. lol. It shows. ;D

    Anyway, figured out the mail log was not working. Restarted rsyslog. Now the log is working with error messages. This should be useful. At least to someone who knows the mail stuff.

    Code:
    Jun  4 15:47:48 NC-PH-0936-24 postfix/trivial-rewrite[2083]: warning: do not list domain domain.com in BOTH virtual_mailbox_domains and relay_domains
    Jun  4 15:47:48 NC-PH-0936-24 postfix/cleanup[2084]: 3945F200D23: message-id=<[email protected]om>
    Jun  4 15:47:48 NC-PH-0936-24 postfix/qmgr[2025]: 3945F200D23: from=<[email protected]>, size=2473, nrcpt=1 (queue active)
    Jun  4 15:47:48 NC-PH-0936-24 postfix/error[2034]: 3945F200D23: to=<[email protected]>, relay=none, delay=0.2, delays=0.19/0/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)
    Jun  4 15:47:48 NC-PH-0936-24 postfix/error[2034]: warning: mysql query failed: MySQL server has gone away
    Jun  4 15:47:48 NC-PH-0936-24 postfix/error[2034]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
    Jun  4 15:47:49 NC-PH-0936-24 postfix/qmgr[2025]: warning: private/retry socket: malformed response
    Jun  4 15:47:49 NC-PH-0936-24 postfix/qmgr[2025]: warning: transport retry failure -- see a previous warning/fatal/panic logfile record for the problem description
    Jun  4 15:47:49 NC-PH-0936-24 postfix/master[2022]: warning: process /usr/libexec/postfix/error pid 2034 exit status 1
    Jun  4 15:47:49 NC-PH-0936-24 postfix/qmgr[2025]: 3945F200D23: to=<[email protected]>, relay=none, delay=1.2, delays=0.19/1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)
    Jun  4 15:47:49 NC-PH-0936-24 postfix/flush[2038]: warning: mysql query failed: MySQL server has gone away
    Jun  4 15:47:49 NC-PH-0936-24 postfix/flush[2038]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
    Jun  4 15:47:50 NC-PH-0936-24 postfix/qmgr[2025]: warning: 3945F200D23: flush service failure
    Jun  4 15:47:50 NC-PH-0936-24 postfix/master[2022]: warning: process /usr/libexec/postfix/flush pid 2038 exit status 1
    Jun  4 15:47:53 NC-PH-0936-24 postfix/smtpd[2080]: rewrite stream disconnect
    Jun  4 15:47:53 NC-PH-0936-24 postfix/smtpd[2080]: proxymap stream disconnect
    
    Sorry to be so much trouble. This is probably something very simple.
     
  15. ahrasis

    ahrasis Well-Known Member

    I can see postfix mysql error in there but I am not sure whether you did check it as mentioned before. Do also read this, maybe it could help further in resolving your postfix mysql error.

    If this my server, what I'll do is, make a backup, then reinstall and reconfigure everything relating to mail server (postfix + dovecot + roundcube / squirrelmail + update ispc) again, in their proper order.

    Hopefully, you can resolve this soon.
     
  16. badmonkey

    badmonkey New Member

    Ran the reconfigure process once again. Not sure how or why it was not working before. But this time did the trick. Mail is sent and received. Thanks so much for your advice ahrasis.
     
    ahrasis likes this.

Share This Page