.





About this Site - Sitemap



UTOPIE

----1400----

VORLÄUFER

----1890----

LEBENSREFORM

BOHEME

  • in München
----1918----

RÄTEREPUBLIK

  • in München

ARBEITERTHEATER 1880-1930s

WEIMARER REPUBLIK

  • braunes München
  • Berlin
  • Moskau - Paris - New York
----1955----

1960 - 1970 - 1980

----1989----

HEUTE



























edit this sidebar



Recent Changes Printable View Page History Upload File Edit Page

The mailposts.php script allows a site administrator to configure Pm Wiki to send email messages whenever pages are changed on the wiki site. Mail Posts 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 Mail Posts feature is especially useful for sites that have infrequent updates, eliminating the need to frequently check Recent Changes pages just to see if anything has changed.

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

 $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

Note that $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.

Note for Windows installations

Sites running PHP under Windows may not have PHP's mail function configured correctly. Such sites may need to add a line like

    ini_set('SMTP','smtp.server.com');

to config.php, where smtp.server.com is the name of your host's preferred outgoing mail server.

Mail Posts Variables

<< | Variables | >>

%apply=item id=Enable Mail Posts?%$EnableMailPosts
Tells stdconfig.php to enable the Mail Posts script.
        $EnableMailPosts = 1;          # enable mailposts
        $EnableMailPosts = 0;          # disable mailposts
%apply=item id=Mail Posts To?%$MailPostsTo
A comma separated list of email recipients.
        $MailPostsTo = 'admin@example.com, joe@somewhere.org';
%apply=item id=Mail Posts From?%$MailPostsFrom
Return email address to be used in the sent email.
        $MailPostsFrom = 'wiki@example.com';
        $MailPostsFrom = 'Wiki server <wiki@example.com>';
%apply=item id=Mail Posts Delay?%$MailPostsDelay
The length of time (seconds) to wait before sending mail after the first post. Defaults to zero - posts are sent as soon as the $MailPostsSquelch period has expired.
        $MailPostsDelay = 360;    # send mail 6+ min after first post
%apply=item id=Mail Posts Squelch?%$MailPostsSquelch
The minimum length of time (seconds) that must elapse between sending mail messages. Useful when $MailPostsDelay is set to a small value to keep the number of mail notification messages down. Defaults to 7200 (two hours).
        $MailPostsSquelch = 43200;  # wait 12+ hours between mailings
%apply=item id=Mail Posts Item Fmt?%$MailPostsItemFmt
The text to be sent for each changed item in the post. The string "$PostTime" is substituted with the time of the post (controlled by $MailPostsTimeFmt below).
        # default
        $MailPostsItemFmt = ' * $PageName . . . $PostTime by $Author';
        # include the page's URL in the message
        $MailPostsItemFmt =
          " * \$PageName . . . \$PostTime by \$Author\n     \$PageUrl";
%apply=item id=Mail Posts Time Fmt?%$MailPostsTimeFmt
The format for dates/times in $PostTime above. Defaults to the value of $TimeFmt.
        $MailPostsTimeFmt = 'm-H:%M';  # 2004-03-20 17:44
%apply=item id=Mail Posts Message?%$MailPostsMessage
The body of the message to be sent. The string "$MailPostsList" is replaced with the list of posts (as formatted by $MailPostsItemFmt above).
%apply=item id=Mail Posts Subject?%$MailPostsSubject
The subject line of the mail to be sent.
%apply=item id=Mail Posts Headers?%$MailPostsHeaders
String of extra mail headers to be passed to the mail() function.
%apply=item id=Mail Posts Function?%$MailPostsFunction
Name of the function to be called to send the mail. Defaults to using PHP's built-in mail() 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';
%apply=item id=Mail Posts File?%$MailPostsFile
The scratch file where Mail Posts keeps track of recent posting information. Defaults to "$WikiDir/.mailposts". Note that this file must generally be writable by the webserver process.

Category: Administration

<< | Documentation Index | >>

This page may have a more recent version on pmwiki.org: PmWiki:MailPosts, and a talk page: PmWiki:MailPosts-Talk.

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on December 17, 2006, at 02:23 AM