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.
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/public_html/cgi-bin/extlib
/home/fidgetin/public_html/cgi-bin/lib /usr/lib/perl5/5.6.1/i686-linux
/usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux
/usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl .) at
/home/fidgetin/public_html/cgi-bin/plugins/trans-tiki.pl line 10.
BEGIN failed--compilation aborted at
/home/fidgetin/public_html/cgi-bin/plugins/trans-tiki.pl line 10.
Compilation failed in require at
/home/fidgetin/public_html/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/public_html/cgi-bin/mt-email.pl line 93, > line 24.
Any ideas?
I just put up an updated version. Just grab the new archive and it *should* work okay now. :)
wow... you're churning up plugins by the bucket load. i'll try this one
wow... you're churning up plugins by the bucket load. i'll try this one
Where do you host your site that lets you redirect to a script? I've been looking for that capibility.
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.
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/public_html/_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/public_html/_mailtest.php
> generated by testmail@eudoracivic.org
> Child process of virtual_address_pipe transport returned 69 (could
mean
> service or program unavailable) from command:
> /home/eudora/public_html/_mailtest.php
Anybody have any thoughts?
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.
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.
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 :(
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...
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?
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...
i can post a comment and my site rebuilds. however, when i post a new entry, it doesnt. any suggestions?
hey i got it to work. here's how.
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!
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?
"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?
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.
Can anyone give me a link for that php piping stuff?
The links in the thread don't work.
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.
Can someone confirm for me that this works on Linux with MovableType 3.15 or 3.16?
Ian
Oh, I've been looking for just this .. with a different use in mind.
Splendid.