123456789 |
- version=pmwiki-0.6.12
- newline=²
- text=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 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 MailPosts:²² $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 MailPosts are given [[#variables below]], and also described in the ''mailposts.php'' script.²²!!!Note for Windows installations²²Sites running PHP under Windows may not have PHP's [[http://www.php.net/mail 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.²²!!![[#variables]] MailPosts Variables²²<<|{{Variables}}|>>²²:$EnableMailPosts:Tells ''stdconfig.php'' to enable the MailPosts script.² $EnableMailPosts = 1; # enable mailposts² $EnableMailPosts = 0; # disable mailposts²²:$MailPostsTo:A comma separated list of email recipients.² $MailPostsTo = 'admin@example.com, joe@somewhere.org';²²:$MailPostsFrom:Return email address to be used in the sent email.² $MailPostsFrom = 'wiki@example.com';² $MailPostsFrom = 'Wiki server <wiki@example.com>';²²:$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²²:$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).² $MailPostsDelay = 43200; # wait 12+ hours between mailings²²:$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";²²:$MailPostsTimeFmt:The format for dates/times in $PostTime above. Defaults to the value of $TimeFmt.² $MailPostsTimeFmt = '%Y-%m-%d %H:%M'; # 2004-03-20 17:44²²:$MailPostsMessage:The body of the message to be sent. The string "$MailPostsList" is replaced with the list of posts (as formatted by $MailPostsItemFmt above).²²:$MailPostsSubject:The subject line of the mail to be sent.²²:$MailPostsHeaders:String of extra mail headers to be passed to the mail() function.²²:$MailPostsFunction:Name of the function to be called to send the mail. Defaults to using PHP's built-in @@[[http://www.php.net/mail 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'=];²²:$MailPostsFile:The scratch file where MailPosts keeps track of recent posting information. Defaults to @@[="$WikiDir/.mailposts"=]@@. Note that this file must generally be writable by the webserver process.²²²<<|DocumentationIndex|>>
- time=1079828901
- host=24.1.44.14
- agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
- rev=29
- author=Pm
- name=PmWiki.MailPosts
|