Hello everybody
Sorry if my english is not perfect.
I run a linux/apache/php/mysql server and I wanted to send mail through php with the mail function
It didn't work
After a few search on the web, i knew php use sendmail
in my /etc/php.ini file there is :
to test sendmail, i did (i replaced the email address) :
it didn't work either and with the -v option it said:
After that command with the mail program i got this mail :
So i thought it didn't work because sendmail don't know my isp smtp server
After a "man sendmail" i found nothing to specify it (i also tried the -G option (we never know))
So i look at the configuration files in /etc/mail
In the /etc/mail/access file i have :
which should be ok because i just want to send mail from my computer
domaintable, virtusertable and mailertable are empty
so i search again on the web and find maybe postfix is the solution
i looked in /etc/postfix
the main.cf was interesting
i added the line
then i rebooted ... but it didn't change nothing
the file /etc/postfix/access is completely commented
as root when i do /usr/sbin/postfix check, i get:
So my questions are :
1. What does sendmail and postfix do? (and what are the relations between them?)
2. Does evolution (or another mail client) use sendmail ? (because it works)
3. How to configure sendmail (or postfix) to send the mails through my isp smtp server
4. Is there another solution to send these mails ?
Thanks a lot
ramBB
Sorry if my english is not perfect.
I run a linux/apache/php/mysql server and I wanted to send mail through php with the mail function
It didn't work
After a few search on the web, i knew php use sendmail
in my /etc/php.ini file there is :
Code:
sendmail_path = /usr/sbin/sendmail -t -i
to test sendmail, i did (i replaced the email address) :
Code:
echo "test" | /usr/sbin/sendmail -t -i rambo@ulb.ac.be
Code:
rambo@ulb.ac.be... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.12.8/8.12.8; Sun, 26 Oct 2003 19:54:35 +0100
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello Ordi1 [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:<ramb@localhost.localdomain> SIZE=5
250 2.1.0 <ramb@localhost.localdomain>... Sender ok
>>> RCPT To:<rambo@ulb.ac.be>
>>> DATA
250 2.1.5 <rambo@ulb.ac.be>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h9QIsZZD001289 Message accepted for delivery
rambo@ulb.ac.be... Sent (h9QIsZZD001289 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection
After that command with the mail program i got this mail :
Code:
From MAILER-DAEMON@localhost.localdomain Sun Oct 26 19:16:22 2003
Date: Sun, 26 Oct 2003 19:16:22 +0100
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
To: <ramb@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="h9QIGMZD001202.1067192182/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message
--h9QIGMZD001202.1067192182/localhost.localdomain
The original message was received at Sun, 26 Oct 2003 19:16:21 +0100
from Compu1 [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<rambo@ulb.ac.be>
(reason: 553 <ramb@localhost.localdomain>... Please use an existing source domain name.)
----- Transcript of session follows -----
... while talking to mailhost.ulb.ac.be.:
>>> MAIL From:<ramb@localhost.localdomain> SIZE=287
<<< 553 <ramb@localhost.localdomain>... Please use an existing source domain name.
501 5.6.0 Data format error
--h9QIGMZD001202.1067192182/localhost.localdomain
Content-Type: message/delivery-status
Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; Compu1
Arrival-Date: Sun, 26 Oct 2003 19:16:21 +0100
Final-Recipient: RFC822; rambo@ulb.ac.be
Action: failed
Status: 5.1.3
Diagnostic-Code: SMTP; 553 <ramb@localhost.localdomain>... Please use an existing source domain name.
Last-Attempt-Date: Sun, 26 Oct 2003 19:16:22 +0100
--h9QIGMZD001202.1067192182/localhost.localdomain
Content-Type: message/rfc822
Return-Path: <ramb@localhost.localdomain>
Received: from localhost.localdomain (Compu1 [127.0.0.1])
by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h9QIGLZD001200;
Sun, 26 Oct 2003 19:16:21 +0100
Received: (from ramb@localhost)
by localhost.localdomain (8.12.8/8.12.8/Submit) id h9QIGLEA001198;
Sun, 26 Oct 2003 19:16:21 +0100
Date: Sun, 26 Oct 2003 19:16:21 +0100
From: ramb<ramb@localhost.localdomain>
Message-Id: <200310261816.h9QIGLEA001198@localhost.localdomain>
test
--h9QIGMZD001202.1067192182/localhost.localdomain--
So i thought it didn't work because sendmail don't know my isp smtp server
After a "man sendmail" i found nothing to specify it (i also tried the -G option (we never know))
So i look at the configuration files in /etc/mail
In the /etc/mail/access file i have :
Code:
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
which should be ok because i just want to send mail from my computer
domaintable, virtusertable and mailertable are empty
so i search again on the web and find maybe postfix is the solution
i looked in /etc/postfix
the main.cf was interesting
i added the line
Code:
relayhost=relay.skynet.be
the file /etc/postfix/access is completely commented
as root when i do /usr/sbin/postfix check, i get:
Code:
postfix: warning: My hostname Compu1 is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
postsuper: warning: My hostname Compu1 is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
So my questions are :
1. What does sendmail and postfix do? (and what are the relations between them?)
2. Does evolution (or another mail client) use sendmail ? (because it works)
3. How to configure sendmail (or postfix) to send the mails through my isp smtp server
4. Is there another solution to send these mails ?
Thanks a lot
ramBB