To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Linux/Unix Help

Linux/Unix Help Help with server-side Linux and Unix issues

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-24-2002, 06:10 AM   #1
al@stair.org.uk
Junior Member
 
Join Date: Aug 2002
Posts: 3
Mail/Sendmail bizarreness

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
al@stair.org.uk is offline   Reply With Quote
Old 08-24-2002, 02:08 PM   #2
yelvington
Senior Member
 
Join Date: Dec 2000
Location: USA
Posts: 1,012
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.
yelvington is offline   Reply With Quote
Old 08-25-2002, 10:37 AM   #3
al@stair.org.uk
Junior Member
 
Join Date: Aug 2002
Posts: 3
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).
al@stair.org.uk is offline   Reply With Quote
Old 08-25-2002, 11:24 AM   #4
yelvington
Senior Member
 
Join Date: Dec 2000
Location: USA
Posts: 1,012
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.
yelvington is offline   Reply With Quote
Old 08-25-2002, 12:17 PM   #5
al@stair.org.uk
Junior Member
 
Join Date: Aug 2002
Posts: 3
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.
al@stair.org.uk is offline   Reply With Quote
Old 08-28-2002, 02:39 PM   #6
jwalk76
Junior Member
 
Join Date: Aug 2002
Posts: 19
try /var/log/mail
jwalk76 is offline   Reply With Quote
Old 09-09-2002, 02:05 PM   #7
Frag
Member
 
Join Date: Sep 2002
Location: Dallas
Posts: 98
or find /var/spool -name mail.log
__________________
Info Inflow Overload, Knowledge Blackhole Imminent
Frag is offline   Reply With Quote
Old 09-19-2002, 10:21 PM   #8
Dr. E.V. Hill
Junior Member
 
Join Date: Sep 2002
Location: Missouri
Posts: 1
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.
Dr. E.V. Hill is offline   Reply With Quote
Old 09-20-2002, 07:53 AM   #9
jwalk76
Junior Member
 
Join Date: Aug 2002
Posts: 19
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.
jwalk76 is offline   Reply With Quote
Old 10-08-2002, 09:03 AM   #10
KoshNaranek
Senior Member
 
KoshNaranek's Avatar
 
Join Date: Aug 2002
Location: Germany
Posts: 117
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:

PHP Code:
    $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");
__________________
The stroke of a brush does not guarantee art from the bristles
or in other words:
Do you like to sing? Learn how to!
KoshNaranek is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:14 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.