[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: About apache + sendmail (was: Re: Solved: Re: Is this an Apachefeature or a bug?-ans)



Michael Schwendt wrote:
> 
> On 2001-06-15, Alejandro González Hernández - Imoq wrote:
> 
> >Anyway, the script it's configured to be sent as: "user mydomain com",
> >and the user otherdomain com gets it well.
> >
> >BUT if there is an error in the user otherdomain com email address, or
> >the message can't be delivered, it gets back to "apache mydomain com"
> >instead of "user mydomain com". How can I prevent that?
> 
> Make sure the script is executed via suEXEC with the uid/gid of
> your user and not as 'apache'. Also, it depends on how the script is
> programmed and what method it uses to send mail. Would help if you
> could provide a copy of one of such mails.

OK, I took a look at the user's script (am I a bad sysadmin? don't think
so, the user knows that I'm trying to solve his problem), and found the
way he uses to send the mail; here is the snip:

open(MAIL, "|$MAILPROG -t");
print MAIL "To: $form{'email'}\n";
print MAIL "FROM: $ADMIN_EMAIL\n";
print MAIL "SUBJECT: $SITE_NAME Verificación de Cuenta\n\n";
print MAIL "Gracias por tu registro en $SITE_NAME.\n";
print MAIL "Para completar tu registro debes dar click en la siguiente
dirección:\n";
print MAIL "\n";
print MAIL
"$CGI_URL/verificar.cgi?userid=$form{'userid'}&email=$form{'email'}&action=add";
print MAIL "\n";
print MAIL "\n";
print MAIL "\n";
print MAIL "Si por alguna razón marca error la dirección anterior ve a
la siguiente y escribe\n";
print MAIL "este número de verificación:   $form{'userid'}\n";
print MAIL "\n";
print MAIL "$CGI_URL/verificar.cgi\n";
print MAIL "\n";
print MAIL "\n";
print MAIL "Saludos,\n";
print MAIL "$ADMIN_NAME.\n";
print MAIL "$BASE_URL\n";
 
#close (MAIL);


And the script (perl, btw, but you already realized it, didn't you? :P)
belongs to user:

[root mydomain cgi-bin]# ls -l registro.cgi
-rwxr-xr-x    1 imagemty usuarios     8031 Feb 10 20:41 registro.cgi
[root mydomain cgi-bin]#

I didn't find anything strange in /var/log/httpd/suexec_log, it doesn't
mention the script.


BTW, it does run fine in FreeBSD, if the email can't be sent, it bounces
to user mydomain com instead of apache mydomain com

Any help would be appreciate, thanks :).

Alex.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]