[Pmwiki-users] new mailposts feature for PmWiki

Patrick R. Michaud pmichaud at sci.tamucc.edu
Sun Apr 13 02:36:32 CDT 2003


Hello, all--

Today I implemented a "MailPosts" script for PmWiki, released in pmwiki-0.4.12.
The mailposts.php script allows a site administrator to configure PmWiki 
to send email messages whenever pages are changed on the wiki site.
MailPosts can be configured so that multiple page changes over a short
period of time are combined into a single email message (to avoid 
flooding a mailbox).

The MailPosts feature is especially useful for sites that have infrequent
updates, eliminating the need to frequently check RecentChanges
pages just to see if anything has changed.

Full configuration details for configuration are available in 
scripts/mailposts.php, but here's the brief synopsis of what needs to go
in local.php or a per-group customization script for MailPosts:

$EnableMailPosts=1;                   # to enable mailposts
$MailPostsTo="somebody at example.com";  # where to send mail notifications
$MailPostsDelay=1800;                 # wait for initial post to age 30 minutes
$MailPostsSquelch=7200;	              # require at least two 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 could be much longer than
the delay period for inactive sites).  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.

There are other configuration variables to control the return email address,
the text of the message being sent, etc.  For details on these, see
scripts/mailposts.php.

Note that this is definitely an "evolving feature", so it may have some
substantial changes made to it in the future.  If anyone has any comments
or suggestions on how it could be improved (especially the timing features),
please let me know!

Pm





More information about the pmwiki-users mailing list