Click to See Complete Forum and Search --> : Mail/Sendmail bizarreness


al@stair.org.uk
08-24-2002, 06:10 AM
I have a website running off a server that I've put together/configured (in linux), and it all seems to be working happily, except for sending emails from the pages.
Sendmail obviously works because I can send test mesages to local and external email addresses. However, if I send an email from a website, it never arrives if I send it to an external address.
I have found a work-around for this, but it is not the ideal solution - I can send it to a local user (eg postmaster), and if there is a .forward file in the users directory then that will send it to the external address. This obviously isn't ideal though, becuse I might want to send the email to one of several different addresses. Does anyone have any helpful suggestions?

Thanks,

Alastair

yelvington
08-24-2002, 02:08 PM
What MTA are you using -- sendmail, postfix, qmail, etc.?

Are your Web server and your mail server in agreement about the hostname?

What does the mail error log say?

Based in the info you provided, I'd be looking to see whether the MTA considers your Web mail to be non-local and blocks it as a normal antispam measure.

al@stair.org.uk
08-25-2002, 10:37 AM
I'm using sendmail. Where would I find an error log if there is one? I thought if there was an error, then postmaster/root got an email about (I've deliberately generated a couple of those). This certainly isn't doing that.

I don't think sendmail can be considering the web mail as non-local can it, if it will still deliver it to a local adress?

As far as I can tell, the web and mail servers are in agreement about the address (although I don't really know my way about it too well).

yelvington
08-25-2002, 11:24 AM
Your mail logs are probably in /var/spool/. As root, do this

cd /var/spool/mail
tail -f mail.log

This will continuously monitor the general mail logfile. Now run your PHP mail script on several addresses, internal and external, and see what it has to say.

You're probably running afoul of some sort of sendmail configuration issue. Sendmail is notoriously difficult to administer. That's one of the reasons many distributions have switched to other MTAs, such as Postfix, which are much easier to configure.

al@stair.org.uk
08-25-2002, 12:17 PM
hmmm there doesn't appear to be a log file. I'll have a more extensive poke around (logs, configs etc) when I next get a chance to go and actually sit at the computer, instead of dialling in to it with a 56K connection (shared with 3 other people)

Thanks for the suggestions.

jwalk76
08-28-2002, 02:39 PM
try /var/log/mail

Frag
09-09-2002, 02:05 PM
or find /var/spool -name mail.log

Dr. E.V. Hill
09-19-2002, 10:21 PM
Having a simular problem with PHP-Nuke, Sendmail is working but will not masquerade the domain when sending user registration to new users outside of my domain. I am new to PHP so I am at a loss here.

Dr.E.

jwalk76
09-20-2002, 07:53 AM
if you're using Apache, the e-mail will always show that it came from something like "apacheuser@hostname.com" unless you specifically alter the headers in your php script.

KoshNaranek
10-08-2002, 09:03 AM
Here is, how i did it... had kind of the same problem. We are using a Sun-Mail-Gateway.

Within our mail-domain everything worked fine... My linux-Box -> mail-gateway -> recipient...

All mails to "external" won't work...
until i've changed the header like this:


$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=ISO-8859-1\r\n";
$headers .= "From: $UserFullName <$sentby>\r\n";
if ($sendmeCC=='1'){$headers.="BCC: $sentby\r\n";}
$msubject=stripslashes(mb_encode_mimeheader($msubject, "ISO-8859-1", "Q"));
@mail("$sendto", $msubject , stripslashes($sendmsg), $headers, "-f$sentby");