Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Location: The green fields of Brabant, Netherlands
Posts: 605
Apache + PHP + Sendmail?
I am transfering a php built website from a webhoster to our own webserver.
Apache and PHP aren't a real problem, except for the mail() command in PHP.
The server is not required to act as a mailserver for the domains hosted on it. Only some PHP forms need to send their info externally using the mail() command.
This I don't seem to be able to achieve
And since the originating server is a Windows machine, there is nothing to peek at.
Anybody care to help me on my way with this? The PHP forms do not generate any kind of error.
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
Relevant piece of sendmail.mc:
Quote:
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
__________________ "Yoda of Borg are we: Futile resistance is. Assimilate you, we will." Distributions in use: CentOS 5.3 Registered Linux user #327830 100% on Linux since september 7, 2003 - now I am free!
Oct 25 08:37:52 antarctica sendmail[3730]: l9P6bqrx003730: Authentication-Warning: localhost.localdomain: apache set sender to working-address@other-provider.com using -f
Oct 25 08:38:14 antarctica sendmail[3733]: l9P6bqAq003731: to=<working-address@provider.com>, delay=00:00:22, xdelay=00:00:22, mailer=esmtp, pri=120533, relay=gsmtp163.google.com. [64.233.163.27], dsn=4.0.0, stat=Deferred: Connection reset by gsmtp163.google.com.
Based on this, I assume php/apache is configured properly (since the mails go out), but do I need to tweak sendmail ?!?
Any advice welcome of course!
__________________ "Yoda of Borg are we: Futile resistance is. Assimilate you, we will." Distributions in use: CentOS 5.3 Registered Linux user #327830 100% on Linux since september 7, 2003 - now I am free!
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Location: The green fields of Brabant, Netherlands
Posts: 605
After I hit [CTRL][D] I got the following:
Quote:
EOT lakshmipathi.g@gmail.com... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Thu, 25 Oct 2007 15:10:37 +0200
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello antarctica [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<polarbear@localhost.localdomain> SIZE=138
250 2.1.0 <polarbear@localhost.localdomain>... Sender ok
>>> RCPT To:<lakshmipathi.g@gmail.com>
>>> DATA
250 2.1.5 <lakshmipathi.g@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 l9PDAbwH004487 Message accepted for delivery lakshmipathi.g@gmail.com... Sent (l9PDAbwH004487 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection
__________________ "Yoda of Borg are we: Futile resistance is. Assimilate you, we will." Distributions in use: CentOS 5.3 Registered Linux user #327830 100% on Linux since september 7, 2003 - now I am free!
Last edited by Redman; 10-25-2007 at 03:07 PM..
Reason: mail log info added
Location: The green fields of Brabant, Netherlands
Posts: 605
I tried the same on a mailbox at work and there I did get mail
Quote:
Van: SysAdmin [polarbear@localhost.localdomain]
Verzonden: donderdag 25 oktober 2007 15:43
Aan: Redman (company)
Onderwerp: webserver
**TEST**
__________________ "Yoda of Borg are we: Futile resistance is. Assimilate you, we will." Distributions in use: CentOS 5.3 Registered Linux user #327830 100% on Linux since september 7, 2003 - now I am free!
If I'm right,i think your mail reaches google but google not accepts your mail because ,
google doesn't recognice the from domain. ie. from address.
you can send mail from work station because your workstation as valid Exchange server i guess.
try commands , like
dig yourhostname
from home and office
it'll provide atleast 1 answer
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe