I have a web server running apache/php/mysql for web and postfix/courier
for mail. using the PEAR php code for sending mail my server can
successfully send mail from a php script as long as the recipient is a
local domain. (I can pick up the mail remotely using pop3).
If I try to send to a non-local domain I get an error about relaying
(see below for php output of successful send and failed send).
All I want is for the php scripts to be able to send mail to addresses
outside the server. I do not need to use the server as an smtp server
from remote locations.
I guess therefore that I don't need SASL or any authenticated SMTP. I'm
guessing that I need somehow to allow relaying and then to block port 25
on the external interface to stop ppl outside the server connecting to
relay spam.
Is this a correct assumption or am I barking up the wrong tree?
The box is running (i386) generic with raidframe, OpenBSD3.4, Postfix,
Courier IMAP, Apache.
Please can someone point me in the right direction? Here is the php
output of a successful send (to local domain) ...
SMTP -> FROM SERVER: 250 Ok: queued as 889C14CBC80 SMTP -> get_lines():
$data was "" SMTP -> get_lines(): $str is "221 Bye " SMTP ->
get_lines(): $data is "221 Bye " SMTP -> FROM SERVER: 221 Bye Message
has been sent
Here is the unsuccessful send (to foreign domain)...
SMTP -> FROM SERVER: 454 : Relay access denied SMTP -> ERROR: RCPT not
accepted from server: 454 : Relay access denied SMTP -> get_lines():
$data was "" SMTP -> get_lines(): $str is "250 Ok " SMTP -> get_lines():
$data is "250 Ok " SMTP -> FROM SERVER: 250 Ok Message could not be sent.
I can supply dmesg and or any other logs if required (I don't know which
logs to check on though!)
Many thanks,
Gary