You are here: TWiki> Codev Web>NetSMTP (2001-11-22, JohnRouillard)
Tags:
create new tag
, view all tags
Changes have committed to the cvs version of TWiki in order to use Net::SMTP. Use of this requires an addition TWikiPreferences option MAILHOST.

The final version will fall back to sendmail if Net::SMTP not avaliable or MAILHOST is an empty string.

-- NicholasLee - 16 Feb 2001

Improved TWiki::Net to find out at compile time if Net::SMTP is available. If no, sendmail is used.

Send mail error message is shown to user with new oopssendmailerr.tmpl template.

Commited to TWikiAlphaRelease.

-- PeterThoeny - 25 Feb 2001 <br

We need to make a small change in the spec to make it less error prone. It happens sometimes that Net::SMTP is installed but does not work correctly, Support.CantRegisterMaybeDueToMailHostBug is an example. With the current spec it is not possible to choose between sendmail and Net::SMTP, Net::SMTP is used in case it is installed.

New spec: The sendmail program has preference over Net::SMTP in case it is set in the config file.

  • The configuration, set $mailProgram = ""; by default. An empty value means that TWiki tries to use Net::SMTP.
  • In case Net::SMTP is not installed and $mailProgram is empty, show an error message stating: "please install Net::SMTP or enable sendmail by setting $mailProgram in the configuration. TWiki.cfg:

#                   mail program, default "" :
#                   Net::SMTP is used if it is installed and if $mailProgram
#                   is empty. To enable sendmail program, set $mailProgram to 
#                   "/usr/sbin/sendmail -t -oi -oeq"
$mailProgram      = "";

Changed the classification to FeatureToDo.

-- PeterThoeny - 10 May 2001

A couple of things:

  1. How about replacing SMTPMAILHOST with MAILMETHOD, where it either contains 'SENDMAIL' or SMTP:your.mail.ip.address
  2. Very nasty bug in the case that you are using SMTP and your SMTP gateway goes down. The code fails to initalise the SMTP mail object (Net.pm:172 if I recall) and takes the calling process down with it and returning the programming problem to the end user. Nasty because this tends to be only initiated by a user during registration, which is the first time they encounter TWiki.

-- MartinCleaver - 14 Nov 2001

MartinCleaver on 14 Nov 2001 said:

> 2 Very nasty bug in the case that you are using SMTP and your
> SMTP gateway goes down. The code fails to initalise the SMTP mail
> object (Net.pm:172 if I recall) and takes the calling process down > with it and returning the programming problem to the end user.
> Nasty because this tends to be only initiated by a user during
> registration, which is the first time they encounter TWiki.

Yup. This sounds just like the bug I mention in http://twiki.org/cgi-bin/view/Support/Line40ErrorExpectedLeftParen (sorry. Poor choice of wiki word in the original topic and I can't rename the topic.) with an error of

[Tue Nov 20 15:46:17 2001] register: Can't call method "mail" on an undefined value at ../lib/TWiki/Net.pm line 172.

where line 172 is indicated by the *:

my $smtp = Net::SMTP->new( $mailhost ); * $smtp->mail( $from ); $smtp->to( @to, { SkipBad => 1 } );

I just solved the problem turns out you were right. The smtp server was rejecting my delivery attempt. I will split http://twiki.org/cgi-bin/view/Support/Line40ErrorExpectedLeftParen and report this half as solved.

-- JohnRouillard - 21 Nov 2001

Topic revision: r5 - 2001-11-22 - 02:25:56 - JohnRouillard
 

Codev

share: Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon
Twiki, Inc.
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.