Roundcube can send mails but doesnt receive mails

SYSTEM INFORMATION
OS type and version Debian Linux 10.13
Webmin version 1.941
Virtualmin version 6.08
Related packages Roundcube

In the past I had no problems sending and receiving mails on my virtual domains I think all got started after I upgraded from Jessie to Buster but Im not sure.

Here is my postfix conf:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

inet_interfaces = all
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ns6707031.ip-43-45-56.eu, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
smtpd_sasl_authenticated_header = yes

Seems to be normal to me, my other domains also dont receive mails but they can send… I didnt try Squirrel mail though, is it roundcube related or postfix? I would be glad for any hints!

@Anarchy,

Have you checked the “mail.log” file for any clues as to why you are not receiving email?

*** BTW: your subject should be changed as Roundcube itself is an email clients and the issue is at the server level ***

Does your provider block port 25 traffic either inbound or outbound or both?

SMTP which is the protocol for which email travels between servers, requires port 25 to be open and accepting email. If your provider is blocking port 25 traffic at the network level then you’ll need to reach out to them to unblock you.

Have you checked your MX record is valid? If it’s not, mail won’t route to the correct server and therefore not get received (though technically mail can also use an A record of the domain, however having a valid MX record is the proper way of routing mail).

Need more assistance, want some quick answers? I’m available for consulting, troubleshooting and solution execution for a fair and affordable introductory rate exclusive to Virtualmin users… Drop me a PM on the forums or visit https://tpnassist.com to request help.

*** Affordable, Trusted, Professional, Server Assistance – https://tpnassist.com ***

Hi tpnsolutions thanks for your reply here is my port 25 netstats:

netstat -tuplen | grep 25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 123456789 54533/master
tcp6 0 0 :::25 :::* LISTEN 0 123458468 54533/master

I dont know if this command was correct or sufficient… I did change some numbers like 123456… 54533 for security reasons. It looks like port 25 is listening…

This is what I see on mail.log:

Sep 30 11:11:31 tz3145073 postfix/local[10812]: DA843E0086: to=anarchy.mycooldomain@tz3145073.ip-45-21-214.us, orig_to=<anarchy@mycooldomain.com.>, relay=local, delay=100, delays=0.08/0.03/0/100, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Sep 30 11:11:31 tz3145073 postfix/qmgr[22689]: DA843E0086: removed

I dont know why it says removed… and what is removed…

Removed in this context means removed from the queue, i.e. the queue that holds messages waiting to be delivered and managed by the Queue Manager (postfix/qmgr).

1 Like

So this means everythign is working, then where could be the problem?

I’d work methodically from basics:

  1. Make sure your MX records are correct.
  2. ensure the user\mail box exists
  3. make sure port 25 is open. (try telnet or similar and see of you can do an SMTP handshake or use something like SMTP Test / Mail Server Test • Wormly Monitoring

See how you get on.

I created the mailbox myself, it is still there and I can login to roundcube… The telnet 25 results I think you can also see from the netstats output. I made a check from https://mxtoolbox.com/ and www.wormly.com they all look good.

If you checked via Wormly - does that mean the “test email” the site sent arrived in your mailbox?

There is no email in the inbox, that is the problem. But wormly hasnt given any errors.

Try Wormly again - post up the SMTP conversation it has with your server & the section from your mail log when Wormly sends the test email.

Here are the wormly logs and mail.log

250-8BITMIME
250-DSN
250 CHUNKING
1.31s
> MAIL FROM:<customers@wormly.com>
< 250 2.1.0 Ok
1.51s
> RCPT TO:<n****@*****.**r>
< 250 2.1.5 Ok
1.71s
> DATA
1.71s
< 354 End data with <CR><LF>.<CR><LF>
1.82s
> Date: Fri, 7 Oct 2022 12:30:21 +0000
> To: n****@*****.**r
> From: Wormly SMTP Test <customers@wormly.com>
> Subject: Wormly SMTP Test Message
> Message-ID: <21dbb68b09f6c9f4b697f3bc29aeb77f@_>
> X-Mailer: https://www.wormly.com/
> MIME-Version: 1.0
1.82s
> Content-Type: text/plain; charset=iso-8859-1
>
> This message was sent using the Wormly SMTP testing tool by this user:
> Users' IP address: 72.12.34.144
>
> .
< 250 2.0.0 Ok: queued as 4FF3CE06E9
2.12s
Connection: closed
2.12s
SMTP test complete



---------
Oct  7 14:31:45 ns3453470 postfix/smtpd[924]: connect from unknown[212.70.149.22]
Oct  7 14:31:49 ns3453470 postfix/smtpd[32207]: connect from unknown[212.70.149.68]
Oct  7 14:31:51 ns3453470 postfix/local[927]: 4FF3CE06E9: to=<mailname.domainname@ns3453470.ip-88-55-32.eu>, orig_to=<mailname@domainname.net.cr>, relay=local, delay=90, delays=0.63/0.03/0/90, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Oct  7 14:31:51 ns3453470 postfix/qmgr[22689]: 4FF3CE06E9: removed
Oct  7 14:31:52 ns3453470 postfix/smtpd[924]: warning: unknown[212.70.149.22]: SASL LOGIN authentication failed: authentication failure
Oct  7 14:31:52 ns3453470 postfix/smtpd[924]: disconnect from unknown[212.70.149.22] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4

Post up the contents of your .procmailrc file?

I couldnt find .procmailrc, where is it supposed to be located?

etc/procmailrc or you can see it from the GUI (Webmin - Procmail Mail Filter - Manually Edit Configuration

Thank you I found it :

LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0
* ?/usr/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/usr/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=$HOME/Maildir/
ORGMAIL=$HOME/Maildir/
DROPPRIVS=yes
:0
$DEFAULT

I’ve just checked my procmailrc file (on a working system) - it’s identical to your.

I’m a little stumped what to suggest further tbh. I think your problem lies with procmail - postfix is receiving the smtp handshake\traffic and putting the email in the queue and qmgr is passing it on to procmail - it just goes awol then.

Maybe do “Re-Run Install Wizard” - perhaps someone can comment on the effects of this?

I have 3 domains and the email receiving is not wokring on any of them… shall I give a try to squirrel mail?

Update: I can see the emails on maildir:

/home/domainname/homes/username/Maildir

But why not on Thunderbird or Roundcube inbox?

Finally I found the problem… the Dovecot conf file mail location was differen:

# mail_location = mbox:~/mail:INBOX=/var/mail/%u
above is ex setting, below new setting
mail_location = maildir:~/Maildir

What could have changed Dovecot setting or why would they be different with Postfix?

That’s what mine says. I would not expect it to be the same as Postfix. Postfix is an MTA whereas Dovecot is an IMAP server.

As to what could have changed it - sadly no idea.