email problem

Mike Rambo mrambo@lsd.k12.mi.us
Mon, 15 Oct 2001 13:09:28 -0400


Sean wrote:
> 
> You might need to create a user with the name you are sending it from and
> use this format.
> 

The user 'nobody' is, of course, valid on the database server - it's the
user ID apache runs under. I have no ability to create a user 'nobody'
on the outside mail server and even if I did, the domain would still be
wrong anyway. For the same reason I cannot just change the user ID
apache runs under. The outside server wants a From: address that is a
valid user with the domain set to lsd.k12.mi.us.

> To use "FirstName LastName <user@foo.tld>"
> Try this:
> mail($toName." <".$toAddress.">",$subject, $message, "From: ".$fromName."
> <".$fromAddress.">");
> 
> look at http://www.php.net/manual/en/ref.mail.php
> for more help.
> 

This is what I'm already doing. There must be an override somewhere
(seems like it must be in the sendmail config on the server)  that
changes the From: parameter to the value causing the problem - I just
can't find it. In PHP for win32 I know that this parameter can be set in
php.ini but; #1)I'm running Linux, not Winders - it's not at all clear
to me that the win32 setting would have any effect on unix, and #2) I
don't have a php.ini anyway as I've (thus far) found the default
settings that come into play in the absense of php.ini are suitable for
my purposes. Also, just in case, I tried using the set_ini function in
php to set the sendmail_from parameter and that hasn't helped either.
This sure looks like it must be something sendmail is doing.

Incidentally, I also tried to telnet to the database server using the
SMTP port as Ben suggested in a post to someone earlier. That method
works fine which only serves to confuse me more. I can't figure out
where in the chain of events this erroneous setting is getting applied,
and more importantly, why I can't force a change to a value that will
work.

> On Mon, 15 Oct 2001, Mike Rambo wrote:
> 
> > We're using apache/php/mysql for our repair database in the shop.
> >
> > We need to send an email to an outside 'official' email address under
> > certain circumstances. What I've run into is that the server (running
> > sendmail) sends the email and sets the From: address to be from the user
> > apache runs under on the server box  (nobody@server.domain.local in this
> > case). This email gets kicked back from the outside mail server (not
> > under our control) as being an invalid email address.
> >
> > Is there a way to make the email appear to come from a valid user on the
> > outside server (repair@lsd.k12.mi.us in this case) so it won't get
> > rejected? I've tried setting the From: attribute in the php mail()
> > function without any success. The From: gets correctly set in the email
> > itself but this has no effect on the account it is sent from using the
> > database system.
> >
> > Oddly enough, if I set kmail on my workstation to use the same server
> > box to send mail but specify a valid address that the email comes from I
> > find that all mail forwards through the box just fine. I've looked
> > through the sendmail config but haven't found anything. I know the box
> > can forward the mail and I know the outside server will accept it so
> > long as it comes from a valid email address but I can't get the
> > apache/php stuff to use the address I need. What am I missing?
> >
> > Thanks.
> >
> >
> >

-- 
Mike Rambo
mrambo@lsd.k12.mi.us