« CategoryHeaderFooter | Main | Weekend Difficulties »

March 31, 2003

MT-Email

I've been reminded and reminded over the last couple weeks that I have not yet released my MovableType email script. So, here is the first part.

Requirements:

  • MIME::Parser
  • MIME::Entity
  • MIME::Head

Download:

Installation:

  • Unpack the archive
  • Edit mt-email.pl: change the address on line 70 to the email address where you woud like your blog to receive mail
  • Place mt-email.pl in your base MT directory
  • Create an email forwarder/alias that redirects to the script (e.g. on my CPanel site, I created an Email Forwarder, blog@mt.rayners.org, that forwards mail to "|/home/rayners/www/mt/mt-email.pl")

How It Works:

  • Takes the Subject of the email and searches for an entry on your site with that title (exact, case-sensitive match at the moment)
  • Uses the mail headers to generate the comment author, email, and URL (for URL, it currently uses a non-standard header X-URL)
  • Posts the contents of the email as the comment

Future Plans:

  • Email => Entry
  • Various forms of authentication (PGP/GPG signatures, Password, other?)

Update (2003-3-31 14:27)

  • Added Email => Entry

    To use, send an email to the address you chose, with the subject in the following form

    New Entry: Entry Title

    And add some combination of the following headers to the email you are sending

    X-MT-Pass: password X-MT-Blog-Id: blog_id X-MT-Blog-Name: blog name X-MT-Category: Primary Category|Secondary Category|Other Secondary Category|...

    X-MT-Pass must be there, as well as either X-MT-Blog-Id or X-MT-Blog-Name. Everything else is optional.

    I would like to stress right now that this is not secure. You are sending your MT password in cleartext over email. Admittedly, you are effectively doing the same thing right now when you login to MT via the web. Most likely, this won't be an issue, but I want to be sure everyone is aware of it. I am currently working on adding in digital signatures (via GnuPG/PGP) to the email to verify identities instead of passwords.

Posted by rayners at March 31, 2003 02:34 PM

Trackback Pings

TrackBack URL for this entry:
http://mt.rayners.org/mt-tb.cgi/161

Listed below are links to weblogs that reference MT-Email:

» MT, PHP, CSS News Roundup from hebig.org/blog
MOVABLE TYPE Joi Ito's mail2entry is a Python script that allows to post MT entries containing text and images via [Read More]

Tracked on March 13, 2003 05:40 AM

» MT, PHP, CSS News Roundup from hebig.org/blog
MOVABLE TYPE Joi Ito's mail2entry is a Python script that allows to post MT entries containing text and images via [Read More]

Tracked on March 13, 2003 02:08 PM

» MT, PHP, CSS News Roundup from hebig.org/blog
MOVABLE TYPE Joi Ito's mail2entry is a Python script that allows to post MT entries containing text and images via [Read More]

Tracked on March 13, 2003 04:14 PM

» MT Email from Bloggins
“This”http://www.rayners.org/archives/000198.php is one of the plugins I’ve been looking for since I started bloggin’. I’m about two weeks late on... [Read More]

Tracked on April 1, 2003 07:03 PM

» Mettre à jour MT par email from Weblogger.ch
C'est facile en installant le plugin MT-Email.... [Read More]

Tracked on April 11, 2003 10:58 AM

» Mettre à jour MT par email from Weblogger.ch
C'est facile en installant le plugin MT-Email.... [Read More]

Tracked on April 11, 2003 10:59 AM

» Mettre à jour MT par email from Weblogger.ch
C'est facile en installant le plugin MT-Email.... [Read More]

Tracked on April 11, 2003 11:10 AM

» Mettre à jour MT par email from Weblogger.ch
C'est facile en installant le plugin MT-Email.... [Read More]

Tracked on April 11, 2003 11:10 AM

» post via email from thatbradguy
so i wanted to be able to post to this blog via email. why? because it's possible, and because i wanted to be able to post random things here via email through my cell phone. there are several folks out [Read More]

Tracked on June 13, 2003 08:42 PM

» post via email from thatbradguy
so i wanted to be able to post to this blog via email. why? because it's possible, and because i wanted to be able to post random things here via email through my cell phone. there are several folks out [Read More]

Tracked on June 13, 2003 09:11 PM

» No Access from Mama Write
For some inexplicable reason, Wolfrunners is blocked via the university's firewall. I can't even get to the subdomain, which is hosted on a family URL. This is rather frustrating, and I may have to reinstall MT so I can still... [Read More]

Tracked on August 22, 2003 04:51 PM

» Post to Your Blog@Case Blog Via Email from Jeremy Smith's blog
Keith mentions that posting to your blog via email would be a nice feature. I would have to agree. What... [Read More]

Tracked on January 11, 2005 11:02 PM

» Post to Your Blog@Case Blog Via Email from Jeremy Smith's blog
Keith mentions that posting to your blog via email would be a nice feature. I would have to agree. What... [Read More]

Tracked on January 11, 2005 11:18 PM

Comments

I'm getting the following error message in a Failed Delivery email back:

Can't locate Text/Tiki.pm in @INC (@INC contains: /home/fidgetin/publichtml/cgi-bin/extlib /home/fidgetin/publichtml/cgi-bin/lib /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/siteperl/5.6.1/i686-linux /usr/lib/perl5/siteperl/5.6.1 /usr/lib/perl5/siteperl/5.6.0 /usr/lib/perl5/siteperl .) at /home/fidgetin/publichtml/cgi-bin/plugins/trans-tiki.pl line 10. BEGIN failed--compilation aborted at /home/fidgetin/publichtml/cgi-bin/plugins/trans-tiki.pl line 10. Compilation failed in require at /home/fidgetin/publichtml/cgi-bin/lib/MT.pm line 117. Can't locate object method "load" via package "MT::Entry" (perhaps you forgot to load "MT::Entry"?) at /home/fidgetin/publichtml/cgi-bin/mt-email.pl line 93, <> line 24.

Any ideas?

Posted by: Kyle Slattery at March 8, 2003 10:06 PM

I just put up an updated version. Just grab the new archive and it should work okay now. :)

Posted by: David Raynes at March 8, 2003 10:14 PM

wow... you're churning up plugins by the bucket load. i'll try this one

Posted by: Faf at March 9, 2003 03:20 AM

wow... you're churning up plugins by the bucket load. i'll try this one

Posted by: Faf at March 9, 2003 04:56 AM

Where do you host your site that lets you redirect to a script? I've been looking for that capibility.

Posted by: VIncent at March 13, 2003 10:44 AM

try Page-Zone.com

There are quite flexible and have Cpanel installed.

Basically, i think, any host that has Cpanel will allow you to pipe emails to scripts.

Posted by: Faf at March 13, 2003 02:03 PM

Hi, I have CPanel host, but can't pipe email to PHP script. I put the following in the "forward to" textbox of CPanel:

"|/home/eudora/publichtml/mailtest.php"

Here is what is returned when I send an email:

This message was created automatically by mail delivery software (Exim).

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

pipe to |/home/eudora/publichtml/mailtest.php generated by testmail@eudoracivic.org Child process of virtualaddresspipe transport returned 69 (could mean service or program unavailable) from command: /home/eudora/publichtml/mailtest.php

Anybody have any thoughts?

Posted by: mightycpa at March 21, 2003 05:21 PM

mightycpa, I am not 100 per cent confident, but I think you cannot pipe email to a PHP script because it is not system executable, so to speak. You have to use perl and make sure it is +x.

Posted by: george at April 2, 2003 06:19 PM

Granted e-mail is equivalent to a postcard, but when most people send email they expect the contents of the email to be kept private and not publicly posted to a web site. Anyone using this plugin should post a disclaimer that clearly states email sent to the blog address will automatically be posted as a comment.

Posted by: #!/usr/bin/geek at April 2, 2003 11:31 PM

Ehh.. Bad things are happening when I ftp this into my plugin dir (cgi-bin/mt/plugins & chmod 755)....The next thing that happens is my mt.cgi does thins: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@thelostolive.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What is going wrong? I did remove the plug in and all is well now..... I love the idea of this plugin so.... I want to fix it. I dont know perl well at all, but I will go through it and see if anything catches my eye, however, since no one else noted this issue, I suspect I am missing a step here :(

Posted by: Kevin at April 20, 2003 03:04 PM

Never mind, I think this was the move I missed: "Place mt-email.pl in your base MT directory"

I put it in my plugin dir..... uggg... sorry folks...

Posted by: Kevin at April 20, 2003 03:12 PM

im using ensim and webpliance3.1, and that web interface to smtp doesnt let me alias to a pipe. so i cant route the email to the perl script.

but cant i still find the config file that the web interface edits, and type it in by hand?

what might be the name of that file? where might it be?

Posted by: stacy at May 31, 2003 01:15 AM

I am finding that I can pipe to a cgi script in any location, but I can only pipe to a php script if it is located in the cgi-bin folder.

Does this sound right?

Seams a bit strange to me...

Posted by: Tom Kirkpatrick at June 12, 2003 05:25 AM

i can post a comment and my site rebuilds. however, when i post a new entry, it doesnt. any suggestions?

Posted by: brad at June 13, 2003 03:13 AM

hey i got it to work. here's how.

Posted by: brad at June 24, 2003 11:16 AM

From the write-up, this plugin looks to be exactly what I'm looking for (supports multiple blogs, categories & users, comments & entries). I'll be very interested in seeing the gpg-signature update as well!

However, I've run into a glitch which is proving to be my (or the script's) undoing.

My understanding is that the script looks at the sender's email address, and tries to match it to a username. I sent my test address from the email address associated with my username, but it failed:

Your email entry failed for the following reasons:

"Author not found: 'arakune@thinkers.org'"

Please try again.

I then tried changing my actual MT username to 'arakune@thinkers.org', figuring that would solve the problem (at least, it was easier than trying to work my perl-illiterate way through the script to see what was going on ;).

However, this resulted in the same error. Which leads me to believe that the error message doesn't necessarily reflect what is actually happening. The user does exist, so the script just isn't able to find that out, perhaps?

Anyway, not being able to parse perl worth a heck, I'm wondering if you (or anyone reading this) has any suggestions on what else I can look at/try?

Thanks!

Posted by: arakune at August 5, 2003 12:00 AM

I'm having trouble with entries posted via email and comment notification. When comment notification is on, mt has trouble finding the addresses. But if I go into the web interface and re-save the entry posted, it works fine. It also works fine if comment notification is off.

Can you help me?

Posted by: melvin at January 7, 2004 11:34 AM

"And add some combination of the following headers to the email you are sending" How? Can I just put that stuff into the body of the e-mail?

Posted by: Jason at March 23, 2004 09:07 AM

Hi, I know that your last comment on this entry was over a year ago, but I'm trying to get mt-email setup so that I can comment through email. Best I can tell I have followed all of the instructions correctly, but still nothing happens. Any help you could provide would be greatly appreciated. Thanks in advance.

Posted by: M@ at June 24, 2004 03:18 PM

Can anyone give me a link for that php piping stuff?

The links in the thread don't work.

Posted by: farheen [TypeKey Profile Page] at April 23, 2005 11:36 PM

M@, i've just got it up and running.

What is the error that you are suffering?

Is the email being forwarded to the script? You can check that by using the script to trigger an email which you can use for logging purposes.

If the email IS being forwarded, you might be having probelms parsing it.

Posted by: bulk sms at April 30, 2005 06:41 AM

Can someone confirm for me that this works on Linux with MovableType 3.15 or 3.16?

Ian

Posted by: ian wells at May 17, 2005 05:26 PM

Post a comment




Remember Me?

(you may use HTML tags for style)