Go to the FreeLists Home Page Home Signup Help Login
 



[dokuwiki] || [Date Prev] [09-2005 Date Index] [Date Next] || [Thread Prev] [09-2005 Thread Index] [Thread Next]

[dokuwiki] Re: email > wiki

  • From: Riny Heijdendael <riny@xxxxxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 10 Sep 2005 12:34:05 +0200
Redeeman wrote:
On Fri, 2005-09-09 at 06:26 +0900, dc wrote:

is there a plugin to allow me to "cc my wiki" ?

eg something that will read a mail account + dump msg content into a
dokuwiki page?

well it shouldnt be too hard to create... just setup a MDA for your MTA, and make it run a script.. it should be easily doable using maildrop with a script that reads the mail, and then makes a file under the datadir

DC

Just an example on how to get mails from an email account, this will display the contents of an email imap box. By extending this with Redeemans suggestion to dump the contents in a file rather than displaying it, you may get it just the way you want it.

<?
//open imap mailbox : please use the right ipaddress/name/passw
$mailbox = imap_open("{myemailserveripaddress/imap:143}INBOX","imapusername","imappassword");
// Check messages
$check = imap_check($mailbox);
// Nr of messages
$noofmsg=$check->Nmsgs;
// Get mailbox
for ($index=1; $index<=$noofmsg; $index++){
$header = imap_header($mailbox, $index);
print("<PRE>");
print("Messagenumber : " . $index . "<BR>");
print("Date : " . $header->Date . "<BR>");
print("From : " . $header->From . "<BR>");
print("Subject : " . $header->Subject . "<BR></PRE>");
print("<PRE>");
print(addslashes(imap_body($mailbox,$index)));
print("</PRE>");
$mdbody = addslashes(htmlspecialchars(imap_body($mailbox,$index)));
echo $mdbody;
$mdid = base64_encode($id);
$mdfrom = htmlspecialchars($header->From);
$mdsubject = htmlspecialchars($header->Subject);
echo "<HR>";
// Optionally delete the message afterwards
//imap_delete($mailbox, $index);
}
imap_close($mailbox);
?>



Good luck, riny



--
dc <lister@xxxxxxxxxx>



-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist




[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.