Ignore:
Timestamp:
12/13/08 16:58:36 (3 years ago)
Author:
CrawfordCurrie
Message:

Item456: work in progress

Location:
trunk/MailInContrib/data/System
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/MailInContrib/data/System/MailInContrib.txt

    r878 r1323  
    1 ---+!! <nop>MailInContrib for TWiki 
     1---+!! <nop>Mail In to Foswiki 
    22%SHORTDESCRIPTION% 
    33<a href="http://wikiring.com"><img src="%ATTACHURL%/logo.gif" style="float:right" /></a> 
    4 This Contrib supports the submission of content to TWiki topics via e-mail. 
     4This Contrib supports the submission of content to Foswiki topics via e-mail. 
    55 
    66<!-- 
     
    1111   you make will simply be overwritten the next time a release is generated. 
    1212 
    13    Instead, you could check your fix in, raise a bug in the Bugs web, or mail the author. 
     13   Instead, you could check your fix in, raise a bug in the Tasks web, or mail the author. 
    1414--> 
    1515 
    16 <div class="twikiBroadcastMessage" style="background-color:#ffc;">WARNING: TWiki-4 only. If you want to use this extension with an earlier version of TWiki, please use [[http://twiki.org/cgi-bin/attach/Plugins/%TOPIC%?filename=%TOPIC%.zip&revInfo=1][revision 7 of the zip]].</div> 
     16Mails can be pulled out of mail folders using [[CPAN:Email::Folder::POP3][POP3]], [[CPAN:Email::Folder::IMAP][IMAP]], or anything else supported by CPAN:Email::Folder. 
    1717 
    18 Mails for twiki can be pulled out of mail folders using [[CPAN:Email::Folder::POP3][POP3]], [[CPAN:Email::Folder::IMAP][IMAP]], or anything else supported by CPAN:Email::Folder. 
    19  
    20 The implementation is very simple; a script called =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. 
     18The implementation is very simple; a script called =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 wiki. 
    2119 
    2220For example, your wayward child might send a mail like this from an internet cafe in Thailand: 
     
    2826*Phuket*: I've run out of money! 
    2927</verbatim> 
    30 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.Topic<nop>Name 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. 
     28The 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 Web.Topic<nop>Name 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. 
    3129 
    3230In our example, the web exists, and so does the topic, so the following text gets appended to Travels.Daily<nop>Diary: 
     
    3836 
    3937</div> 
    40 Attachments to the mail get treated as attachments by TWiki, and attached to the target topic. 
     38Attachments to the mail get treated as attachments by Foswiki, and attached to the target topic. 
    4139 
    4240Note 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. 
     
    5149The module can use special HTML comments in the topic to decide where to insert new emails within the text. 
    5250 
    53 If it sees the comment =&lt;!--MAIL--&gt;= it will insert the incoming mail immediately *below* the comment. =MAIL= is rather ike a TWikiVariable; you can give it parameters. For example, =&lt;!--MAIL{where="below"}--&gt;=. The following options are available: 
     51If it sees the comment =&lt;!--MAIL--&gt;= it will insert the incoming mail immediately *below* the comment. =MAIL= is rather ike a [[%SYSTEMWEB%.Macro][Foswiki macro]]; you can give it parameters. For example, =&lt;!--MAIL{where="below"}--&gt;=. The following options are available: 
    5452   * =where= - can be =above=, =below= (relative to the comment) =top=, =bottom= (of the topic) 
    5553   * =template= set to the name of one of the templates in %SYSTEMWEB%.MailInContribTemplate to change the formatting of comments. The default format is "below" format. 
     
    5755If there is no such comment in the topic, then it just appends it to the end. If there is more than one, only the first is recognised. 
    5856 
    59 Any attachments in the mail get added to the target topic as TWiki attachments. Attachments are also listed immediately below the mail body in the topic. 
     57Any attachments in the mail get added to the target topic as attachments. Attachments are also listed immediately below the mail body in the topic. 
    6058 
    6159---+ How the contributor is identified 
    62 The user identity is used for access control checks on the target topic, so you can use TWiki access controls to protect target topics. 
     60The user identity is used for access control checks on the target topic, so you can use Foswiki access controls to protect target topics. 
    6361 
    6462You can configure the module to look at the =From:= 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. 
     
    6765 
    6866<!-- 
    69       * Set SHORTDESCRIPTION = Supports submissions to TWiki via e-mail 
     67      * Set SHORTDESCRIPTION = Supports submissions to Foswiki via e-mail 
    7068--> 
    7169 
     
    7472 
    7573__Note__: The CPAN =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. 
    76    * Set up cron (or equivalent) jobs to run =mailincron=. You must =cd= to the TWiki bin directory, and invoke the sript from there (this is so =mailincron= can read =setlib.cfg=) 
     74   * Set up cron (or equivalent) jobs to run =mailincron=. You must =cd= to the =bin= directory, and invoke the sript from there (this is so =mailincron= can read =setlib.cfg=) 
    7775 
    7876Because of the security issues involved (passwords for the mailboxes etc.) configuration uses variables set in your =LocalSite.cfg=. The easiest way to set them is using =configure=. 
    7977 
    80 The =mailincron= script takes one optional parameter, <tt>debug</tt>, which takes a boolean value e.g. <tt>debug=1</tt>. 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. 
     78The =mailincron= script takes one optional parameter, <tt>debug</tt>, which takes a boolean value e.g. <tt>debug=1</tt>. 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 wiki, or sending any mails. 
    8179 
    82 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: 
     80To run the script you need to set up a cron job. For example, to transfer mail into the wiki once every hour you might write: 
    8381<verbatim> 
    84 0 * * * * cd /home/twiki/bin && ../tools/mailincron 2&>1 >> /home/twiki/logs/mailincron.log 
     820 * * * * cd /home/twiki/bin && ../tools/mailincron 2>&1 >> /home/twiki/logs/mailincron.log 
    8583</verbatim> 
    8684You _must_ run the script from the bin directory. 
    87 Make sure that the cron is run by a user with the permissions needed to read and write the TWiki data directory. 
    88  
    89 This is a brand-new development, not related in any to the original Foswiki:Extensions/MailInAddon. Due acknowledgement is made to those early pioneers for the idea. ;-) 
     85Make sure that the cron is run by a user with the permissions needed to read and write the =data= directory. 
    9086 
    9187---++ Contrib Info 
    9288 
    93 Another great TWiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience! 
     89Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience! 
    9490 
    9591Many thanks to the following sponsors for supporting this work: 
    9692   * [[http://www.evolvedmedianetwork.com][Evolved Media Network]] 
    9793 
    98 |  Author: | TWiki:Main/CrawfordCurrie (http://c-dot.co.uk) | 
    99 |  Copyright &copy;: | 2005, TWiki Contributors | 
     94|  Author: | Foswiki:Main.CrawfordCurrie (http://c-dot.co.uk) | 
     95|  Copyright &copy;: | 2005, TWiki Contributors; 2008 Foswiki Contributors | 
    10096|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 
    10197|  Dependencies: | %$DEPENDENCIES% | 
     
    119115|  10 Mar 2005 | 1.000 Initial version | 
    120116|  Home: | Foswiki:Extensions/%TOPIC% | 
    121 |  Feedback: | Foswiki:Extensions/%TOPIC%Dev | 
    122 |  Appraisal: | http://foswiki.org/Extensions/%TOPIC%Appraisal | 
    123117 
    124118__Related Topics:__ %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences 
Note: See TracChangeset for help on using the changeset viewer.