Sendmail connection rejected 127.0.0.1

The server I'm working on is FreeBSD and sendmail, which have recently stopped sending emails. I searched google many times and I tried many things from many different sites, but so far nothing has worked.

Here is the output of the sendmail command:

# echo "test" | mail -v -s test test@test.com test@test.com... Connecting to [127.0.0.1] via relay... test@test.com... Deferred: Connection refused by [127.0.0.1] 

Here's telnet on port 25:

 # telnet localhost 25 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Trying ::1... telnet: connect to address ::1: Connection refused telnet: Unable to connect to remote host 

Here is the netstat output part:

 tcp4 0 0 the.first.ip.address.25 *.* LISTEN tcp4 0 0 the.second.ip.address.26 *.* LISTEN tcp4 0 0 the.third.ip.address.25 *.* LISTEN tcp4 0 0 the.fourth.ip.address.25 *.* LISTEN tcp4 0 0 the.main.server.ip.address.25 *.* LISTEN 

Some things I've tried so far:

 1) changed settings /etc/hosts file 2) changed settings in the .mc file, then make, make install, service sendmail restart 3) directly changed the .cf file since changing .mc file didn't fix the problem, then "service sendmail restart" 

I am open to ideas if someone has had this problem before or if she knows how to fix it.

Thanks!

+5
source share
2 answers

Make sure sendmail is enabled in /etc/rc.conf :

 sendmail_enable="YES" 

Check the log files /var/log/messages and /var/log/maillog .

If this does not provide enough information, make sure that your sendmail is configured to accept mail from localhost and that your firewall is not blocking access.

0
source

To verify that port 25 is open, try using sockstat , such as root, for example:

 sockstat -4l 

Use sysrc to ensure sendmail is enabled / running at boot time:

 sysrc sendmail_enable="YES" 

Run / restart by doing:

 /etc/rc.d/sendmail restart 

Alternatively, you may need to configure ssmpt as a replacement for sendmail so that you can use your own provider to send emails.

0
source

Source: https://habr.com/ru/post/1207769/


All Articles