0

Versions: Debian 11 5.10.92-1 x86_64 - nginx/1.21.6 - mysql 15.1 10.5.12-MariaDB - PHP 7.4.25 (cli) - dovecot-core/stable,now 1:2.3.13+dfsg1-2

I've got my postfix/dovecot configration working for receiving emails. After switching from rainloop to roundcube, I can't see any inbox emails in roundcube web. But occasionally I will login to roundcube and I will see all my emails in the inbox, but if I click on anything or refresh the page, they all disappear. Sending emails from roundcube also just results in an endless loading wheel with no timeout.

Unfortunately roundcube has no error logs, and dovecot only has successful login logs. Nothing to indicate that anything is broken; other than the dissapearing emails.

/var/log/mail.info:

Feb  6 13:30:52 mail dovecot: imap-login: Login: user=<admin@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9717, secured, session=<WKMOr13Xss5/AAAB>
Feb  6 13:30:52 mail dovecot: imap(admin@domain.com)<9717><WKMOr13Xss5/AAAB>: Logged out in=82 out=756 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Feb  6 13:30:52 mail dovecot: imap-login: Login: user=<admin@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9719, secured, session=<ZuEPr13Xts5/AAAB>
Feb  6 13:30:52 mail dovecot: imap(admin@domain.com)<9719><ZuEPr13Xts5/AAAB>: Logged out in=44 out=739 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Feb  6 13:30:56 mail dovecot: imap-login: Login: user=<admin@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9723, secured, session=<cedKr13XuM5/AAAB>
Feb  6 13:30:56 mail dovecot: imap(admin@domain.com)<9723><cedKr13XuM5/AAAB>: Logged out in=44 out=739 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0

/var/log/roundcube/error.log is empty.

I am pretty sure its something with IMAP on dovecot, since login works, but the retrieval of emails only works about 10% of the time. Without any error logs to troubleshoot, I don't know where to go from here, other than trial and error messing with config files.

Can anyone please help?

.

I have excluded a lot of the configs because of how massive they are. I can add any additional conf files, but I thought these were most relevant.

Roundcube Configuration:

<?php

$config = array();

// Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database!
include_once("/etc/roundcube/debian-db-roundcube.php");

$config['default_host'] = 'localhost';

$config['smtp_server'] = 'localhost';

// SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
$config['smtp_port'] = 587;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';

// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
$config['des_key'] = 'k';

// List of active plugins (in plugins/ directory)
// Debian: install roundcube-plugins first to have any
$config['plugins'] = array(
);

// skin name: folder from skins/
$config['skin'] = 'elastic';

// Disable spellchecking
// Debian: spellchecking needs additional packages to be installed, or calling external APIs
//         see defaults.inc.php for additional informations
$config['enable_spellcheck'] = false;

<?php
$dbuser='roundcube';
$dbpass='pass';
$basepath='';
$dbname='roundcube';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';
<?php
include_once("/etc/roundcube/debian-db.php");

switch ($dbtype) {
 case "sqlite":
 case "sqlite3":
   $config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640";
   break;
 default:
   if ($dbport != '') $dbport=":$dbport";
   if ($dbserver == '') $dbserver="localhost";
   $config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname";
   break;
 }
?>

Dovecot configuration:

## Dovecot configuration file

# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol
protocols = imap pop3 lmtp
listen = *
postmaster_address = postmaster at aperturecorp.net

##
## Dictionary server settings
##

dict {
  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}

!include conf.d/*.conf

# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext

driver = mysql
connect = host=127.0.0.1 dbname=mailsrvdb user=maildbuser password=pass
default_pass_scheme = SHA512-CRYPT
password_query = SELECT email as user, password FROM virtual_users WHERE email='%u';

##
## Authentication processes
##

disable_plaintext_auth = yes
auth_mechanisms = plain login
!include auth-system.conf.ext

##
## Mailbox locations and namespaces
##

mail_location = maildir:/var/mail/vhosts/%d/%n/

namespace inbox {
  inbox = yes
}

mail_privileged_group = mail

protocol !indexer-worker {
}

service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}

service pop3-login {
  inet_listener pop3 {
    port = 0
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}

service submission-login {
  inet_listener submission {
    #port = 587
  }
}

service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    #mode = 0666i
    mode = 0600
    user = postfix
    group = postfix
  }
}

service imap {
  # Most of the memory goes to mmap()ing files. You may need to increase this
  # limit if you have huge mailboxes.
  #vsz_limit = $default_vsz_limit

  # Max. number of IMAP processes (connections)
  #process_limit = 1024
}

service pop3 {
  # Max. number of POP3 processes (connections)
  #process_limit = 1024
}

service submission {
  # Max. number of SMTP Submission processes (connections)
  #process_limit = 1024
}

service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0660
    user = postfix
    group = postfix
  }

  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }

  user = dovecot
}

service auth-worker {
  # Auth worker process is run as root by default, so that it can access
  # /etc/shadow. If this isn't necessary, the user should be changed to
  # $default_internal_user.
  user = vmail
}

service dict {
  # If dict proxy is used, mail processes should have access to its socket.
  # For example: mode=0660, group=vmail and global mail_access_groups=vmail
  unix_listener dict {
    #mode = 0600
    #user = 
    #group = 
  }
}
##
## SSL settings
##

ssl = required

ssl_cert = </etc/ssl/certs/mailtls-selfsigned.crt 
ssl_key = </etc/ssl/private/mailtls-selfsigned.key

ssl_client_ca_dir = /etc/ssl/certs

ssl_dh = </usr/share/dovecot/dh.pem

##
## LDA specific settings (also used by LMTP)
##

protocol lda {
}

##
## Mailbox definitions
##

namespace inbox {
  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Trash {
    special_use = \Trash
  }

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
}
##
## IMAP specific settings
##

protocol imap {
}

##
## LMTP specific settings
##
protocol lmtp {

# Authentication via dict backend. Included from 10-auth.conf.
#
# <doc/wiki/AuthDatabase.Dict.txt>

passdb {
  driver = dict
  args = /etc/dovecot/dovecot-dict-auth.conf.ext
}

userdb {
  driver = dict
  args = /etc/dovecot/dovecot-dict-auth.conf.ext
}

# Authentication for system users. Included from 10-auth.conf.
passdb {
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf.ext
}

userdb {
  driver = static
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
}
ehammer
  • 75
  • 1
  • 10

0 Answers0