De SimulacreS
Note that$EnableMailPosts
=1; # to enable mailposts$MailPostsTo
=“somebody@example.com”; # where to send mail$MailPostsDelay
=1800; # wait 30+ min after initial post$MailPostsSquelch
=7200; # require 2+ hours between mails
$MailPostsTo
may be a comma-separated list of addresses if multiple recipients are desired.
Since an initial post is often followed by several posts containing minor edits, it’s useful to wait a short period of time before sending an email. $MailPostsDelay
is the minimum amount of time that must elapse from an initial post before a message is sent. Any additional posts occuring during the delay period are included in the message when it is sent. The message is sent on the first execution of pmwiki.php after the delay period has expired (which for inactive sites could be much longer than the delay period). A delay of zero means to immediately send a message whenever an update is received.
$MailPostsSquelch
specifies the minimum amount of time that must elapse before sending another notification message. This is useful to prevent large number of rapid-succession messages if $MailPostsDelay
is set to a small value.
The defaults for $MailPostsDelay
and $MailPostsSquelch
are 0 and 7200. With these values, an email is sent as soon as a page is changed, and subsequent changes are “held” for at least two hours before being sent in another message.
The variables used to control Mail Posts are given below, and also described in the mailposts.php script.
ini_set(‘SMTP’,’smtp.server.com’);to config.php, where smtp.server.com is the name of your host’s preferred outgoing mail server.
$EnableMailPosts
$EnableMailPosts
= 1; # enable mailposts$EnableMailPosts
= 0; # disable mailposts
$MailPostsTo
$MailPostsTo
= ‘admin@example.com, joe@somewhere.org’;
$MailPostsFrom
$MailPostsFrom
= ‘wiki@example.com’;$MailPostsFrom
= ‘Wiki server <wiki@example.com>’;
$MailPostsDelay
$MailPostsSquelch
period has expired.
$MailPostsDelay
= 360; # send mail 6+ min after first post
$MailPostsSquelch
$MailPostsDelay
is set to a small value to keep the number of mail notification messages down. Defaults to 7200 (two hours).
$MailPostsDelay
= 43200; # wait 12+ hours between mailings
$MailPostsItemFmt
$MailPostsTimeFmt
below).
# default$MailPostsItemFmt
= ‘ * $PageName . . . $PostTime by $Author’; # include the page’s URL in the message$MailPostsItemFmt
= “ * \$PageName . . . \$PostTime by \$Author\n \$PageUrl”;
$MailPostsTimeFmt
$TimeFmt
.
$MailPostsTimeFmt
= ‘m-H:%M’; # 2004–03–20 17:44
$MailPostsMessage
$MailPostsItemFmt
above).
$MailPostsSubject
$MailPostsHeaders
$MailPostsFunction
mail() [2]
function, but some systems may not be configured correctly. Can be set to 'MailPostsSendmail' to explicitly call /usr/lib/sendmail.
# call /usr/lib/sendmail directly instead of using mail()
$MailPostsFunction
= 'MailPostsSendmail';
$MailPostsFile
"$WikiDir/.mailposts"
. Note that this file must generally be writable by the webserver process.