Bug: SENDMAIL/PERL SMTP MODULE SWITCH
Test case
The notification and registration mechanism is supposed to use sendmail to send email if the Perl SMTP module isn't installed. Though that module is installed on our server it doesn't appear to be functioning correctly. When TWiki tries to send mail and that module can't do the trick, it doesn't fall back to sendmail but just coughs up an error.
Fix record
To work around this, I just forced the "SMTP module detected" flag to "false" at line 38 in the "lib/TWiki/Net.pm" file, like so:
BEGIN {
$useSocket = 0;
eval {
# $useNetSmtp = require Net::SMTP;
$useNetSmtp = 0;
}
}
Environment
| TWiki version: |
8/01 (beta3) |
| TWiki plugins: |
none (std) |
| Server OS: |
Linux/x86 (Mandrake 6) |
| Web server: |
Apache |
| Perl version: |
5.x |
| Client OS: |
Win2k, OS X |
| Web Browser: |
IE5 |
--
MichaelKitchin - 16 Aug 2001
This bug still exists in TWiki20010901. The error it generates is:
Software error:
[Sat Oct 27 12:38:14 2001] Base64.pm: Can't locate MIME/Base64.pm in @INC
(@INC
contains: ../lib . /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005) at /home/httpd/twiki/bin/register line 26.
BEGIN failed--compilation aborted at /home/httpd/twiki/bin/register line 26.
For help, please send mail to the webmaster (foo@bar.com), giving this error message
and the time and date of the error.
Note that the patch to Net.pm described above did not fix the problem.
Environment
| TWiki version: |
2001-09-01 |
| TWiki plugins: |
none (std) |
| Server OS: |
Linux/x86 (Redhat 6.2) |
| Web server: |
Apache |
| Perl version: |
5.005_03 |
| Client OS: |
Linux/x86 |
| Web Browser: |
Netscape Communicator 4.73 |
--
JohnAltstadt - 27 Oct 2001
Perhaps Net::SMTP is not properly installed, since MIME::Base64 did not get installed? Try use
perl -MCPAN -e shell, then
install MIME:Base64 (see
http://www.cpan.com
for details and
CpanPerlModulesRequirement for discussion).
You may have to answer some setup questions first to use
CPAN, but once configured it's the easiest way to download and install
CPAN modules.
--
RichardDonkin - 28 Oct 2001
In my case Net::SMTP is
NOT installed, so TWiki has been configured to use sendmail instead. The target machine is currently running an older version of TWiki that uses sendmail correctly. I would like to be able to upgrade TWiki on this machine but I can't until the new version plays nice with sendmail again.
--
JohnAltstadt - 29 Oct 2001
We have just come up against a similar problem because our mail-out server has disappeared. Is there a configuration setting to completely disable the mail-out? If so, TWiki should (at least on registration) tell the user that no mail will be sent.
--
MartinCleaver - 01 Nov 2001
John, have a look at
RegistrationSubmitFailure - may be worth trying the change included there, as it will avoid looking for the MIME::Base64 module where it is not needed (i.e. not on Linux).
--
RichardDonkin - 02 Nov 2001
Thanks. That fixed it. Now I can upgrade the target Solaris box at work.
--
JohnAltstadt - 03 Nov 2001
Someone should probably sit down and re-write my Net::Smtp hack to use a try-catch type semantic with perl eval{}-if($@). I'd do it, but I dont have time at the moment or for a while.
This would probably generalise most of the bugs were been seeing with the mailer part of the code.
--
NicholasLee - 02 Dec 2001
Now it is possible to select between
Net::SMTP and
sendmail. Spec:
-
Net::SMTP is used if the module is installed.
- If not,
sendmail (defined in TWiki.cfg) is used.
-
Net::SMTP can be disabled (i.e. if there is an installation error) by setting SMTPMAILHOST in the TWikiPreferences to an empty value.
- A new SMTPSENDERHOST variable can be set to define the host sending mail (some SMTP require this)
In
TWikiAlphaRelease and TWiki.org.
--
PeterThoeny - 03 Dec 2001