Extension:SendmailToWiki

What can this extension do?
This extension allows user to insert, update or just view a wiki page with an e-mail client.

Usage
User can set a 5-digit PIN number in his user preferences page. He can then use the displayed e-mail address in form of +.@domain.com to post content. If the pin number is not present for a user, that user can not use this extension. For a successful action the sender address must match the e-mail address in user's profile.

The subject of the incoming e-mail is translated into page title and e-mail content into page content. To prevent misinterpretations the extension denies every action if the e-mail is not sent in plain text format.

The default action performed with this extensions is to insert or update a page identified by the title supplied in the subject using e-mail body as page content and reply only if there was an error, however you can prepend the title with one of the following options to change this behaviour:
 * [quiet] - do not reply in any case even if there was an error
 * [source] - do not change anything, just reply with page content (if found) in wikitext format; email body is ignored
 * [view] - do not change anything, just reply with page content (if found) in HTML format; email body is ignored
 * [reply] - after a successful action reply with new page content in HTML format
 * [createonly] - reply with error if page already exists
 * [nocreate] - reply with error if page does not exist

These options are stripped from title when performing the desired action.

Download
You can download the code via SVN from the MediaWiki source code repository, at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SendmailToWiki/. From a command line, you can call the following:

To view the code online, including version history for each file, you can go here.

Installation of MW code

 * Copy or move the checked out directory to the main MediaWiki 'extensions' directory.
 * Add the following code into your 'LocalSettings.php' in the main MediaWiki directory:

Installation of sendmail redirection

 * Check that you have [|mailparse] PHP libraries present in php configuration.
 * Check that you have [|mail] functions enabled and configured in PHP configuration.
 * Check that the script provided in extension's scripts subdirectory har the right permissions to be run as sendmail's Delivery Agent
 * Add the following aliases to your sendmail [|aliases database] and afterwards rebuild the aliases table (with newaliases). Replace the wiki url with your own and e-mail prefix if you changed the setting of $sendmailtowikiPrefix in your LocalSettings.php (the default is "wikipost"):

Configuration parameters

 * $sendmailtowikiPrefix - the prefix of e-mail addresses (default: wikipost). If you change this variable, make sure you change your sendmail aliases file accordingly.