Question
I have been wrestling with
MailNotify some time no, ever since sendmail was shut down permanently on the hosting server. Even though SMTPMAILHOST and SMTPSENDERHOST are set in my
global preferences
MailNotify tries to use sendmail.
After patching the scripts directly I found out that in sub sendEmail in lib/TWiki/Net.pm the code ...
$mailHost = &TWiki::Prefs::getPreferencesValue( "SMTPMAILHOST" );
$helloHost = &TWiki::Prefs::getPreferencesValue( "SMTPSENDERHOST" );
... yields undef values even though they
are set in the preferences. If I hardcoded the mailserver information here, TWiki used Net::SMTP and sent the mail (
however, the sender was listed as WIKIWEBMASTER in percentsigns even though that preference value has also been set in my global preferences).
Seems like the preferences don't make it to the Net module. Some preferences (like the logo to use, etc.) work fine from the global preferences, so far I've only experienced that the mail configuration information is lost.
(Incidentally, the notification mails also contain an unexpanded HTTP_EQUIV_ON_VIEW and WEBCOPYRIGHT reference, but this happened when sending through sendmail also and probably not related to any of this.)
Environment
--
MadsTroest - 05 Dec 2003
Answer
Are you running mailnotify from a cron job? If so, try running testenv from the same cron job so you can see the path - it's possible that the TWiki.cfg is not being picked up properly, although I'd have expected another error.
--
RichardDonkin - 05 Dec 2003
Yes, I do run mailnotify from a cronjob but it starts by changing into the bin/ directory. However, I get exactly the same results when executing mailnotify from a shell on the server (standing in the bin/ directory). The output it produces report no errors of any kind, just says that it sent the change report. I've attached the "testenv" output for the site.
--
MadsTroest - 05 Dec 2003