When tracking down
Item2696 in
NatSkin, I found it necessary to modify the _generateEmails() function simply to understand why mails were not being sent out. As soon as I added the line:
$report .= "Mail error result: " . $error . "\n";
then I found a very informative error from the lower-level e-mail functions:
ERROR: Can't send mail, missing 'From:' at /var/www/wiki/lib/TWiki/Net.pm line 262.
At a minimum, _generateEmails() should indicate that one or more e-mails failed to go out. At present, it just reports the misleading "0 change notifications" as if no e-mails needed to be sent in the first place.
If all of the outgoing e-mails failed, I think _generateEmails() should notify _processChanges(), which would then NOT update the time-of-last-change. Based on my cursory understanding of this script (which could be wrong) the e-mails would be generated all over again on the next run. This logic protects against an unresponsive mail server or mangled mail template.
To really help an administrator, the _generateEmails() function should report to STDERR who it was trying to send to and what the sendEmail() error result was. It should generate this report even if the "-q" option has been specified. In a CRON environment, the error report would then be written into a system log file and would perhaps be e-mailed to the administrator.
Followed Scott's suggestions, which seem quite wise.
CC
4.1.0 released
KJL