Setting Up Post By Mail in WordPress

My blog was effectively inactive for quite a while. When I decided to
revive the beast, I moved it to a new URL, changed the theme, and
generally did the grunt work to make it look reasonable. Rather than
playing with server side paths excessively, though, I decided to do a
Wordpress export, create a new instance with a new database, and then
import the old data into that instance.

Moving the blog went well, with a little help from Apache mod_rewrite to
keep all my old links from becoming 404s. Setting up post by mail did
not work so well – as the documentation is truly marginal at this point.
This post is effectively a note to myself (and anyone else who finds it
handy) on how it’s done.

Setup is a three step process. The first step is well described in the
documentation (Post to your blog using email « WordPress Codex). You need to
set up a mail account with POP3 support, a very obscure name, and a
secure password. The second step is also straightforward; enter that
information into the appropriate setup tab of your WordPress
installation. The big gotcha is that for this to work well, you need a
script that runs the wp-mail.php script in the root of your WordPress
installation on a regular basis. I used a cron job running on the server
which called ‘wget’ with the URL of the wp-mail.php script. This lets
Wordpress check for the presence of mail, and process it correctly if
it’s there.

My crontab entry looks like this:

'*/15 * * * * nobody wget -O - -q -t 1'

This entry was posted in Uncategorized. Bookmark the permalink.