Procedural File: getmail.php
Source Location: /blogs/cron/getmail.php
pop3-2-b2 mail to blog
modified for 2.4.1 by Stephan Knauss. Contact me by PM in http://forums.b2evolution.net/ (user stephankn) or send a mail to stephankn at users.sourceforge.net
Uses MIME E-mail message parser classes written by Manuel Lemos: http://www.phpclasses.org/browse/package/3169.html
This script can be called with a parameter "test" to specify what should be done and what level of debug output to generate:
- level 0: default. Process everything, no debug output, no html (called by cronjob)
- level 1: Test only connection to server, do not process messages
- level 2: additionally process messages, but do not post
- level 3: do everything with extended verbosity
b2evolution - http://b2evolution.net/ Released under GNU GPL License - http://b2evolution.net/about/license.html
| Author: | tblue246: Tilman Blumenbach |
| Author: | Stephan Knauss |
| Version: | $Id: getmail.php,v 1.44 2010/02/08 17:50:51 efy-yury Exp $ |
| Copyright: | (c)2003-2010 by Francois PLANQUE - http://fplanque.net/ This file built upon code from original b2 - http://cafelog.com/ |
| Todo: | check different encodings. only tested with iso-8859-1 |
| Todo: | tested and working with thunderbird (text, html, signed), yahoo mail (text, html), outlook webmail, K800i |
| Todo: | try more exotic email clients like mobile phones |
| Todo: | Allow the user to choose whether to upload attachments to the blog media folder or to his user root. |
| Filesource: | Source Code for this file |
|
Print out a debugging message with optional HTML color added.
This function only outputs any additional HTML (colors,
) if $test is greater than 0.
| string | $strmessage: | The message to print |
| string | $color: | optional colour so use |
| integer | $level: | optional level to limit output to that level |
API Tags:
| Global: | integer $test: The test level |
|
look inside message to get title for posting.
The message could contain a xml-tag
- <title>sample title</title>
| string | $content: | message to search for title tag |
| string | $alternate_title: | use this string if no title tag is found |
API Tags:
| Return: | title of posting |
| See: | $post_default_title |
|
process attachments by saving into media directory and optionally creating image tag in post
Parameters:| array | $mailAttachments: | array containing path to attachment files |
| string | $mediadir: | path to media directory of blog as seen by file system |
| string | $media_url: | url to media directory as seen by user |
| bool | $add_img_tags: | should img tags be added (instead of adding a normal link) |
API Tags:
| Return: | true for sucessfull execution |
| Global: | bool 1: do we really post? |
| Global: | object global 2: b2evo settings |
| Global: | string $content$do_real_posting$Settings: message content that is optionally manipulated by adding image tags |
|
Process Header information like subject and date of a mail.
Parameters:| array | $header: | header as set by mime_parser_class::Analyze() |
| &$header: |
API Tags:
| Return: | true if valid subject prefix is detected |
| Global: | integer 3: The test level (read) |
| Global: | string $subject: The subject of the current message (write) |
| Global: | string $post_date$Settings: The post date of the current message (write) |
| Global: | object b2evo $test: settings (read) |
|
Provide sys_get_temp_dir for older versions of PHP (< 5.2.1).
code posted on php.net by minghong at gmail dot com Based on http://www.phpit.net/article/creating-zip-tar-archives-dynamically-php/2/
API Tags:
| Return: | path to system temporary directory |
|
Create a new directory with unique name.
This creates a new directory below the given path with the given prefix and a random number.
Parameters:| string | $dir: | base path to new directory |
| string | $prefix: | prefix random number with this |
| integer | $mode: | permissions to use |
API Tags:
| Return: | path to created directory |
