### Installation

- Either:
  - Put the postie.zip file in wp-content/plugins/ and unzip it
- Or:
  - Use the automatic installer (WP 2.7+)
- Login to WordPress as an administrator
- Goto the Plugins tab in the WordPress Admin Site
- Activate "Postie"
- Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.
- Make sure you enter the mailserver information correctly, including the type of connection and the port number. Common port configurations:
  - pop3: 110
  - pop3-ssl: 995
  - imap: 143
  - imap-ssl: 993
- (Postie ignores the settings under Settings->Writing->Writing-by-Email)

#### Automating checking e-mail

WordPress cron (which Postie relies on) doesn't run unless a page is accessed on the site. So if you send an email, but nobody accesses the site for 3 days Postie won't be given the chance to fetch the email and publish the post.

To ensure that Postie runs smoothly on a low or no volume site you need to ensure that a page gets hit (any page is fine). Use something like cron + curl on Linux or install curl on Windows and use the Scheduled Tasks control panel. If you are using a hosting company that doesn't allow you access to cron you can use a service like SetCronJob.

By default, postie checks for new e-mail every 30 minutes. You can select from a number of different checking intervals in the settings page, under the Mailserver tab.

#### Forcing e-mail check

If you would prefer to have more fine-grained control of how postie checks for mail, you can also set up a crontab. This is for advanced users only.

Setup a cronjob to pull down the get_mail.php - note that every time you access get_mail.php Postie will run - it is like clicking Run Postie on the Admin screen.

#### Linux

If your site runs on a UNIX/linux server, and you have shell access, you can enable mail checking using cron.

Examples:

*/5 * * * * /usr/bin/lynx --source http://blog.robfelty.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1

This fetches the mail every five minutes with lynx

*/10 * * * * /usr/bin/wget -O /dev/null http://blog.robfelty.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1

This fetches the mail every ten minutes with wget

#### Windows

You will need to install wget or curl Then use the Task Scheduler control panel to call wget or cron.

### Upgrade Notice

1.5.14
  The postie_post filter has be deprecated in favor of postie_post_before.
1.5.3
  Postie can now set the first image in an email to be the "Featured" image. There is a new setting "Use First Image as Featured Image" which is off by default. Postie now supports Use Transport Layer Security (TLS)
1.5.0
  New filter postie_filter_email. Used to map "from" to any other email. Allows custom user mapping.
1.4.41
  Post format is now supported. You can specify any of the WordPress supported post formats using the Post type syntax. Post status can now be specified using the status: tag. Post status setting was renamed to Default Post Status and moved to the Message tab.
1.4.10
  All script, style and body tags are stripped from html emails.
1.4.6
  Attachments are now processed in the order they were attached.

### Usage

#### Specifying Beginning and Ending of Post

- If you put in :start - the message processing won't start until it sees that string.
- If you put in :end - the message processing will stop once it sees that string.

#### Post Status

- Posts can have their status set to draft, publish, pending or private. This will override the Default Post Status set in the settings screen.
  - status: private
  - status: draft

#### Post Date

- Posts can have a specific publication date such as Apr 14, 2013. Relative dates like "tomorrow", "monday", "first day of next month" are also supported.
  - date: date
  - date: date time
- Posts can be delayed by adding a line with delayXdXhXm where X is a number.
  - delay:1d - 1 day
  - delay:1h - 1 hour
  - delay:1m - 1 minute
  - delay:1d2h4m - 1 day 2 hours 4m

#### Comment Control

- By putting comments:X in your message you can control if comments are allowed
  - comments:0 - means closed
  - comments:1 - means open
  - comments:2 - means registered only
- Replying to an e-mail gets posted as a comment.
  - For example, you e-mailed a post with the subject line "foo". If you then send an e-mail with the subject line "Re: foo", it will get posted as a comment to the "foo" post. This works by the subject line, so if you have two posts with titles "foo", then the comment will get placed in the more recent post.

#### Post Excerpt

- Custom excerpt
  - You can include a custom excerpt of an e-mail by putting it between :excerptstart and :excerptend
  - You can include images in the excerpt by using the shortcode #eimg1#, #eimg2# etc.

#### Post type/format

You can specify the post type or format by including it as the first part of the subject. E.g. aside//real subject

#### Categories

- If you put a category name in the subject with a : it will be used as the category for the post
- If you put a category id number in the subject with a : it will be used as the category for the post

- If you put the first part of a category name it will be posted in the first category that the system finds that matches - so if you put

  Gen: New News

  The system will post that in General. Note you must turn on the "Match short category" setting for this to work (on by default).

- All of the above also applies if you put the category in brackets []

- Using [] or you can post to multiple categories at once

  Subject: [1] [Mo] [Br] My Subject

  On my blog it would post to General (Id 1), Moblog, and Brewing all at one time

- Using - or you can post to multiple categories at once

  Subject: -1- -Mo- -Br- My Subject

  On my blog it would post to General (Id 1), Moblog, and Brewing all at one time

#### Tags

- You can add tags by adding a line in the body of the message like so: tags: foo, bar
- You can also set a default tag to be applied if no tags are included.

#### Image Handling

- Allows you to attach images to your email and automatically post them to your blog.
- You can publish images in the text of your message by using #img1# #img2# - each one will be replaced with the HTML for the image you attached

- Captions - you can also add a caption like so:

  - #img1 caption='foo'#
  - #img2 caption='bar'#

  Or, if you use IPTC captions, this caption will be used (adding a caption in many photo editing programs (for example Picasa), will add an IPTC caption)

  Note that the images are processed in the order they are attached as of version 1.4.6.

  Note you can only use the #img# feature if your "Preferred Text Type" is set to "plain"

- Image templates Postie now uses the default wordpress image template, but you can specify a different one if you wish.

  You can also specify a custom image template. I use the following custom template:

  `<div class='imageframe alignleft'><a href='{IMAGE}'><img src="{THUMBNAIL}" alt="{CAPTION}" title="{CAPTION}" class="attachment" /></a><div class='imagecaption'>{CAPTION}</div></div>`

  - {CAPTION} gets replaced with the caption you specified (if any)
  - {FILELINK} gets replaced with the url to the media
  - {FILENAME} gets replaced with the name of the attachment from the email
  - {FULL} same as {FILELINK}
  - {HEIGHT} gets replaced with the height of the photo
  - {ID} gets replaced with the post id
  - {IMAGE} same as {FILELINK}
  - {LARGEHEIGHT} gets replaced with the height of a large image
  - {LARGEWIDTH} gets replaced with the width of a large image
  - {LARGE} gets replaced with the url to the large-sized image
  - {MEDIUMHEIGHT} gets replaced with the height of a medium image
  - {MEDIUMWIDTH} gets replaced with the width of a medium image
  - {MEDIUM} gets replaced with the url to the medium-sized image
  - {PAGELINK} gets replaced with the URL of the file in WordPress
  - {POSTTITLE} gets replaced with the post title (subject)
  - {RELFILENAME} gets replaced with the relative path to the full-size image
  - {THUMBHEIGHT} gets replaced with the height of a thumbnail image
  - {THUMB} gets replaced with the url to the thumbnail image
  - {THUMBNAIL} same as {THUMB}
  - {THUMBWIDTH} gets replaced with the width of a thumbnail image
  - {TITLE} same as {POSTTITLE}
  - {URL} same as {FILELINK}
  - {WIDTH} gets replaced with width of the photo
  - {ICON} insert the icon for the attachment (for non-audio/image/video attachments only)

#### Interoperability

- If your mail client doesn't support setting the subject (nokia) you can do so by putting #your subject/title here# at the beginning of your message
- POP3,POP3-SSL,IMAP,IMAP-SSL now supported - last three require php-imap support
- The program understands enough about mime to not duplicate post if you send an HTML and plain text message
- Automatically confirms that you are installed correctly