Can't receive mails

Hello.

Two days ago (Saturday) I updated my installation of mail-in-a-box. I make a new virtual machine in a ubuntu 18.04 and i move the backup to this new machine. It was working well on saturday and sunday.

Today (Monday) the server works fine during morning, but at 11:00 we notice that the mails didn’t arrive.

I am checking the installation but it seems that all is fine, so i run again the installation command

curl -s https://mailinabox.email/setup.sh | sudo bash

And I notice the following error after the screen to write the hostname:

RTNETLINK answers: Network is unreachable

I suppose that it can be the key to solve the error. ¿anybody can help me?

Looks like you have a network down. Do you host with a VPS provider or self-host?

I think that response is due to the setup creating a route to a hop that doesn’t exist yet. I remember seeing it during my setup and thinking, “Oh, that’s odd”, but when the install completed normally I didn’t look any further into it.

I’m self hosted. I’m hosted in a VM with vsphere virtual box. But i can access to the network.

This is weird.

Today at 8:00 AM all worked normally. But now we can’t receive mails any more (we do not touch anything). If i send a mail to myself, the mail do not enter in my own mailbox. But if i send a mail to an external mail (gmail) it works.

Any idea?

I could see this happening if networking interfaces (especially wireless) popped in and out and the system hasn’t magically reconfigured itself to magically work. Also, if there were any system reboots, that could also affect network interfaces, if you are running on a temporary configuration and the reboot makes it forget the network interface.

Those are the only things I could think of. Maybe running out of private IP addresses from DHCP??

Not a networking guy, just throwing out garbage that might work.

OK. If I type this command

mailq

I can see a lot of mails. I think that the queues are not working.

I can see this entries in the mailq command.

(connect to 127.0.0.1[127.0.0.1]:10025: Connection refused)

I’m very confused with this trouble.

I too am shooting in the dark … (meaning I am just guessing - sorry)

Is postfix running?

sudo systemctl status postfix

It should return something similar to this:

miab@box:/etc/nsd/zones$ sudo systemctl status postfix
[sudo] password for miab:

  • postfix.service - Postfix Mail Transport Agent
    Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset:
    Active: active (exited) since Tue 2019-02-19 03:00:09 PST; 1h 6min ago
    Process: 21474 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
    Main PID: 21474 (code=exited, status=0/SUCCESS)

Feb 19 03:00:09 box.miabdnstest.ml systemd[1]: Starting Postfix Mail Transport A
Feb 19 03:00:09 box.miabdnstest.ml systemd[1]: Started Postfix Mail Transport Ag
lines 1-8/8 (END)

Which ports do you have open and forwarded to your VM?

I can see this in your command.

root@boxcorreo:/etc/dovecot/conf.d# sudo systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
   Active: active (exited) since Tue 2019-02-19 12:49:05 CET; 27min ago
  Process: 2086 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 2086 (code=exited, status=0/SUCCESS)

feb 19 12:49:05 boxcorreo systemd[1]: Starting Postfix Mail Transport Agent...
feb 19 12:49:05 boxcorreo systemd[1]: Started Postfix Mail Transport Agent.
root@boxcorreo:/etc/dovecot/conf.d#

Postfix seems started.

Then I am confused why you are not receiving email sent within your box, or did I mis-understand this comment:

I understand that as sending an email from a user on MiaB to another user on MiaB … is my understanding correct? Or are you sending from some external (to MiaB) email account?

If i send a mail to another user in my mail-in-a-box, the mail doesn’t arrive.

the firewall appears to be ok.

marcosms@boxcorreo:~$ sudo ufw status numbered
[sudo] password for marcosms:
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 22/tcp                     ALLOW IN    Anywhere
[ 2] 53                         ALLOW IN    Anywhere
[ 3] 25/tcp                     ALLOW IN    Anywhere
[ 4] 587/tcp                    ALLOW IN    Anywhere
[ 5] 993/tcp                    ALLOW IN    Anywhere
[ 6] 995/tcp                    ALLOW IN    Anywhere
[ 7] 4190/tcp                   ALLOW IN    Anywhere
[ 8] 80/tcp                     ALLOW IN    Anywhere
[ 9] 443/tcp                    ALLOW IN    Anywhere
[10] 22/tcp (v6)                ALLOW IN    Anywhere (v6)
[11] 53 (v6)                    ALLOW IN    Anywhere (v6)
[12] 25/tcp (v6)                ALLOW IN    Anywhere (v6)
[13] 587/tcp (v6)               ALLOW IN    Anywhere (v6)
[14] 993/tcp (v6)               ALLOW IN    Anywhere (v6)
[15] 995/tcp (v6)               ALLOW IN    Anywhere (v6)
[16] 4190/tcp (v6)              ALLOW IN    Anywhere (v6)
[17] 80/tcp (v6)                ALLOW IN    Anywhere (v6)
[18] 443/tcp (v6)               ALLOW IN    Anywhere (v6)

I make a sudo service ufw stop but it continues failing.

I am seeing two issues here …

Your MiaB is not receiving mail from the internet at large.

Your MiaB is not sending mail within the server itself.

Your ufw status shows what ports you have open within the VM hosting MiaB … but my question was do you have the necessary ports open from the host operating system to the VM? Are they being forwarded correctly?

yes. all the ports are maped in our router (mikrotik) and all is open in our VSphere Vmare.

In a machine of this vmware we had the old instalation of MIAB (ubuntu 14.04) and ever works well. This saturday i make the migration to MIAB 18.04 and the problemas with lost emails started.

The thing that is more confussed for me is the fact that today, all was working well until 9:00 aprox. Since that, the mails didn’t arrive.

Can you check the logs for around 9:00 to see if anything significant or unusual happened around that time?

Could this be an ISP issue?

I can see a lot of errors like this in the logs.

Feb 19 16:23:42 localhost postfix/error[2195]: F074D1441766: to=XXX@XXXX.org, relay=none, delay=1053, delays=1053/0.14/0/0.35, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10025: Connection refused)

This bugs me … I do not know why, but it does. Shouldn’t postfix internally being trying port 25? Hmm, nope my postconf file has virtual_transport = lmtp:[127.0.0.1]:10025

Why not try opening post 10025 …
sudo ufw allow 10025
sudo ufw reload

post the results of
postconf -n

If you edit out personal info please just edit the two shown:

myhostname = my miab hostname
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
non_smtpd_milters = $smtpd_milters
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_bind_address = my external IP