Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | MailInContrib for TWiki<-- Contributions to this extension are appreciated. Please update the extension page at http://twiki.org/cgi-bin/view/Plugins/MailInContribAdd content to TWiki topics via e-mail IntroductionMails for twiki can be pulled out of mail folders using POP3![]() ![]() ![]() mailincron is run every so often (usually by cron or an equivalent offline job scheduler). The script trawls the mail folders you specify and grabs messages that it recognises as being for the TWiki.
For example, your wayward child might send a mail like this from an internet cafe in Thailand:
To: twiki@mum_and_dad.org.uk From: gapper@isp.co.uk Subject: Travels.DailyDiary: cashless *Phuket*: I've run out of money!The message lands in your email folder at your ISP. Once an hour, a cron job runs the mailincron script, which scans the folder. If it finds any messages that have nothing but a correctly formatted TWiki Web.TopicName in the subject line, that topic is appended to (created) with the plain text of the email. The Web must exist, though the topic will be created if necessary. Both web and topic must be specified.
In our example, the web exists, and so does the topic, so the following text gets appended to Travels.DailyDiary:
Phuket: I've run out of money!
-- Prodigal Son <gapper@isp.co.uk> 10 Jul 2005 08:35:11 -0900
Attachments to the mail get treated as attachments by TWiki, and attached to the target topic.
Note that mailincron will only process messages that have arrived since the last time it ran. So if there was an error adding a mail, it won't attempt to add it again even if it is still in the inbox.
--++ Where the mail gets added
The target topic for a mail is normally specified in the Subject: of the mail. You just put Web.Topic as the first thing on the subject line, optionally followed by a colon and other subject text. Alternatively you can configure the module to examine the To: field in the mail and get the topic name from there instead.
<!--MAIL--> it will insert the incoming mail immediately below the comment. MAIL is rather ike a TWikiVariable; you can give it parameters. For example, <!--MAIL{where="below"}--> . The following options are available:
How the contributor is identifiedThe user identity is used for access control checks on the target topic, so you can use TWiki access controls to protect target topics. You can configure the module to look at theFrom: entry in the email, and if a registered user has set that email (see ChangeEmailAddress), then they are identified as the contributor. Note that there is a security risk here, as the From: address in e-mail can easily be spoofed.
You can also optionally set a default user for an inbox, so if the user can't be identified from the mail, it will fall back to the default.
<--
InstallationYou do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running. Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.
Email modules uses many pluggable modules to support different folder types. It's impossible to cover all the options here; all we can suggest is that you try running the script from the command-line and resolve missing modules as you find them.
LocalSite.cfg . The easiest way to set them is using configure .
The mailincron script takes one optional parameter, debug, which takes a boolean value e.g. debug=1. If you pass anything other than 0 or the empty string in debug , the script will scan the mail folders, describe what it would have done, and exit, without modifying any folders, the TWiki, or sending any mails.
To run the script you need to set up a cron job. For example, to transfer mail into the TWiki once every hour you might write:
0 * * * * cd /home/twiki/bin && ../tools/mailincron 2&>1 >> /home/twiki/logs/mailincron.logYou must run the script from the bin directory. Make sure that the cron is run by a user with the permissions needed to read and write the TWiki data directory. This is a brand-new development, not related in any to the original TWiki:Plugins/MailInAddon ![]() ![]() Contrib InfoMany thanks to the following sponsors for supporting this work:
|