PDA

View Full Version : Addon: POP3 Post (Post by email - moblogging)


raminia
06-20-2005, 07:44 PM
Hi folks,

I've made an addon for whom they want to post by emails.
Works with Pixelpost version 1.4.x

Download
http://www.pixelpost.org/v1/index.php?x=downloads&details=81
or
http://www.pixelpost.org/index.php?x=downloads&details=81

Description
- This addon will receive emails from a pop3 email account and addes the attachment jpg file to the photoblog and uses the subject as the post title and the content as the post content.

- This is written to accept only one photo per email (one attachment). I did not test it on the other cases.

- This is not compatible with unicode characters.

- This is extracted from wordpress pop3 email post feature under GNU license and extended to post jpg images in Pixelpost,

Install
1) add email_publish.php to the root directory of your photoblog
2) add class-pop3.php to the includes directory
3) add pop3_post.php to the addons directory
4) go to admin panel >> addons >> pop3_post addon and set the pop3 information of the specific email address. Take care to choose a secret address since every single email in this email address with jpeg attachment will be published on your phtoblog.
5) Then you need to set up email_publish.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your email_publish.php URL.

if you are using cpanel open Cron-jobs >> Standard >> setup dates to check the pop3 mailbox and add this as the command
wget http://www.example.com/email_publish.php

good luck

- THIS POST IS EDITED. Thel 5th part was errorous.

- UPDATED AGAIN: the last version does not delete the email after publishing it and it was wrong. I corrected this.

raminia
07-19-2005, 08:30 PM
Hi folks,

Version 1.0 @ 2005/07/20
Bug Fixed. Files entirely modified and some new files are added!

Download
http://www.pixelpost.org/v1/index.php?x=downloads&details=81
or
http://www.pixelpost.org/index.php?x=downloads&details=81

Description
- This addon will receive emails from a pop3 email account and addes the attachment image file to the photoblog and uses the subject as the post title and the content as the post content.

- This is written to accept only one photo per email (one attachment). I did not test it on the other cases.

- This is not compatible with unicode characters.

- The first section of the code is extracted from wordpress pop3 email post feature under GNU license and extended to post jpg images in Pixelpost. The further development of the code came from Wordpress Plugin: Postie with reserving the credits.

Install
0) extract the zip file. it will create two directories (includes and addons) and a single file email_publish.php
1) add email_publish.php to the root directory of your photoblog ( you can rename it to what ever you want )
2) create a new directory in the includes directory named: 'pop3classes'
3) copy all of the extracted files in the pop3classes directory of the addon into the pop3classes directory on your site.
3) add pop3_post.php to the addons directory (it's inside the addons folder of extracted files)
4) go to admin panel >> addons >> pop3_post addon and set the pop3 information of the specific email address. Take care to choose a secret address since every single email in this email address with jpeg attachment will be published on your phtoblog.
5) Then you need to set up email_publish.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your email_publish.php URL.

if you are using cpanel open Cron-jobs >> Standard >> setup dates to check the pop3 mailbox and add this as the command
wget http://www.example.com/email_publish.php

good luck

Ramin Mehran
pblog.ramina.com
2005/07/20

arakune
07-28-2005, 08:51 PM
...

5) Then you need to set up email_publish.php to execute periodically to check the mailbox for new posts.

I'm very excited about this addon (while I don't moblog, I do prefer to update via email), but am having poor luck in getting it working. I've followed the instructions posted above, and everything seems to be correct.
However, when I run email_publish.php, the script returns


Email has following attachments:

image jpeg

text plain



and that's it. It doesn't appear to do anything further. No new entry is posted to my pixelpost installation; the email that it found is not deleted from the mailbox. And no error messages are reported.

I wondered if you might have any suggestions on troubleshooting this.

raminia
07-28-2005, 09:34 PM
email your photo again with the same mailing service to
ppamz@pblog.raminia.com
I'll try to fix it.

ambaxter
07-30-2005, 04:59 AM
I just installed pixelpost 1.4.2 and version 1 of your pop3 addon. The emails I send are processed, the publish page returns

Email has following attachments:

text plain

image jpeg

Mission complete, message 1 deleted.
Is that what it's supposed to return? Because when I go to my pixelpost backend, it has all the text data, but the image is not there.

What's more, I have to delete this entry from the database because pixelpost can't do it because the image isn't there to delete.

ambaxter
07-30-2005, 05:40 AM
:lol: Got it! It was just a permissions issue on my images folder. Was not set to 777

Connie
07-30-2005, 05:46 AM
ambaxter,

how did you manage to upload photos "the standard way" when permission was not 777?

was that possible? Which permission you had before?

skill_guy101
08-20-2005, 10:14 AM
I think that this is an excilent addon but it would be greatly improved if when i sent the email it resized the picture accordingly
http://www.pixelpost.org/v1/index.php?x=downloads&details=64
how would i go about making it happen?

raminia
08-20-2005, 10:15 AM
it would be great:)

raminia
08-20-2005, 10:17 AM
besides, take a look at
http://forum.pixelpost.org/showthread.php?t=1464&highlight=autoresize
too.
this preserves the EXIF data too.

Ryan
10-22-2005, 02:19 AM
Has anyone had success or even know how to get the "from" header taken from the email and inputted into the DB?

I've modified the DB so that it will support an email. I attempted to copy the "subject" header information and modify it for the "from" field. But I did that out of experimentation.

Not able to figure out how to get that "from" variable out of the email so that I can pop it into the database. (inputting into the database is no problem, its reading the email that I am unsure of)

Thanks for any insight into this.

raminia
10-22-2005, 07:46 PM
I didn't get the relevance.

Joe[y]
10-23-2005, 09:37 AM
why would you want to collect the 'from' addresses in your database? do multiple people post to your blog or something?

sorry, i can't be of much help as i have no experience with the addon and haven't the time right now to navigate around it like a blind man.

roddy
12-19-2005, 05:48 AM
First, thanks for the great addon - very easily got posting via email set up.

Now, a question.

I have some people who would like to post to my site via mobile phone picture messages. When they send a picture message to my submission email address, it arrives, but the picture is contained in a smil application (Synchronized Multimedia Integration Language).

When I try to run email_publish.php I get

Email has following attachments:

application smil

image jpeg

text plain
so it looks like it is finding the image, but for some reason it stops here and does not insert the picture into the database. Presumably it is getting confused by the additional smil application. However, i can't figure out how to get around this. Any ideas? Even a hint in the right direction would be appreciated.

Direct email posting works fine, by the way. Many thanks again.

Roddy

danjul
01-28-2006, 12:54 PM
isnt there a easier way to do whit the email_publish.php ??
do i realy have to update that by myself? Isnt it possible to add something to the pixelpost index.php that will execute email_publish.php like maximum every 10 min...

thanks //Daniel

raminia
01-28-2006, 09:05 PM
isnt there a easier way to do whit the email_publish.php ??
do i realy have to update that by myself? Isnt it possible to add something to the pixelpost index.php that will execute email_publish.php like maximum every 10 min...

thanks //Daniel
Cron-jobs
http://www.google.com/search?sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2005-09,GGGL:en&q=Cron-jobs

dirthog
02-02-2006, 04:28 PM
I want to get this working, I've set it up, but when I run http://www.domain.com/email_publish.php from the browser I get the following message. How do I correct it?


Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/PEAR.php) is not within the allowed path(s): (/home/httpd/vhosts/removed.com/httpdocs:/tmp) in /home/httpd/vhosts/removed.com/httpdocs/moblog/includes/pop3classes/mimedecode.php on line 35

Warning: main(PEAR.php): failed to open stream: Operation not permitted in /home/httpd/vhosts/removed.com/httpdocs/moblog/includes/pop3classes/mimedecode.php on line 35

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/removed.com/httpdocs/moblog/includes/pop3classes/mimedecode.php on line 35

dirthog
02-03-2006, 08:14 PM
okay i figured out my problem above on to the next one. When I capture an image and send it to any email address, my provider(Alltel) sends the image as an html page with the image in the html as well as an attachement. So looking in the images folder I see a horizontal bars, Alltel logos and such.

Is there a way to have it not grab all the extra images?

Connie
02-05-2006, 04:19 PM
talk with your provider, that problem is not on our side ;=)

dirthog
02-12-2006, 12:49 PM
I understand that my provider is sending it in html, what I was wondering if the script could be modified to strip all html and not grab the html images?

thoresson
03-27-2006, 02:34 PM
Is there a limit to how big the attached images can be. I have a friend who tried with a 7.2 MB jpeg and had that message downloaded over and over again for 24h before he noticed and stopped the cronjob until the mail was deleted.

Is the mail only deleted on a successful insert into PP's MySQL tables?

/Anders

blinking8s
03-27-2006, 06:05 PM
I understand that my provider is sending it in html, what I was wondering if the script could be modified to strip all html and not grab the html images?

You should have an option to send regulat text emails...i'd ask your host, pretty weird if they cant do that.

Is there a limit to how big the attached images can be. I have a friend who tried with a 7.2 MB jpeg and had that message downloaded over and over again for 24h before he noticed and stopped the cronjob until the mail was deleted.

Is the mail only deleted on a successful insert into PP's MySQL tables?

/Anders


well, 7.2MB is pretty large, most email systems dont want to handle something like that...I'd ask your host about the limitations of the system first

thoresson
03-31-2006, 07:28 AM
Yes. It's large. But I know my system can handle that load. But it now seems like it wasn't the size that were the problem, we have been able to send even bigger pictures. Rather, it looks like a strange type of jpeg.

/Anders