Hi,
>
> 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 receipt@solbors.no
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.
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.
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
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.
Gerald
P.S. Please send any further questions to the Embperl mailing list, so
others can participate
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
>
> 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 receipt@solbors.no
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.
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.
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
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.
Gerald
P.S. Please send any further questions to the Embperl mailing list, so
others can participate
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------