> > was working today on the standard MailFormTo utility function, when I ran
> > into a problem trying to get the emails sent succesfully.
> >
> > When connecting to a Qmail or SendMail MTA, mail will not be accepted
> > by the server because of missing parts in the way Embperl.pm uses
> > Net::SMTP.
> >
> > The mailserver disconnects because Embperl is not sending a HELO to the
> > server.
> >
> > The next thing in Embperl that caused problems on our servers (which are
> > all RedHat based) was the fact that Embperl did not send a "MAIL" command
> > to the mailserver.
> >
> > Our (messy) workaround for this in Embperl.pm was to add the following:
> >
> > --- snippet from Embperl.pm ---
> >
> > $smtp = Net::SMTP->new($ENV{'EMBPERL_MAILHOST'} || 'localhost', Debug =>
> > $ENV{'EMBPERL_MAILDEBUG'}, Hello => 'solbors.no') or die "Cannot connect
> > to mailhost" ;
> >
> > $smtp->mail("receipt\@solbors.no");
> >
> > ---- end of snippet -----------
> >
> > I expect that more users might run into similar problems. The solution we
> > came up with is quite messy, but we just didn't have the time for a more
> > elegant solution.
> >
> > We encoutered the problem on RedHat 5.x and 6.x machines, running QMail
> > and SendMail 8.9.x MTAs
> >
> 
> Depends on which version of Embperl you are using. Newer versions contains a
> mail method call:
> 
>     { $smtp->mail($ENV{'EMBPERL_MAILFROM'} ||
> "WWW-Server\@$ENV{SERVER_NAME}");}
> 
> so you are able to set
> 
> PerlSetEnv EMBPERL_MAILFROM [EMAIL PROTECTED]
> 
> in your httpd.conf. This was really a problem with older (< 1.2.1) version
> of Embperl, but since your example contains the EMBPERL_MAILDEBUG already,
> it must be 1.2.1 or above and should already know  EMBPERL_MAILFROM.

Yes, that is correct. but the fact whether or not you actually use this
variable does not appear to affect the 'bug'. 

The problem lies in the fact that the mailserver is expecting a
"MAIL" command. As long as that one is not send (and it isn't since
embperl does't even get that far, Net::SMTP doesn't send it and therefor
the mailserver kindly disconnects us), we can't properly send the form
out.

> For the hello parameter Net::SMTP normaly takes a reasonable default value,
> so there was no need in the past to explicitly specify this parameter.

Apparently it doesn't take a reasonable default value. RedHat 6.x and 5.x
standard installed versions of SendMail expect you to explicitely send
that HELO parameter. Out-of-the-box Embperl does not support it.

One could argue ofcourse that this is something that Net::SMTP should take
care of, but including an optional parameter in Embperl isn't that much
more effort and would at least solve  the problem.

> You may set EMBPERL_MAILDEBUG to 1 in your httpd.conf and watch in your
> syslog the dialog between your mailserver and Net::SMTP. If there is really

I did that already, which is how I came to include the HELO and MAIL
parameters in my Embperl.pm

> no helo command in it, we have to take a closer look, but on my systems
> (sendmail 8.8.x and 8.9.x and postfix) I never run into this problems.

So far I can't get any forms send out with an unmodified Embperl (latest
release) on RedHat 5.x/SendMail and RedHat 6.x/qmail

> P.S. Please send any further questions to the Embperl mailing list, so
> others can participate

done :) Thanks for the support!

regards,
Remco Brink
SOL Bors developer


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to