Setting up e-mail management

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04
Virtualmin version 7.3-1

Hi

Once I had my provider open ports 25 and 465, I found that outgoing e-mails work correctly. However, the only way I can send them is to go to Servers → Read User Mail → User Mail → Compose which is not the most comfortable procedure anyway.

From Usermin the e-mails are not coming out and I don’t understand why. I also notice that I can only access the Usermin dashboard via Edit User → Login to Usermin and not via mydomain.com:20000

I tried via Roundcube but when I click on Send the pop-up SMTP error (): connection to server failed appears.

Also – while I confirm that I can send e-mails – it seems I can’t receive them since I don’t have a working mail client.

Imaps (993), Pop3s (995) and 20000 TCP ports are obviously granted by firewall.

Can anyone give any suggestions for:

  1. set up Usermin correctly;
  2. resolve the error that Roundcube transmits;
  3. verify that the e-mails are being received correctly.

Thank you in advance.

From mail.log:

Nov 24 12:18:25 host dovecot: imap-login: Login: user=<info-mydomain.com>, method=PLAIN, rip=::1, lip=::1, mpid=2039797, secured, session=<8crmZjbulJUAAAAAAAAAAAAAAAAAAAAB>
Nov 24 12:18:25 host dovecot: imap(info-mydomain.com)<2039797><8crmZjbulJUAAAAAAAAAAAAAAAAAAAAB>: Disconnected: Logged out in=50 out=575 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0

What is the incoming server and outgoing server which you have specified in your email client - e.g. Outlook.

Hi @calport

I don’t use any external client, Usermin (or Roundcube) for me are ok but I can’t receive any e-mail on both. Currently I want to send/receive only through the server.

Moreover, please note that I can send e-mails from Usermin but not from Roundcube: SMTP error (): connection to server failed

Any chance to solve in your opinion? Honestly I looked for some resources but I did not find anything in order to do an useful troubleshooting.

Thank you in advance.

In the meantime I found it through systemctl status saslauthd

● saslauthd.service - LSB: saslauthd startup script
     Loaded: loaded (/etc/init.d/saslauthd; generated)
     Active: active (running) since Thu 2022-11-24 14:33:22 UTC; 59min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 2051552 ExecStart=/etc/init.d/saslauthd start (code=exited, status=0/SUCCESS)
      Tasks: 15 (limit: 2261)
     Memory: 11.5M
        CPU: 65ms
     CGroup: /system.slice/saslauthd.service
             ├─    985 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─    990 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─    991 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─    992 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─    993 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─ 981993 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─ 981994 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─ 981995 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─ 981996 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─ 981997 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─2051574 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─2051575 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─2051576 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─2051577 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             └─2051578 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5

Nov 24 14:33:22 saslauthd[2051574]:                 : listening on socket: /var/spool/postfix/var/run/saslauthd/mux
Nov 24 14:33:22 saslauthd[2051552]:    ...done.
Nov 24 14:33:22 saslauthd[2051552]:  * Starting SASL Auth. Daemon for Postfix saslauthd-postf
Nov 24 14:33:22 saslauthd[2051592]:                 : could not lock pid file /var/spool/postfix/var/run/saslauthd/saslauthd.pid: Resource temporarily unavailable
Nov 24 14:33:22 saslauthd[2051591]: saslauthd[2051591] :Cannot start saslauthd
Nov 24 14:33:22 saslauthd[2051591]:                 : Cannot start saslauthd
Nov 24 14:33:22 saslauthd[2051591]: saslauthd[2051591] :Another instance of saslauthd is currently running
Nov 24 14:33:22 saslauthd[2051591]:                 : Another instance of saslauthd is currently running
Nov 24 14:33:22 saslauthd[2051552]:    ...fail!
Nov 24 14:33:22 systemd[1]: Started LSB: saslauthd startup script.

is it related to?

Adding @staff and @RJM_Web_Design …any tips on carrying out some troubleshooting and so detect the cause(s)?

Thank you.

Trying to solve but something is really beyond my knowledge. As suggested in this post by @Joe:

Pick one (1) domain to use for mail, and click “Copy to Postfix”. Stop there. You’re done. Use that domain for anything that interacts with SMTP, always

I copied to Postfix but I continue to not receive e-mails. Do I have also Set as default services certificate?

image

Moreover, when I ask to Read mail in file or Maildir

image

the answer is: Failed to open Maildir/ : No such file or directory

Does it have anything to do with my issue?

Thank you all for any further assistance.

In addition from mail.err:

Nov 21 16:21:43 host dovecot: master: Error: Error reading configuration: Error in configuration file /etc/dovecot/dovecot.conf line 19: ssl_cert: Can't open file /path/to/cert.pem: No such file or directory - Also failed to read config by executing doveconf: /run/dovecot/config is a UNIX socket
Nov 21 17:04:09 host milter-greylist: smfi_main() returned 0

…the line 19 is a comment (?) # Paths are also just examples with the real defaults being based on configure

How can I handle it? Thank you.

I don’t think certificates has anything to do with receiving emails

1 Like

This is my mail.log:

Nov 26 11:38:33 host dovecot: imap(info@mydomain.com)<2247635><pfYEFF7uOpp/AAAB>: Disconnected: Connection closed (SEARCH finished 0.015 secs ago) in=283 out=2315 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Nov 26 11:38:35 host dovecot: imap-login: Login: user=<info@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=2247639, secured, session=<PDglFF7uPJp/AAAB>
Nov 26 11:38:35 host dovecot: imap(info@mydomain.com)<2247639><PDglFF7uPJp/AAAB>: Disconnected: Connection closed (UID FETCH finished 0.026 secs ago) in=282 out=5814 deleted=0 expunged=0 trashed=0 hdr_count=8 hdr_bytes=2441 body_count=1 body_bytes=564
Nov 26 11:38:40 host dovecot: imap-login: Login: user=<info@mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=2247644, secured, session=<Vm9tFF7uPpp/AAAB>
Nov 26 11:38:40 host dovecot: imap(info@mydomain.com)<2247644><Vm9tFF7uPpp/AAAB>: Disconnected: Connection closed (SEARCH finished 0.021 secs ago) in=178 out=2060 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Nov 26 11:41:10 host dovecot: pop3-login: Login: user=<info@mydomain.com>, method=PLAIN, rip=::1, lip=::1, mpid=2247740, secured, session=<lMpcHV7uhIYAAAAAAAAAAAAAAAAAAAAB>
Nov 26 11:41:26 host postfix/anvil[2247433]: statistics: max connection rate 1/60s for (smtp:194.180.48.11) at Nov 26 11:38:05
Nov 26 11:41:26 host postfix/anvil[2247433]: statistics: max connection count 1 for (smtp:194.180.48.11) at Nov 26 11:38:05
Nov 26 11:41:26 host postfix/anvil[2247433]: statistics: max cache size 1 at Nov 26 11:38:05
Nov 26 11:42:54 host dovecot: pop3(info@mydomain.com)<2247740><lMpcHV7uhIYAAAAAAAAAAAAAAAAAAAAB>: Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

Can’t still receive e-mail, does the above file contain some suggestion?

Any help please? Thank you.

You would set the default services certificate on the default mail server (typically something like mail.servername.domain.tld).

If you’re using ANI (which I think is the default now), then generating SSL certs from Let’s Encrypt will include mail.domain.tld for the individual virtual servers; so those servers’ users could use either mail.theirdomain.tld or mail.servername.domain.tld.

At least that’s how it worked for me, without my having to do anything at all except assigning the default certificate on mail for the hostname. That was it. Everything else just worked.

This was on Rocky, but I doubt there’s any difference between Rocky and Ubuntu in this particular case.

How about the fundamentals. Are ports 25 and 465 open on your firewall? Your ISP may have opened them up for you, but that’s not the same as being open in the firewall running on your server.

Richard

Thank you Richard

I see all the ports under “public (default)” opened, do I have to set them up under some other category?

I remind that my problem is on incoming and not outgoing e-mails.

image

Have you checked your DNS Records to make sure your MX entries are correct for the server and hosting accounts?

this site can test your public IP if its open for smtp

1 Like

Yes, which is why it sounds like it could be a firewall issue (ports closed). If the port is closed to incoming traffic but not outgoing traffic, then you won’t receive mail but you’ll be able to send mail.

Please use the site @stefan1959 suggested to check your mail ports. They should be open to incoming connections. If not, they need to be opened, which I have no idea how to do in Ubuntu (but most likely is easy enough).

Richard

Where is VM located, behind a router?

1 Like

right now, this ip doesn’t seem to have any ports open to public… so check your firewall settings or provider…

Dear all,

first, thank you for your support.

I was away in order to study a bit more on Postfix and Dovecot configuration :slight_smile:

At this stage, I am able to send and receive (using for the test a domain under OVH).

This is now the output of postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 3.6
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname, corriere24.com, tosatriceperanimali.com, host.borsedilussoartigianali.com, localhost.borsedilussoartigianali.com, , localhost
myhostname = host.borsedilussoartigianali.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 162.55.37.58
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtp_dns_support_level = dnssec
smtp_host_lookup = dns
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = dane
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/postfix/postfix.ca.pem
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
tls_server_sni_maps = hash:/etc/postfix/sni_map
virtual_alias_maps = hash:/etc/aliases

and the one from netstat -plnt:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      157739/dovecot
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      134209/mariadbd
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      596/named
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      157739/dovecot
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      213549/master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      787/sshd: /usr/sbin
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      213549/master
tcp        0      0 127.0.0.1:8891          0.0.0.0:*               LISTEN      153510/opendkim
tcp        0      0 162.55.37.58:53         0.0.0.0:*               LISTEN      596/named
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      573/systemd-resolve
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      1203/lookup-domain-
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      213549/master
tcp        0      0 0.0.0.0:20000           0.0.0.0:*               LISTEN      1012/perl
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      596/named
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      157739/dovecot
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      157739/dovecot
tcp        0      0 127.0.0.1:10023         0.0.0.0:*               LISTEN      1013/postgrey --pid
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      132416/perl
tcp6       0      0 :::143                  :::*                    LISTEN      157739/dovecot
tcp6       0      0 ::1:53                  :::*                    LISTEN      596/named
tcp6       0      0 :::80                   :::*                    LISTEN      852/apache2
tcp6       0      0 :::110                  :::*                    LISTEN      157739/dovecot
tcp6       0      0 :::25                   :::*                    LISTEN      213549/master
tcp6       0      0 :::22                   :::*                    LISTEN      787/sshd: /usr/sbin
tcp6       0      0 :::465                  :::*                    LISTEN      213549/master
tcp6       0      0 :::443                  :::*                    LISTEN      852/apache2
tcp6       0      0 fe80::9400:1ff:fe9d::53 :::*                    LISTEN      596/named
tcp6       0      0 2a01:4f8:c17:1fe5::1:53 :::*                    LISTEN      596/named
tcp6       0      0 :::587                  :::*                    LISTEN      213549/master
tcp6       0      0 :::995                  :::*                    LISTEN      157739/dovecot
tcp6       0      0 :::993                  :::*                    LISTEN      157739/dovecot
tcp6       0      0 ::1:10023               :::*                    LISTEN      1013/postgrey --pid
tcp6       0      0 :::10000                :::*                    LISTEN      132416/perl
tcp6       0      0 ::1:953                 :::*                    LISTEN      596/named

The main point which are not yet very clear to me are:

  1. how to config the rDNS under the dashboard of my provider:

image

image

  1. how to fix the missing encryption when I set up the e-mail account on Thunderbird:

image

the output of of service saslauthd status is:

Nov 29 14:42:41 host.borsedilussoartigianali.com saslauthd[157707]:                 : listening on socket: /var/spool/postfix/var/run/saslauthd/mux
Nov 29 14:42:41 host.borsedilussoartigianali.com saslauthd[157685]:    ...done.
Nov 29 14:42:41 host.borsedilussoartigianali.com saslauthd[157685]:  * Starting SASL Auth. Daemon for Postfix saslauthd-postf
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157725]:                 : could not lock pid file /var/spool/postfix/var/run/saslauthd/saslauthd.pid: Resource temporarily unavailable
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157724]: saslauthd[157724] :Cannot start saslauthd
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157724]:                 : Cannot start saslauthd
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157724]: saslauthd[157724] :Another instance of saslauthd is currently running
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157724]:                 : Another instance of saslauthd is currently running
Nov 29 14:42:42 host.borsedilussoartigianali.com saslauthd[157685]:    ...fail!
Nov 29 14:42:42 host.borsedilussoartigianali.com systemd[1]: Started LSB: saslauthd startup script.

I have been styudying for days but no solution yet…as long as I am looking at the right direction;

  1. why mail-tester.com is telling me:

a) We recommend that you post a DNS record (of type MX) for the domain tosatriceperanimali.com, or use an alternate bounce email address
b) We recommend that you create an A record (in your DNS) for the hostname host.borsedilussoartigianali.com, or use a different hostname in your mail server

since at least I have the MX record both on VM and OVH. The point B maybe is related to the point 1: not yet understood perfectly.

Any suggestion will be helpful as the previous you gave me until now.

Thank you once again in advance.

You should change the server name to match reverse, test site (mxtoolbox) should you should receive mail.