I recently moved my postfix server on docker using the mailu image on my raspberrypi 4 (rasbian buster). I uninstalled totally postfix so as to be sure there are no remaining things that would interact with mmy docker instance. So the 25 port is now "forwarded" to the docker container. But I still need to send emails from my Pi (e.g. as an MTA for all the cron jobs) so I installed sendmail and tried to configure it to send emails through my docker mail server using a relay mechanism. Now I'm facing the problem that the relay host has the same IP as the sendmail service itself.

I always get the message: Jun 5 19:46:38 raspberrypi sm-msp-queue[30614]: 051511t6001616: to=postmaster, delay=4+12:45:32, xdelay=00:00:00, mailer=relay, pri=29916391, relay=[] [], dsn=4.0.0, stat=Deferred: Connection refused by []

is it possible to get this working?

  • Can you contact sendmail at Does telnet 587 produce SMTP greeting message?
    – AnFi
    Jun 8, 2020 at 11:27

1 Answer 1


I fixed the problem this way:

  1. in sendmail.mc I added the following lines:
GENERICS_DOMAIN(localhost.localdomain localhost raspberrypi)dnl
  1. in Mailu config I had to add so that mails coming from my local network are relayed in trusted mode (user not authenticated)
RELAYNETS= localhost.localdomain 

It works but I'm not sure this is 100% sure though...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .