scriptygoddess

25 Jun, 2003

Post to your MT blog by EMAIL!!

Posted by: Jennifer In: Bookmarks

I know this is a much requested script, and after working with the author of this one, I did find a few other similar ones out there, but I'd never been able to get any of those to work – and this one did quite easily. In any case, Scott's post about it is here.

You can see his detailed instructions here, but here's the "Cliff notes version" for the people who install first and read the directions afterwards when it doens't work ;) (that's me, by the way) LOL!

1. Make sure your host provider has the following perl modules installed:

Mail::POP3Client
XMLRPC::Lite

2. Download the pop3-mt script (here). Save that locally – rename it pop3-to-MT.pl

3. Edit the variables as neccessary (see the comments in that file you downloaded)

4. Upload the file to your server. Make sure you CHMOD 755 the file.

5. Set up a cron job to run that .pl file as often as you see fit.
* * * * * /home/USERNAME/pop3-to-MT.pl
that would run the file every minute.

See your host provider about setting this up – if you have a cpanel like interface – there may be a "easy" and an "advanced" version of the interface to set up cron jobs.

6. To email a post, subject line should have a "#" before the text – that is what will let the script know that it's an email to be posted. The subject line will be the title, the body of the email will be the text of the post.

Some personal experience notes:
-When sending posts by email – make sure you're sending the email by PLAIN TEXT - otherwise you'll get a bunch of junk mixed in with your post.

-This script does not currently support username/password – so technically – anyone that figures out which email is scanned for posts – well, you can imagine the possibilities. ;) I'd suggest setting up a special account with a hard to guess address: q3oikfq34rtjr90qw3p04j@yourdomain.com for example ;-)

-HTML in your posts (like links and stuff) don't appear to work just yet. When I posted <a href="http://www.google.com">google</a> posted like this:
href="http://www.google.com">google

Related posts:

  1. Adding a block of HTML to a WordPress post One problem with the WYSIWYG editor in WordPress is that...

Related posts brought to you by Yet Another Related Posts Plugin.

56 Responses to "Post to your MT blog by EMAIL!!"

1 | Blog de Halavais

February 18th, 2004 at 7:41 pm

Avatar

Walkthrough
Lilia over at Mathemagenic writes about how MT (Typepad, actually), is more difficult than we seem to think. There is…

2 | Blog de Halavais

February 18th, 2004 at 12:32 am

Avatar

Walkthrough
Lilia over at Mathemagenic writes about how MT (Typepad, actually), is more difficult than we seem to think. There is…

3 | Koldark's World

January 12th, 2004 at 7:40 pm

Avatar

This is a cool plugin
I found this link: scriptygoddess I can send an email and post messages. Cool!…

4 | OnePotMeal: in passing

August 26th, 2003 at 7:37 pm

Avatar

test
I apologize for all the false updated pings I'm sending out–I'm setting up this post-by-email script so I can post from my phone. For some reason….

5 | OnePotMeal

August 26th, 2003 at 6:35 pm

Avatar

Did you write something or not, what's the deal?
I apologize for all the false updated pings I'm sending out–I'm experimenting with a posting-by-email script to make it post from my phone. Why? Because it's there, I guess….

6 | Daisyhead

July 26th, 2003 at 11:22 pm

Avatar

Scriptygoddess goodness
I haven't perused Scriptygoddess lately so I'm missing out on all kinds of little gems like this handy little piece of code which notifies you by email when a Googlebot visits your site and this code which allows you to…

7 | geekalicious.net

July 19th, 2003 at 9:44 pm

Avatar

Smilies and Post to blog via email
Today was busy! I think people know by now that Rick is home and will watch Kayla while I help them :) I helped Tudy iron out her smilies issues. We used a combination of Girlie's and Lisa's (part 1,…

8 | Design-A-Blog

June 26th, 2003 at 2:39 pm

Avatar

Post-by-email script for MT
Here it is, folks! The oft-requested posting by e-mail to a Moveable Type blog hack is finally available. On a personal note, I probably won't try this one since I'm not too comfort…

9 | RawBear

February 18th, 2004 at 12:07 pm

Avatar

Thanks to Dirk, I was finally able to modify my posting script .I use pop2blog to post from emails. It handles attachements and is quite secure. I am now able to remove ANY tag from my providers by inserting a special string at the end of MY text.
Take a look at
http://www.cogev.com/blog/archives/2004/02/000073.php

10 | Roy

November 14th, 2003 at 11:55 pm

Avatar

I am getting this error: "proxy: transport protocol not specified" after running the pop3-to-MT.pl. Did I miss out something? Or did my webhost block something? Please help, I really want this thing to work.

11 | DNS

November 22nd, 2003 at 9:46 pm

Avatar

I am also getting this error: "proxy: transport protocol not specified" after running the pop3-to-MT.pl. What's your system configuration, Roy?

12 | Arvind Satyanarayan

December 21st, 2003 at 9:41 am

Avatar

I don't understand this. If i use this to post via outlook (using yahoo! mail) it works fine but if i use my mobile to post it doesn't and the post isnt recognized. I have included the # in the subject and all but it doesn't work and I don't know why. The two messages look the same apart from the fact their from 2 separate email adds

13 | Arvind Satyanarayan

December 21st, 2003 at 9:45 am

Avatar

and i'm using a sony ericsson t610 and adding the # via 'add symbols' !

14 | dirk

August 19th, 2003 at 1:38 am

Avatar

No points for elegance or robustness, but here's a little hack to strip Hotmail's advertising footer out of incoming pop3-to-MT posts:

# grab the body of the email (becomes body of post)
$post = $pop->Body($i);
$post =~ s|<br\sclear=all>.*?</html>{1}|</html>|is;

Add the third line into the pop3-to-MT.pl. It depends on the uniqueness of the <br clear=all> tag that MS prefaces their insert with. I don't have other webmail accounts to test, but it's easily adapted.

For those not familiar with regular expression pattern matching–like I was two hours ago–a few hints:

- the basic structure is s/find_this/replace_with_this/; Perl lets you use alternate separation characters, which allows use to search for "/html" without having to go cross-eyed
- the \s is a whitespace code
- the .*? operates as a wildcard
- i and s make the search case insensitive and treat the input string as one line (skipping any newline characters in the html)
- {1} is the maximum number of times the expression can be found; if it is found twice (on the off chance the same code is used in the message body proper), the replacement will fail and the message goes through

So, all we're doing is replacing the html from MS's first tag to the end with our own shorter and sweeter one. (Hey, you could even put a plug for pop3-to-MT in there, while you're at it.)

Thanks to the Goddess and Scott for putting this out there.

p.s. I found it very useful to comment out the message delete function at the end while testing!

15 | Jennifer

August 7th, 2003 at 9:45 pm

Avatar

This script is such a great idea! I don't know for sure if I have the modules needed. I thought I'd install it and find out!

I get this error when I run the script (command prompt or from cron):

"use" not allowed in expression at blog.pl line 86, at end of line syntax error at blog.pl line 86, near "use Mail::POP3Client" BEGIN not safe after errors–compilation aborted at blog.pl line 87.

Does that mean I don't have the mail module? Can I install it in my web space and point to its location in the script?

16 | TheDreamer

July 18th, 2003 at 12:31 pm

Avatar

still nothing :S I'm using Webmin tool to config my cron job's. Made de cron job and waited until the time i'v set it to.. Visited my blog and still no email to blog :(
Can there be a nother problem ? More pakages or somthing :S

17 | Paul Norwood

July 17th, 2003 at 10:15 pm

Avatar

Looks like you made the same wrong assumptions I did…it will not run from a browser. It is a command line utility only.

If you have access to the shell or can use cron it should work beautifully.

18 | TheDreamer

July 17th, 2003 at 6:28 pm

Avatar

Cool plugin. After a lot of installing the things that it needs en finaly got it working i got this error :S

Output from command /home/Youri/pop3-to-MT.pl ..

Unsupported protocol 'HTTP'

? What im i doing.. Realy want to use this plugin plz help me fix my problem.

19 | coderunner

July 17th, 2003 at 4:14 pm

Avatar

Cron (crond) is a program that comes with most Unix systems, including Linux. It's job is simply to run specified programs at various intervals. For example, you could configure cron to clean out a folder every other month.

20 | Megalion

July 11th, 2003 at 3:02 pm

Avatar

Hey Scott… I emailed you on Monday but haven't heard from you… you can use blog AT megalion.com to contact me if you didn't get my email and are still waiting to hear from me.

I'll warn you that my response time may be iffy over the next week as I'm out of town and don't know what kind of net access I'll have til the 20th.

21 | Michelle

July 17th, 2003 at 2:43 pm

Avatar

unfortunately i do not know and understand what cron is so far. does anybody have a link to a site where it's explained for people who have no clue? LOL

does it only run for people who have their own server? or does this work for everyone who's just got a provider and a domain of his own?

22 | Paul Norwood

July 6th, 2003 at 1:23 am

Avatar

I have tried using the + sign, tried using \+ all to no avail. I have worked with a different perl module NET::POP3 and it works just fine with the intended meail address. I don't know, I guess I will have to use that other email address. I would prefer not to though because it is an easily guessed one and I don't really want spam or whatever to post to my blog before I realize it.

23 | Scott

July 4th, 2003 at 6:50 pm

Avatar

Hey Paul, I'm glad it is working for you! It sounds like that other email address is set up through Cpanel or somesuch. If it was, you can often use and address with a plus sign in place of the @.

I'm doing just that and it works out fine. Btw, escaping the @ sign was a good idea. I'm a bit surprised it didn't work.

Mega: I couldn't find an email address for you on your site. When you get a chance, email me. You can find my address at scottfallin.com. I'd rather not have the spambot harvest it, I'm sure you understand.

I've been posting to a test blog today trying to recreate your line wrap issue but can't. I use a text only *nix based mailer, but I've also had success using Outlook, sending a post in plaintext and Outlook RTF.

I'm not sure why html tags are problematic either. I have no trouble marking up text, including achors for links and having them post successfully.

Plaintext is still the way to go with this script, but like I said, Outlook RTF seems to work well too.

24 | Paul Norwood

July 3rd, 2003 at 10:59 pm

Avatar

IT WORKS!!!!! I tried a different email account (one that doesn't require the domain name in the username field) and it worked perfectly the very first time! I am SOOOO jazzed!

Now if it would only select a category field…

25 | Paul Norwood

July 3rd, 2003 at 9:28 pm

Avatar

I modified my username (since I have to use the server name for my mail server) with a \@ thinking this may be the problem. Now when I run the script at the shell I get no errors, but it seems to not run at all.

Help!

Paul Norwood

26 | Paul Norwood

July 3rd, 2003 at 9:02 pm

Avatar

I get the same error Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Mail/POP3Client.pm line 1001, chunk 2. at the shell prompt as well.

27 | Paul Norwood

July 3rd, 2003 at 8:56 pm

Avatar

Hi, I don't know why I was trying to run it as a cgi…oversight I guess…now I have cron running it returns an error…Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Mail/POP3Client.pm line 1001, chunk 2. Do I have an older verson of Perl and that is the problem? Thanks, will try to run this from the shell.

Paul Norwood

28 | Scott

July 3rd, 2003 at 7:52 pm

Avatar

Thanks Megalion :)

I should have some time this weekend to fix the line break issue. I've been neglectful of it as I've been chasing after a bright and shiny new Perl adventure.

I'm interested to see an example of what you're experiencing, as I'm not running into the problem myself.

I'll send you an email about it.

And no, I won't be using Scriptygoddess to announce new releases. I'll just post notices on scottfallin.com or set up an announcement mailing list or some such.

29 | Scott

July 3rd, 2003 at 10:21 am

Avatar

You are you trying to run pop3-to-MT as a CGI?

It was not designed to run that way. It is a standalone script, designed to run of out cron.

The script was written using Perl verson 5.8.x

The problem is in your utilization of the script. The script runs quite well when invoked as it was designed to be invoked.

This script does not output http headers as it is not a cgi. It never was and never will be.

30 | Megalion

July 3rd, 2003 at 3:00 pm

Avatar

Hey Scott,

Just wanted to say that the versatility of your script for the fact that the script can be run on one server, read mailbox on a 2nd server and post to a blog on a 3rd server really rocks cause that's exactly what I'm doing!

BTW, is there any chance you could fix that line break issue I mentioned soon? I haven't been using the script yet mainly because I didn't want to have to go back and fix all the lines in my posts.

Are you using this site as the announcement of your script updates?

31 | Paul Norwood

July 2nd, 2003 at 9:22 pm

Avatar

Hi all,

I have been working on this code all afternoon and have come to the conclusion the problem may not be on my end. I keep getting the error:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Use of uninitialized value in pattern match (m//) at C:/Perl/site/lib/Mail/POP3Client.pm line 1001, line 2.

I have been in touch with tech support all afternoon and they claim the problem is with the script…is it possible this is the pop3-to-mt.pl script? I tried implementing a different script that calls the Mail:POP3Client and it returns the same error.

Thanks in advance!

The page is http://blog.paulnorwood.net/pop3-to-mt.pl

A text version is at http://blog.paulnorwood.net/pop3-to-mt.txt

And no, I did not alter the scripts.

32 | scott

June 29th, 2003 at 5:58 pm

Avatar

Mega:

I haven't had much time to revamp the script but the line wrap issue should be easy enough to solve, and if I recall correctly, the API makes provisons for categories. I'll work on it.

33 | Megalion

June 27th, 2003 at 8:34 pm

Avatar

BTW Scott… is there any way to fix the tendency to wrap lines artifically?

It seems to create & save new lines in the middle of my paragraphs which means my posts appear funky after MT's done converting new lines into
's

I also like the idea of being able to specify categories, esp multiple categories.

I also use the MT Plugin, Extrafields, to get Livejournal like "Mood" & "Listening To" fields in there… it'd be very excellent if there was some way to have those process as well.

34 | Jennifer

June 27th, 2003 at 6:57 am

Avatar

AHHH… doh! My bad. :)

35 | Jennifer

June 26th, 2003 at 5:51 pm

Avatar

Yes – please read my "personal experience notes" at the bottom of the post :) HTML isn't supported yet.

36 | Megalion

June 27th, 2003 at 2:55 am

Avatar

I think you misunderstand… I wasn't talking about trying to POST via email… I was talking about when I saved the post SCRIPT off Scott's site.

37 | Megalion

June 26th, 2003 at 5:44 pm

Avatar

I'm still working on getting the script to run… just entered the cron job and am waiting for 5 minutes to pass…

In the meantime… I was getting errors at first because when I saved the script.. my browser converted all <'s >'s to & lt; and & gt; so watch out for that. It also saved some HTML stuff at the top & bottom of the file.

38 | Scott

June 26th, 2003 at 9:03 am

Avatar

I should imagine that the username/password pair validation will be an option in the next version as well.

I'm also considering writing a feature that will enable the user to run the script in daemon mode via a command line flag. This would cause the script to sleep for n number of minutes and then wake up to check/process mail before going to sleep again. This would remove cron from the equation and hopefully make things easier.

Also, I am considering coding an option to strip out html tags and entities to help folks who send mail in html form.

Feedback on proposed features is definitely welcome and should be send to saf@scottfallin.com.

39 | Scott

June 26th, 2003 at 8:08 am

Avatar

The script doesn't handle attachments currently, nor does it let you select a category.

Both functions are on tap for the next version.

mt-email is a neat plugin. The only problem being that procmail has a rather baroque "recipe" syntax that could prove difficult for MT users who are not familiar/comfortable with UNIX. I opted to get away from procmail by polling a POP3 account directly. Its bad enough that I force users of this script to use cron ;)

40 | brad

June 26th, 2003 at 1:12 am

Avatar

i've got this functionality using david raynes mt-email which is a mt plugin. here's how i did it.

41 | michelle

June 25th, 2003 at 10:49 pm

Avatar

wow… i don't use mt, but that is so cool! post to your site by email, nifty.

42 | Jason D-

June 26th, 2003 at 12:22 am

Avatar

But does it do attachments?

43 | Michael Fioritto's Weblog

June 28th, 2004 at 12:48 pm

Avatar

Test post using the pop3-to-MT.pl script
This is a test post using the pop3-to-MT.pl script. I am sending this via Outlook and in plain text. The script was authored by Scott Fallin and more information on how to use it and set it up can be found here….

44 | emily

June 29th, 2004 at 11:15 pm

Avatar

I ran this script and it looped and posted the email message nearly 60 times before it terminated. Any ideas why it's doing that?

45 | osXX.org

July 15th, 2004 at 5:02 am

Avatar

First impressions of the Toshiba VM4050 phone
i'm going to cover my experience with the phone i just bought as i try to to get it to play nice with my Mac. They haven't hooked up as of yet, but the phone has initiated some major booty…

46 | Surfer, Searcher, Bassist, Bartender, Divemaster and ah..Teacher - Brandon's Road Trip through Life - Current Location: Japan

October 27th, 2004 at 4:34 pm

Avatar

Yet another script and setup on MT and moblogging
scriptygoddess Post to your MT blog by EMAIL!!…

47 | Chris Evans

October 30th, 2004 at 8:30 pm

Avatar

Can anyone help me? In Internet Explorer 6.0 I am getting a Script Error when I try to send out an E-mail in Yahoo. It will only do this in Yahoo I can still send through my local ISP. The error name is " 'AC_selectedEMails' is undefined' ". PLEASE ANYONE HELP!!! PLEASE….

48 | John Wyles

December 17th, 2004 at 1:36 am

Avatar

Here I was halfway into messing around with Net::POP3 and Net::MovableType when I found this created one year prior no less! I thought I would be clever and with the in by making a new mobile phone bloggin perl script but someone has beat me to it! Congrats. Code was of course remarkably similar to what I had and seems to work great. Thanks!

49 | Rex

December 22nd, 2004 at 10:10 pm

Avatar

Did you find an answer to your question about not being able to send from Yahoo? we're having the same error message..

thx

Rex

50 | Tam

December 27th, 2004 at 10:14 am

Avatar

Hey…any answer to the question about the error message in Yahoo when trying to send e-mail? I'm getting the same message all of a sudden!

51 | b

December 27th, 2004 at 6:33 pm

Avatar

We are having the same problem (not being able to send yahoo! mail)

52 | Pirate Queen

December 27th, 2004 at 11:26 pm

Avatar

Same Yahoo problem – and yahoo non-help offers no solutions. SO, what is the answer?

53 | michael

January 2nd, 2005 at 1:30 pm

Avatar

Hello,
I try to access links form scottfallin.com but keep getting directed to a search page of sorts. Do you know another source for the scripts?
Thx

54 | Josh

January 12th, 2005 at 1:42 pm

Avatar

I can't find this file ANYWHERE! Anybody got it laying around that they can send me?

55 | miller

January 25th, 2005 at 12:15 am

Avatar

I had the same Yahoo email problem – What worked for me was replacing my (macromedia) flash.ocx file. I uninstalled all macromedia software, which included Macromedia flash player as well as Shockwave, and manually deleted flash.ocx. I then downloaded the new version of Macromedia flash player, and email works flawlessly now. I discovered this fix on another tech forum, see 'nigelpratt' http://207.58.143.178/forums/archive/index.php/t-6433.html

56 | 1st Person Links

May 8th, 2005 at 8:30 pm

Avatar

Installing MT Email to Post Plugin
scriptygoddess There should be a few similar plug-ins that add the post-by-email to your Movable Type blog, but I've yet…

Featured Sponsors

About


Advertisements