Question
The SMTP server I need to connect to requires authentication, yet I'm not seeing where or how to include my username and password for this server in my twiki installation. I did stumble across:
UsingSmtpMailServerAuthentication
but the problem is that the poster says that the solution doesn't work, while I'm not sure how the newer Perl version (which I am using) solves this problem. Could someone who knows something about PERL and TWiki please advise.
Thanks
Environment
--
CraigAumann - 04 May 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Some weeks ago I've advised the same hack in
HtpasswdRegistration (at the end of a long story) and it worked with plain
Net::SMTP - but I was careless enough
not to call
ok. Anyway, the code in
UsingSmtpMailServerAuthentication is broken because it returns unconditionally. Try to replace:
$smtp -> auth('mrjcleaver', 'mypassword');
my $status = ($smtp->ok() ? "" : "ERROR: Can't authenticate using Net::SMTP ". $smtp->message);
- return $status;
+ return $status if $status;
my $status = "";
--
HaraldJoerg - 04 May 2006
Thanks! I made these changes. Problem now is, I have no idea how to test whether it is working as I know nothing about PERL. Just running the notification script doesn't seem to work (meaning I didn't get an email) and /data/logxxx and /data/warnxxx both say nothing.
--
CraigAumann - 05 May 2006
What type of mails are you trying to create?
- For mails about user registration you'd have to register a new user
- For notification about new topics you have to first register in a web's WebNotify topic, then to change a topic, and then to run
mailnotify.
Go to your installation's
tools directory and run
perl -I ../bin mailnotify
Check your local
TWiki/MailerContrib about the parameters of the
mailnotify script.
--
HaraldJoerg - 05 May 2006
Thanks! Originally, such notifications were sent by sendmail. But sendmail wasn't set-up right... So I hoped that the above would provide an easier work around. I've switched to Postfix which may have resolved the problem.
Thanks for your thoughts.
--
CraigAumann - 06 May 2006