Docker container unable to connect to postfix on host with error "MX Routing not available"

I'm trying to run a SimpleLogin instance on my raspberry pi 4 (aka armhf/armv7l) following the official instructions, but the resulting installation isn't able to send emails to my real inbox.

I installed swaks inside the docker container sl-app where all the to-the-real-inbox emails originates, after trying to send a message i got this error

$ docker exec -ti sl-app swaks --from "REDACTED" --to "REDACTED"
*** MX Routing not available: requires Net::DNS.  Using localhost as mail server
=== Trying localhost:25...
*** Error connecting to localhost:25:
***     IO::Socket::INET: connect: Connection refused

It can't connect to the postfix installed on the host system

$ 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 Wed 2021-12-22 19:11:26 GMT; 3h 10min ago
  Process: 21485 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 21485 (code=exited, status=0/SUCCESS)

The funniest thing is that a few days ago it worked just fine, the configuration hasn't changed but now it doesn't work anymore.

Any suggestions on how to resolve this issue?


Solution 1:

As the systemctl status postfix shows, your postfix is not running. Run systemctl start postfix.

The message MX Routing not available is not related. It indicates that you don't have Net::DNS Perl module required by swaks installed on your system.