4

So I've installed Sendmail service, Dovecot and SquirrelMail in my server. I arrived to receive mails from local clients (different hosts in the same newtork). But I cannot send mails from server to clients, and also when a client host try to send mail to another client of this server ,the server recieve it but it cannot relay it to the other client. (NB: I'm working only in a local network). This is the error from my mail.log:

Nov 30 15:34:10 dev sendmail[5620]: uAUFY8Jl005620: from=dev, size=4, class=0, nrcpts=1, msgid=<201611301534.uAUFY8Jl005620@dev.localhost>, relay=root@localhost
Nov 30 15:34:10 dev sendmail[5620]: uAUFY8Jl005620: to=FatimaZ@test.test2.fr, ctladdr=dev (1000/1000), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30004, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Nov 30 15:40:01 dev sm-msp-queue[5802]: uAUFQnYE005516: to=FatimaZ@test.test2.fr, ctladdr=dev (1000/1000), delay=00:13:12,

And whene client1 try to send to client2 , I get this error

Nov 30 15:57:52 dev sm-mta[5853]: uAUFvQin005853: client1@test.test2.fr ... User unknown
Nov 30 15:57:57 dev sm-mta[5853]: uAUFvQin005853: from=client1@test.test2.fr, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA, relay=client2.test.test2.fr [192.168.0.3]

This is how my /etc/hosts file looks like:

 127.0.0.1       dev.localhost dev
 127.0.1.1       dev   
 192.168.0.1     dnsServer1.test.test2.fr dnsServer1 
 192.168.0.1     mail.test.test2.fr       mail

And the /etc/mail/local-host-names :

localhost
192.168.0.1
mail.test.test2.fr
test.test2.fr
dev

I'm in ubuntu 14. Thank you for your help.

Extra info from comments:

$netstat -ant | grep :25 
tcp 0 0 192.168.0.1:25 0.0.0.0:* LISTEN 
tcp6 0 0 ::1:25 :::* LISTEN
5
  • What is reported by netstat -ant | grep :25?
    – AnFi
    Dec 1, 2016 at 20:44
  • hello @AndrzejA.Filip : netstat -ant | grep :25 reported tcp 0 0 192.168.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 ::1:25 :::* LISTEN
    – azert123
    Dec 1, 2016 at 21:28
  • Have you checked sendmail log files? e.g. for reports about overload safeguards
    – AnFi
    Dec 1, 2016 at 21:44
  • this is the last report i've got in my logfiles while trying to send an email from my server to a host client
    – azert123
    Dec 1, 2016 at 22:14
  • Nov 30 15:34:10 dev sendmail[5620]: uAUFY8Jl005620: from=dev, size=4, class=0, nrcpts=1, msgid=<201611301534.uAUFY8Jl005620@dev.localhost>, relay=root@localhost Nov 30 15:34:10 dev sendmail[5620]: uAUFY8Jl005620: to=FatimaZ@test.test2.fr, ctladdr=dev (1000/1000), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30004, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1] Nov 30 15:40:01 dev sm-msp-queue[5802]: uAUFQnYE005516: to=FatimaZ@test.test2.fr, ctladdr=dev (1000/1000), delay=00:13:12,
    – azert123
    Dec 1, 2016 at 22:15

1 Answer 1

3

Sendmail passes messages submitted by "send via command line sendmail" to local sendmail daemon listening at 127.0.0.1:25.

It seems that you sendmail listens only on IPv4 192.168.0.1:25 (local network?) and IPv6 ::1:25 (any). Most likely you wanted to accept incoming TCP connections only from local network.

Fix DAEMON_OPTIONS in your sendmail.mc file. Add listening on 127.0.0.1 or use listening on IPv4 "any".


In your sendmail.mc add the second DAEMON_OPTIONS listed below.
Recompile sendmail.mc into sendmail.cf and restart (or HUP) sendmail daemon.

DAEMON_OPTIONS(`Port=smtp, Addr=192.168.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA-loopback')dnl
13
  • can you please tell me how to do " listening on IPV4 -any- " ? but are u sur this is the solution for this problem? because all i want is to be able to send email from my server "sendmail" to other hosts in this local network , and thank you
    – azert123
    Dec 1, 2016 at 22:48
  • What's reported by 1) grep DAEMON_OPTIONS /etc/mail/sendmail.mc 2) grep DaemonPortOptions /dev/mail/sendmail.cf
    – AnFi
    Dec 1, 2016 at 23:06
  • grep DAEMON_OPTIONS /etc/mail/sendmail.mc reported 5 lines
    – azert123
    Dec 1, 2016 at 23:34
  • DAEMON_OPTIONS(`Port=smtp, Addr=192.168.0.1, Name=MTA')dnl
    – azert123
    Dec 1, 2016 at 23:36
  • DAEMON_OPTIONS(`Family=init6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
    – azert123
    Dec 1, 2016 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.