Author Topic: Can send Emails, but not receive  (Read 1806 times)

Offline REtender

  • Newbie
  • *
  • Posts: 3
Can send Emails, but not receive
« on: December 31, 2022, 08:05:32 AM »
Hello,

im struggling with Roundcube since nearly 1 Year and I don't know what to do anymore.

I'm, able to send Emails to Gmail for Example and my Gmail account is receiving the Email... but when clicking on "sent" Email there is no entry in Roundcube.
After replying from my Gmail Account, there is no incoming Email on Roundcube.

Adding the Email Account to Thunderbird, I can send and receive Emails, so it's just Roundcube related.

This is my config.inc.php

Code: [Select]
<?php

$config 
= [];
$config[&#39;db_dsnw&#39;] = &#39;mysql://123@localhost/123&#39;;

$config[&#39;default_host&#39;] = &#39;imap.DOMAIN.de&#39;;
$config[&#39;default_port&#39;] = 143;

$config[&#39;imap_conn_options&#39;] = array(
        
&#39;ssl&#39; => array(
        
&#39;verify_peer&#39;       => false,
        
&#39;verify_peer_name&#39;  => false,
        
&#39;cafile&#39;  => &#39;https://letsencrypt.org/certs/isrgrootx1.pem&#39;,
        
&#39;ssl_cert&#39; => &#39;/etc/nginx/ssl/mail.DOMAIN.de.cer&#39;,
        
&#39;ssl_key&#39;  => &#39;/etc/nginx/ssl/mail.DOMAIN.de.key&#39;,
        
),
 );

// SMTP server host (for sending mails).
// See defaults.inc.php for the option description.
$config[&#39;smtp_server&#39;] = &#39;tls://smtp.DOMAIN.de&#39;;
$config[&#39;smtp_port&#39;] = 587;
$config[&#39;smtp_conn_options&#39;] = array(
        
&#39;ssl&#39; => array(
        
&#39;verify_peer&#39;       => false,
        
&#39;verify_peer_name&#39;  => false,
        
        
&#39;cafile&#39;  => &#39;https://letsencrypt.org/certs/isrgrootx1.pem&#39;,
        
&#39;ssl_cert&#39; => &#39;/etc/nginx/ssl/mail.DOMAIN.de.cer&#39;,
        
&#39;ssl_key&#39;  => &#39;/etc/nginx/ssl/mail.DOMAIN.de.key&#39;,

     
),
 );

$config[&#39;smtp_user&#39;] = &#39;%u&#39;;
$config[&#39;smtp_pass&#39;] = &#39;%p&#39;;
$config[&#39;des_key&#39;] = &#39;123&#39;;


I also tried several normal configurations before.

I'm getting different errors:
Code: [Select]
<b9qn1ouq> IMAP Error: Login failed for test@DOMAIN.de against imap.DOMAIN.de from 93.208.184.196. AUTHENTICATE PLAIN: Authentication failed. in /var/www/DOMAIN.de/public/webmail/program/lib/Roundcube/rcube_imap.php on line 211 (POST /webmail/?_task=login&_action=login)

Code: [Select]
<iu8m3om8> PHP Error: STARTTLS failed (POST /webmail/?_task=mail&_unlock=loading1672489143932&_framed=1&_action=send)

<iu8m3om8> PHP Error: Invalid response code received from server (POST /webmail/?_task=mail&_unlock=loading1672489143932&_framed=1&_action=send)

<iu8m3om8> SMTP Error: STARTTLS failed: 2.0.0 Ready to start TLS (Code: 220) in /var/www/DOMAIN.de/public/webmail/program/lib/Roundcube/rcube.php on line 1795 (POST /webmail/?_task=mail&_unlock=loading1672489143932&_framed=1&_action=send)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Can send Emails, but not receive
« Reply #1 on: January 03, 2023, 12:45:49 PM »
Quote
when clicking on "sent" Email there is no entry in Roundcube.
After replying from my Gmail Account, there is no incoming Email on Roundcube.

The two lines above suggest an issue with your SMTP server.

Quote
Adding the Email Account to Thunderbird, I can send and receive Emails, so it's just Roundcube related.

Is Roundcube configured to connect to the same SMTP server as Thunderbird?

You also posted a couple of TLS errors which again point to an issue with Roundcube connecting to your SMTP server. Perhaps there is some related info in your SMTP server logs?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline REtender

  • Newbie
  • *
  • Posts: 3
Re: Can send Emails, but not receive
« Reply #2 on: January 06, 2023, 03:23:05 PM »
Thanks for your answer! :)

Maybe I should post my Postfix Configs:

Main.cf

Code: [Select]
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
inet_interfaces = 127.0.0.1, ::1, ipv4, ipv6 <— censored
myhostname = mail.domain.tld

maximal_queue_lifetime = 1h
bounce_queue_lifetime = 1h
maximal_backoff_time = 15m
minimal_backoff_time = 5m
queue_run_delay = 5m

tls_preempt_cipherlist = no
tls_ssl_options = NO_COMPRESSION
tls_medium_cipherlist = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384

smtp_tls_security_level = dane
smtp_dns_support_level = dnssec
smtp_tls_policy_maps = proxy:mysql:/etc/postfix/sql/tls-policy.cf
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_ciphers = medium
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtpd_tls_ciphers = medium
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_cert_file=/etc/nginx/ssl/mail.domain.tld.cer
smtpd_tls_key_file=/etc/nginx/ssl/mail.domain.tld.key
smtpd_tls_dh1024_param_file = /etc/postfix/dh.pem

virtual_transport = lmtp:unix:private/dovecot-lmtp

smtpd_milters = inet:localhost:11332
non_smtpd_milters = inet:localhost:11332
milter_protocol = 6
milter_mail_macros =  i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_default_action = accept

smtpd_relay_restrictions =      reject_non_fqdn_recipient
                                reject_unknown_recipient_domain
                                permit_mynetworks
                                reject_unauth_destination

smtpd_recipient_restrictions = check_recipient_access proxy:mysql:/etc/postfix/sql/recipient-access.cf

smtpd_client_restrictions =     permit_mynetworks
                                check_client_access hash:/etc/postfix/without_ptr
                                reject_unknown_client_hostname

smtpd_helo_required = yes
smtpd_helo_restrictions =   permit_mynetworks
                            reject_invalid_helo_hostname
                            reject_non_fqdn_helo_hostname
                            reject_unknown_helo_hostname

smtpd_data_restrictions = reject_unauth_pipelining

mua_relay_restrictions = reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated,reject
mua_sender_restrictions = permit_mynetworks,reject_non_fqdn_sender,reject_sender_login_mismatch,permit_sasl_authenticated,reject
mua_client_restrictions = permit_mynetworks,permit_sasl_authenticated,reject

proxy_read_maps =       proxy:mysql:/etc/postfix/sql/aliases.cf
                        proxy:mysql:/etc/postfix/sql/accounts.cf
                        proxy:mysql:/etc/postfix/sql/domains.cf
                        proxy:mysql:/etc/postfix/sql/recipient-access.cf
                        proxy:mysql:/etc/postfix/sql/sender-login-maps.cf
                        proxy:mysql:/etc/postfix/sql/tls-policy.cf

virtual_alias_maps = proxy:mysql:/etc/postfix/sql/aliases.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/accounts.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/domains.cf
local_recipient_maps = $virtual_mailbox_maps

mailbox_size_limit = 0

message_size_limit = 52428800

biff = no

and the master.cf
Code: [Select]

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
###
### SMTP-Serverbindungen aus dem Internet
### Authentifizuerung hier nicht erlaubt (Anmeldung nur via smtps/submission!)
smtp      inet  n       -       y       -       1       smtpd     
    -o smtpd_sasl_auth_enable=no
###
### SMTPS Service (Submission mit implizitem TLS - ohne STARTTLS) - Port 465
### Für Mailclients gelten andere Regeln, als für andere Mailserver (siehe smtpd_ in main.cf)
###
smtps     inet  n       -       y       -       -       smtpd
    -o syslog_name=postfix/smtps
    -o smtpd_tls_wrappermode=yes
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_sasl_type=dovecot
    -o smtpd_sasl_path=private/auth
    -o smtpd_sasl_security_options=noanonymous
    -o smtpd_client_restrictions=$mua_client_restrictions
    -o smtpd_sender_restrictions=$mua_sender_restrictions
    -o smtpd_relay_restrictions=$mua_relay_restrictions
    -o milter_macro_daemon_name=ORIGINATING
    -o smtpd_sender_login_maps=proxy:mysql:/etc/postfix/sql/sender-login-maps.cf
    -o smtpd_helo_required=no
    -o smtpd_helo_restrictions=
    -o cleanup_service_name=submission-header-cleanup
###
### Submission-Zugang für Clients (mit STARTTLS - für Rückwärtskompatibilität) - Port 587
###
submission inet n       -       y       -       -       smtpd
    -o syslog_name=postfix/submission
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_sasl_type=dovecot
    -o smtpd_sasl_path=private/auth
    -o smtpd_sasl_security_options=noanonymous
    -o smtpd_client_restrictions=$mua_client_restrictions
    -o smtpd_sender_restrictions=$mua_sender_restrictions
    -o smtpd_relay_restrictions=$mua_relay_restrictions
    -o milter_macro_daemon_name=ORIGINATING
    -o smtpd_sender_login_maps=proxy:mysql:/etc/postfix/sql/sender-login-maps.cf
    -o smtpd_helo_required=no
    -o smtpd_helo_restrictions=
    -o cleanup_service_name=submission-header-cleanup
###
### Weitere wichtige Dienste für den Serverbetrieb
###
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
###
### Cleanup-Service um MUA header zu entfernen
###
submission-header-cleanup unix n - n    -       0       cleanup
    -o header_checks=regexp:/etc/postfix/submission_header_cleanup

I also tried a different Roundcube config (which didn’t work aswell).

Code: [Select]

$config['default_host'] = 'tls://%n:143';

// IMAP host chosen to perform the log-in.
// See defaults.inc.php for the option description.
$config['imap_host'] = 'tls://%n:143';

// SMTP server host (for sending mails).
// See defaults.inc.php for the option description.
$config['smtp_host'] = 'tls://%n:587';
« Last Edit: January 06, 2023, 03:34:19 PM by REtender »

Offline REtender

  • Newbie
  • *
  • Posts: 3
Re: Can send Emails, but not receive
« Reply #3 on: January 22, 2023, 06:58:06 AM »
Does nobody have an idea?


Offline Dmitry42

  • Full Member
  • ***
  • Posts: 232
Re: Can send Emails, but not receive
« Reply #4 on: January 29, 2023, 09:57:27 PM »
I think problem can be in IMAP or smtp or both services config.

I see you config Postfix to use Dovecot in main.cf (virtual_transport = lmtp:unix:private/dovecot-lmtp) but can't see any string with "dovecot-lmtp" in master.conf.
Another words: Postfix must use virtual_trandport for delivery mail to your mailbox, but they can't find it in master.config.

And about "IMAP Error: Login failed for test@DOMAIN.de against imap.DOMAIN.de...." - you must check your Dovecot logs and configs.
May be they need config too (to know that you use virtual user table in mysql db like postfix)

And I see one error in RC config:
$config['imap_host'] = 'tls://%n:143';
$config['default_host'] = 'tls://%n:143';

I think you must try "server:143" without TLS or use TLS:// with 993 port  "tls://server:993" or "tls://server:587" or "SSL://server:993" but in all cases 143 port used without SSL|TLS.
« Last Edit: January 29, 2023, 10:39:35 PM by Dmitry42 »