Dashboard > blojsom > ... > Available Plugins > Moblog Plugin
  blojsom Log In   View a printable version of the current page.  
  Moblog Plugin
Added by David Czarnecki, last edited by Timothy Stone on May 19, 2007  (view change) show comment
Labels: 
(None)

Description

The Moblog plugin allows you to e-mail entries to your blog. It also understands e-mail attachments so that images or other files are linked into your entries in an appropriate way. This is useful for blogging photos from your camera phone.

Installation and Setup

In your global /WEB-INF/plugin.properties file, add the following line:

moblog=org.blojsom.plugin.moblog.MoblogPlugin
moblog-admin=org.blojsom.plugin.moblog.admin.MoblogAdminPlugin

The Moblog plugin has its own configuration file, moblog.properties, that is referenced in /WEB-INF/web.xml.

<init-param>
    <param-name>plugin-moblog</param-name>
    <param-value>moblog.properties</param-value>
</init-param>

You can optionally include an initialization parameter in /WEB-INF/web.xml to use an IMAP store instead of the default POP3 store.

<init-param>
    <param-name>plugin-moblog-store-provider</param-name>
    <param-value>pop3</param-value>
</init-param>

The moblog.properties file will be located in the respective /WEB-INF/(blog-id) directories and has a number of configurable parameters:

#
# Moblog Plugin Configuration
#
moblog-hostname=
moblog-userid=
moblog-password=
moblog-category=/
moblog-enabled=false
moblog-authorization=moblog-authorization.properties
moblog-text-mime-types=
moblog-attachment-mime-types=
moblog-image-mime-types=
moblog-secret-word=
moblog-ignore-expression=


Parameter Required Default value Description
moblog-hostname true   Machine name of your SMTP mail host where the Moblog plugin will login to when checking the appropriate mailbox for new messages.
moblog-userid true   Name of the mailbox that the Moblog plugin should check.
moblog-password true   Password for the mailbox identified by mailbox-userid.
moblog-category true   Name of the category where moblog entries will be posted to.
moblog-enabled true   Can either be true or false depending on whether or not the Moblog plugin is enabled for the individual blog user.
moblog-authorization false moblog-authorization.properties Specifies the authorization file that the plugin reads which contains a list of valid e-mail FROM: addresses that are allowed to post to this user's moblog.
moblog-text-mime-types false text/plain, text/html Comma-separated list of mime types to identify text-only e-mail messages or portions of e-mail messages with attachments.
moblog-image-mime-types false image/jpeg, image/jpg, image/gif, image/png Comma-separated list of mime types to identify valid image types accepted by this blog. Images are included in the entry using an <img .../> tag, which links to the image.
moblog-attachment-mime-types false   Comma-separated list of mime types to identify accepted attachment types. Attachments are includes in the entry using a <a href="..." /> tag, which links to the attachment using the attachment name as the text between the <a ...></a> tags.
moblog-secret-word false   Specifies a word that must be present at the start of the subject of the e-mail. If not present, the e-mail will be skipped and deleted.
moblog-ignore-expression false   A regular expression that allows you to ignore specific text from a moblog message.
Location of Images and Attachments

Images and attachments are uploaded to the {blojsom installation directory}/resources/(blog-id)/ directory.

The moblog-authorization.properties file contains a list of valid e-mail FROM: addresses that are allowed to post to this user's moblog. Example:

#
# Authorization file used for blojsom Moblog support
#
# format is emailaddress
#
user@domain.com

The Moblog plugin poll time which specifies when its internal thread wakes up and checks the mailboxes setup for each user is configured in /WEB-INF/web.xml.

<init-param>
    <param-name>plugin-moblog-poll-time</param-name>
    <param-value>\{time specified in seconds\}</param-value>
</init-param>

If this parameter is not found in /WEB-INF/web.xml, a default value of 5 minutes will be used for the poll time.

The Moblog plugin requires the SMTP server be defined in /WEB-INF/web.xml. The parameter is smtp-server. For example:

<init-param>
    <param-name>smtp-server</param-name>
    <param-value>localhost</param-value>
</init-param>

Using a JNDI context for mail settings

Available in blojsom 2.21 and above.

If the value for the smtp-server parameter starts with java:comp/env, then blojsom will try to lookup the JNDI context for the mail settings. Look at your application server documentation for information on setting a JNDI. As an example, the Tomcat JDNI resources HOW-TO has a section on JavaMail sessions. From their example, if using a JDNI mail session, your smtp-server parameter value would be java:comp/env/mail/Session.

Using SMTP server authentication credentials

Available in blojsom 2.21 and above.

You can also define authentication credentials for your SMTP server. These parameters are also defined in /WEB-INF/web.xml. The parameter names are smtp-server-username and smtp-server-password.

For example:

<init-param>
    <param-name>smtp-server-username</param-name>
    <param-value>username</param-value>
</init-param>
<init-param>
    <param-name>smtp-server-password</param-name>
    <param-value>password</param-value>
</init-param>

Required Permissions

A user must have the following permissions in order to use the moblog administration plugin.

moblog_admin

Usage Scenarios

The following sections describe how to send various types of moblog messages to your blog.

Sending a post into a specific category

In the subject of your e-mail, include [/category_name] at the beginning of your subject. For example:

Subject: [/java] Subject of the e-mail used as title of the entry

Sending a post when using the secret word

In the subject of your e-mail, you must include the configured secret word at the beginning of your subject. For example, if your secret word is configured as "bl0gg3r" you would use:

Subject: bl0gg3r Subject of the e-mail used as title of the entry

Sending a post when using the secret word into a specific category.

In the subject of your e-mail, you must include the configured secret word at the beginning of your subject followed by the specific category enclosed in []. For example, if your secret word is configured as "bl0gg3r" and you want to post to your "java" category, you would use:

Subject: bl0gg3r [/java] Subject of the e-mail used as title of the entry

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators