Hey, I've got a sendmail problem on a dedicated server, shall I post the configs or what do you suggest? Problem is, that all coming in via smtp is sent through fine, but messages I try to send via PHP mail() are not going through, error in root is "deferred: connection refused by [127.0.0.0]"

I guess I just have a block of wood in front of my head, can somebody help to remove it PLEASE!

some more details, I really hope someone can help:

file "access"

localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
myPOPIP RELAY (dont want to write it here, there is my provider IP, POP is working as well as SMTP...)

btw, telnet works:

telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 rummels.de ESMTP Sendmail 8.13.4/8.13.4/Debian-3sarge1; Fri, 22 Dec 2006 21:53:12 +0100; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]

and status of sendmail seems to be fine too:

# /etc/init.d/sendmail status
MSP: is run via cron (20m)
MTA: 8640 /usr/sbin/sendmail-mta -Am -L sm-mta -bd -q10m
UID        PID  PPID  C STIME TTY          TIME CMD
root      8640     1  0 22:32 ?        00:00:00 sendmail: MTA: accepting connections
QUE: Same as MTA

one thing I found (I just used several test commands and this is one result - there is no 127.0.0.1 there, :

# netstat -an|grep 25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
....tcp        0      0 serverip:25        220.174.224.223:2246    VERBUNDEN

etc.

like said, SMTP & POP are wonderful working, just this PHP mail() isn't, always the same error :(


maybe this helps you locating the problem :( thanks my friends!

ok, did some more tests now as suggested by other people, maybe this helps:

# sendmail -v -d8 -d38 validemail@validdomain.com
dsfsdfs
.
validemail@validdomain.com... Connecting to [127.0.0.1] port 587 via relay...
validemail@validdomain.com... Deferred: Connection refused by [127.0.0.1]

so there is the error again, on the other side:

# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 "myserver" ESMTP Sendmail 8.13.4/8.13.4/Debian-3sarge1; Sat, 23 Dec 2006 23:24:50 +0100; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
helo test
250 "myserver" Hello localhost [127.0.0.1], pleased to meet you
mail from: validemail@validdomain.com
250 2.1.0 validemail@validdomain.com... Sender ok
rcpt to: anothervalidemail@differentvaliddomain.com
250 2.1.5 anothervalidemail@differentvaliddomain.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
test message
.
250 2.0.0 kBNMOoZu004585 Message accepted for delivery
quit
221 2.0.0 myserver closing connection
Connection closed by foreign host.

this last one reached the email address fine, so via telnet it's working, via smtp it's working, just via sendmail directly & php not, this is very strange to me :(

I got no help from oyu here, but elsewhere, but probably you can help with the next problem that occured :(

when I send out mail via php to my gmail account, it always goes into spam, because of some header problems I think, I included SPF also, which is recognized, but doesn't change the situation to the better (exactly same email delivered via smtp from the same server works out to "land" in the inbox, it's freakin....):

Delivered-To: my-address-at@gmail.com
Received: by 10.82.153.10 with SMTP id a10cs185450bue;
        Sat, 6 Jan 2007 18:05:47 -0800 (PST)
Received: by 10.67.29.12 with SMTP id g12mr14006613ugj.1168135547091;
        Sat, 06 Jan 2007 18:05:47 -0800 (PST)
Return-Path: <sender@mydomain.com>
Received: from mydomain.com (mydomain.com [MY-SERVERs-IP-HERE])
        by mx.google.com with ESMTP id u6si37493585uge.2007.01.06.18.05.46;
        Sat, 06 Jan 2007 18:05:47 -0800 (PST)
Received-SPF: pass (google.com: domain of sender@mydomain.com designates MY-SERVERs-IP-HERE as permitted sender)
Received: from mydomain.com (localhost [127.0.0.1])
	by mydomain.com (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id l07261DL004032
	for <my-address-at@gmail.com>; Sun, 7 Jan 2007 03:06:02 +0100
Received: (from root@localhost)
	by mydomain.com (8.13.4/8.13.4/Submit) id l072613x004030;
	Sun, 7 Jan 2007 03:06:01 +0100
Date: Sun, 7 Jan 2007 03:06:01 +0100
Message-Id: <200701070206.l072613x004030@mydomain.com>
To: my-address-at@gmail.com
Subject: I got news for you
Reply-To: sender@mydomain.com
From: David <sender@mydomain.com>

the email via smtp (the one landing in the inbox at gmail has the following headers instead:

Delivered-To: my-address-at@gmail.com
Received: by 10.82.153.10 with SMTP id a10cs180353bue;
        Sat, 6 Jan 2007 15:02:32 -0800 (PST)
Received: by 10.67.121.15 with SMTP id y15mr31671422ugm.1168124551891;
        Sat, 06 Jan 2007 15:02:31 -0800 (PST)
Return-Path: <sender@mydomain.com>
Received: from mydomain.com (mydomain.com [MY-SERVERs-IP-HERE])
        by mx.google.com with ESMTP id 54si37319882ugp.2007.01.06.15.02.31;
        Sat, 06 Jan 2007 15:02:31 -0800 (PST)
Received-SPF: pass (google.com: domain of sender@mydomain.com designates MY-SERVERs-IP-HERE as permitted sender)
Received: from mylaptop ([MY-ADSL-IP-HERE])
	by mydomain.com (8.13.4/8.13.4/Debian-3sarge1) with SMTP id l06N2iSv029170
	for <my-address-at@gmail.com>; Sun, 7 Jan 2007 00:02:46 +0100
Message-ID: <000301c731e6$be0b28f0$0973a8c0@mylaptop>
From: "my name" <sender@mydomain.com>
To: <my-address-at@gmail.com>

like said, the subject + content of the mails is the same, just the headers coming from root@localhost (for the script?) seems the problem maybe, or what do you experienced users think? How can I change this problem to the better? A change in the php.ini or sendmail config? The way it is "working" at present is, that confirmation emails for comments etc. are going into spam of the commenting party and that's not good :(

Thanks again and in advance as well for your appreciated help!

This article has been dead for over six months. Start a new discussion instead.