[addviaemail] Feedback and Suggestions!

fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Thu, 2006-12-14 14:54

So it would seem that Brian Janice (cobalt027@users.sourceforge.net) has created an "addviaemail" module that checks pop3 and can add items to G2.

I had a few suggestions that would make it even spiffier!

1) Support SSL POP3, because I have my domain's mail hosted with google's gmail service and they only offer SSL POP3.

2) Add a key to the subject to allow uploading to *any* album, given the right format or something. For example, perhaps [Album Path/to/Proper/Album].

3) Another neat feature would be to scan the *from* email address and use *that* as the "owner" of the image, and perhaps for permissions on where the image can go. Dunno how easy/hard this would be, but it'd make it great.

4) As an added security measure, each user could be perhaps given a random string of chars that they would have to include in the subject of a mail to authorize it.

So in the end, an email might look like...

Quote:
From:

Subject: [image][album user/Album3][key Z8KzkM]
Attachment: IMG_2222.jpg

The result would be that the account tied to "user@domain.com" is used for permissions and owner, the IMG_2222.jpg would be uploaded to user/Album3 and the "key" is used as a small measure of added security.

Any email that doesn't match the user @ domain.com could either be rejected or processed under the "default" options already available, perhaps with a toggle to turn it on and off.

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Sat, 2006-12-16 14:05

I am VERY happy to see an interest in my little experiment. Perhaps with this feedback (and my new camera phone) I will be able to make this a module that really serves a need for people.

These suggestions are great! I shall investigate them all, even if its just one at a time.

After reading this post and sleeping on it i have come to the conclusion that i might have misnamed the plugin. I suppose i should have called it add via camera phone. Tha being said, let me explain.

I intended for this to be REALLY quick and REALLY simply, kinda like take A) a picture with your phone B) send to contact C) select your gallery email D) enter the key e) hit send. If i were to incorporate the select an album thing i think it would get too cumbersome to type that in with a phone keypad.

As for setting the user from the "from" - this sounds like a great idea. I do have some trepidation. It has been my experience that when you send a picture thru your phone the email address that is stuck in the from field is something weird like "<mysprintpicturemailusername>@pm.sprint.com". The username could or could not be something assigned to me. Now if i were to use the entire email address as a value and search the user database for that - i dont think i would find it. I highly doubt anyone would stick there picture mail email address into gallery. That leaves me with just the username. Do you feel that would be specific enough to use to search thru the database?

As for the SSL, that is something I will definitely look into.

Looking forward to everyone's thoughts.

- Cobalt027 (Brian)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2006-12-16 18:03

Brian, Thanks for this module it is great.

1. The admin page button 'configue' should be "save settings".

2. There should be some test button as well to see if the settings work.

3. In the block the text should be internationalized. "AddviaEmail results:
1 pictures added." the word pictures should be picture ( no s )

	{g->text text="Add Via Email results:"}
	<br/>
    {g->text one="(%d item added)"
	     many="(%d items added)"
	     count=$block.addviaemail.emailsprocessed
	     arg1=$block.addviaemail.emailsprocessed}
	<br/>

is how other .tpl files handle plurals.

4. Can't the "Path to TMP directory" be found automatically? Like:
$gallery->getConfig('data.gallery.tmp');

5. I would like to see a 'Title' field if possible. Similar to fryfrogs request.
5.a How is your regex skills to strip stuff out of the email subject? :-)

Please don't take the above as criticism. I really like this module and I think many more people will give it a go now that G2.2 has Downloadable Plugins.

I created a codex page:
Gallery2:Modules:addviaemail
I hope that some users will update it.

Dave
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Sat, 2006-12-16 19:27

I do not take anything personally. I welcome any and all comments suggestions and pointers to places where I obviously messed up. This was my first stab at a module for gallery - and fairly close to my first foray into heavy php. It seems that my local/dev copy of this module no longer works, so now i have to debug my own code to get it working again for me! *bummer*

Once i get my copy working again, I shall investigate and incoroprate all suggestions.

- Cobalt027 (Brian)

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Sat, 2006-12-16 19:29

Oh, and I have updated the codex page slightly.

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Sun, 2006-12-17 00:03

I have commited a new version of Configure.inc. This resolved my problem with my module not working anymore. The error was a parameter I look for later on was getting blanked when selected POP as the server type.

- Cobalt027 (Brian)

 
wilco

Joined: 2006-12-19
Posts: 3
Posted: Tue, 2006-12-19 20:57

This module was exactly what I was looking for to be able to snap quick photos of stuff I see and get them right on my gallery. However I can't seem to get it to install correctly. Whenever I try to configure the module, and I leave the "Subject to match" field blank (I don't really care about subject matching), I get the following error:

Quote:
Fatal error: Call to a member function on a non-object in /home/wilco/public_html/gallery/modules/addviaemail/Configure.inc on line 122

When I do put something into that field, I get the following error (looks like its from Gallery instead of PHP):

Quote:
Security Violation

The action you attempted is not permitted.

Back to the Gallery
Error Detail -
Error (ERROR_BAD_PARAMETER) : /home/wilco/public_html/gallery/modules/core/classes/helpers/../../../../modules/core/AdminPlugins.inc

* in modules/core/classes/GalleryView.class at line 194 (gallerycoreapi::error)
* in modules/core/SiteAdmin.inc at line 145 (galleryview::loadview)
* in modules/core/classes/GalleryView.class at line 317 (siteadminview::loadtemplate)
* in main.php at line 386 (siteadminview::doloadtemplate)
* in main.php at line 87
* in main.php at line 80

If I go back to the gallery module admin page, I can activate it, but, of course, the module doesn't add anything that I send via my VZW phone to the e-mail address I configured. I'd really like to get this to work, so I appreciate any help anyone can provide.

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Tue, 2006-12-19 22:48

Hi,
I just recently (about 13 minutes ago) committed a new version of the plugin, so you should pull that and try it. I dont think it will solve your problem though.

Here is what i recommend,
Deactive, and uninstall the plug-in.
Install it.
Configure it.
You MUST put something in the subject to match line. This is an anit-spam feature. The module looks for emails with this subject (that only you know :) ) to act on.

You should first try just sending a picture through normal email (not your phone) to see if it works. The email must be an attachment, NOT inline. (Something else I need to work on.

Then give it a try. You can hit this page:
http://picsbeta.example.net/main.php?g2_controller=addviaemail.Addviaemailpage
(change the host to match yours) to see what it does.

I am still not sure it will work from your phone. Most carriers put other image in picture mail that i have yet to code for and strip out. This will end up being a time consuming process.

Please bear with me, this module is in alpha. I also recommend reading the codex page:
http://codex.gallery2.org/index.php/Gallery2:Modules:addviaemail

If you wouldn't mind, please forward me a picture mail from your phone (my email is in the first post at the top of this thread). I will need it to be able to strip out Verizon "junk" from picture mail.

- Cobalt027 (Brian)

 
wilco

Joined: 2006-12-19
Posts: 3
Posted: Wed, 2006-12-20 14:39

Seems to be working now... it did not like using IMAP, so I switched to POP. My phone messages work, too, but it seems your script grabs whatever is in the body of the e-mail and puts it in as the title of the photo, which, for me, is a bunch of crap about Verizon Pix Place. If you're looking for feature suggestions, I suggest making that automatic import of the e-mail body into the title as a selectable option.

Thanks for the cool module and all your hard work!

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Thu, 2006-12-21 14:30

That is a fantastic suggestion! I shall incorporate that. So, just to be clear, you're using Verizon and its working for you? (besides the body text error)

- Cobalt027 (Brian)

 
wilco

Joined: 2006-12-19
Posts: 3
Posted: Thu, 2006-12-21 22:57

Yes, using the vzwpix e-mail option on my nokia phone seems to work okay. You do have to refresh a few times, though, to get it to finally end up in the album. What exactly needs a hit to kick off the script? The album where the picture goes, or anything in the gallery itself? I have a "latest picture" block that is on my main page that gets hit every time someone comes to my site, so if that will take care of it, great.

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Fri, 2006-12-22 03:45

For my module to process the email it DOES require a hit directly to my module. That can be accomplished either by adding the Add via Email block to one of your pages, or putting a special line in a cron job (if you have access to something like this). Please read the docs - i have detailed examples there for you to follow.

- Cobalt027 (Brian)

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Fri, 2006-12-22 19:39

All, I have just committed a new version (0.6.6). Fixed bug where it would allow blank fields, added SSL support, and ability to change the port. Check out the codex for full notes.
Wilco: also added the ability to turn off the "taking body as caption" feature.
- Cobalt027 (Brian)

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2006-12-24 04:48

Hi cobalt027,

great - the new module is installable again on my site - tried to change permissions on my upload album and getting an empty page for this now - all other pages open the normal admin page.
Strange?!

Gallery version = 2.2-svn core 1.1.25
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8d
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Mon, 2006-12-25 02:47

Not sure i follow you: my plugin doesnt mess with permissions. What URL are you hitting to get a empty page? (you dont need to supply the host) and are you logged in as an admin user?

What version of the plugin are you using?

- Cobalt027 (Brian)

 
darxmac

Joined: 2007-01-04
Posts: 1
Posted: Thu, 2007-01-04 15:56

i get this:

when trying to save the preferences:

Security Violation
The action you attempted is not permitted.

Back to the Gallery

Error Detail -
Error (ERROR_BAD_PARAMETER) : /Users/adm/Sites/gallery2/modules/core/classes/helpers/../../../../modules/core/AdminPlugins.inc
in modules/core/classes/GalleryView.class at line 194 (GalleryCoreApi::error)
in modules/core/SiteAdmin.inc at line 145 (GalleryView::loadView)
in modules/core/classes/GalleryView.class at line 317 (SiteAdminView::loadTemplate)
in main.php at line 386 (GalleryView::doLoadTemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.1.2
PHP version 5.2.0 apache
Webserver Apache/1.3.33 (Darwin) PHP/5.2.0
Database mysql 5.0.27-standard
Toolkits Gd
Operating system Darwin 0x50a383e5.unknown.tele.dk 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh
Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3

 
ichiroboston

Joined: 2004-04-22
Posts: 5
Posted: Sat, 2007-01-06 00:39

Hi!

This module is exactly what im looking for, but I just can't figure out how to install this... lol sorry.
Help?

Thanks!
Ichiro

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2007-01-06 03:52
ichiroboston wrote:
how to install this...

G2.2:
http://codex.gallery2.org/index.php/Gallery2:Modules:addviaemail

Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!

 
ichiroboston

Joined: 2004-04-22
Posts: 5
Posted: Sat, 2007-01-06 21:29

Thanks for your help :)
Ahh ok, I installed 2.2 and got it installed using "Get more plugins" but it is showing as version 0.5.0.
How do I get the latest version?

Also when I try to run the test I get the following:

Thanks again for the help.

-------------------------------------------------------------------

Security Violation

The action you attempted is not permitted.

Back to the Gallery
Error Detail -
Error (ERROR_BAD_PARAMETER)

* in modules/core/classes/GalleryController.class at line 158 (gallerycoreapi::error)
* in main.php at line 189 (gallerycontroller::loadcontroller)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.4.4 apache
Webserver Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.6b
Database mysql 4.1.21-standard
Toolkits Thumbnail, NetPBM, Gd
Operating system Linux titanium.liquidweb.com 2.4.20-46.7.legacy #1 Sat Mar 4 15:25:19 EST 2006 i686
Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2007-01-07 04:54
ichiroboston wrote:
Ahh ok, I installed 2.2 and got it installed using "Get more plugins" but it is showing as version 0.5.0.
How do I get the latest version?

cobalt027 needs to update the MANIFEST file so the the Downloadable Plugins will be updated as well.

Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2007-01-08 05:40

To update the manifest, do this:

$ perl lib/tools/bin/makeManifest.pl -p modules/addviaemail

You should see a response like this:

Finding all files...
Sorting...
Separating into sections...
Generating checksums....
Completed in 2 seconds
Manifests changed: 1 (total: 1)

Then svn commit the modules/addviaemail/MANIFEST file and then within 12 hours your updated module will be available via downloadable plugins!

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Tue, 2007-01-09 06:27

cobalt027,
Sounds like a really cool module however I'm getting a Configure failure using version 0.7.0.
Uninstalled, deleted all cache, tried again to no avail.
Once I click configure I get the following:
Please see attached image.

Any hints to what could be wrong?


Gallery version = 2.2-rc-1 core 1.1.26
PHP version = 4.4.4-pl6-gentoo apache
Webserver = Apache/1.3.37 (Unix) (Gentoo) mod_gzip/1.3.26.1a PHP/4.4.4-pl6-gentoo mod_ssl/2.8.28 OpenSSL/0.9.8c
Database = mysql 4.0.27, lock.system=flock
Toolkits = Ffmpeg, Exif, NetPBM, ArchiveUpload, Thumbnail, Gd, mplayer, Dcraw, ImageMagick, jpegtran
Acceleration = full/900, full/900
Operating system = Linux digi-archive 2.6.18-gentoo-r4 #1 SMP Fri Dec 8 00:32:19 PST 2006 i686
Default theme = PGtheme
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Tue, 2007-01-09 06:54

@swordfish: same here - I assumed some libraries missing, found that I had commented out "extension=php_imap.dll"
in php.ini

Gallery version = 2.2-rc1 core 1.1.27
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8d
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Tue, 2007-01-09 07:41

I got around the configure failure by commenting out these lines from AddviaemailAdminHelper.class

38 	$emailFunctions = array();
39 	$emailFunctions[] = 'imap_timeout';
40 	$emailFunctions[] = 'imap_open';
41 	$emailFunctions[] = 'imap_errors';
42 	$emailFunctions[] = 'imap_headers';
43 	$emailFunctions[] = 'imap_body';
44 	$emailFunctions[] = 'imap_headerinfo';
45 	$emailFunctions[] = 'imap_fetchstructure';
46 	$emailFunctions[] = 'imap_close';
47 	$emailFunctions[] = 'imap_expunge';

But, when attempting to run http://your.gallery.com/main.php?g2_controller=addviaemail.Addviaemailpage
results in:

Error (ERROR_REQUEST_FORGED)

    * in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
    * in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
    * in main.php at line 94
    * in main.php at line 83
 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Tue, 2007-01-09 08:04

I got around the config after enabling the imap.dll - invoking the URL manually gives the same error.
IMAP log shows access but sidebar always "0 added"

Gallery version = 2.2-rc1 core 1.1.27
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8d
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Wed, 2007-01-10 06:50

Recompiled php to add imap, resaved the addviaemail configuration page, sent a test email and now it works :-)
Invoking the URL however results in same error noted above.
I specified a one-liner in email for caption. Once the image was loaded into gallery the caption
reads as:

------=_NextPart_001_0008_01C73432.73B83650
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

The email I sent was html based.

EDIT: sending plain text email w/attached image works as expected.
So for html based email not sure if its me (my server config) or the module.?

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Wed, 2007-01-10 08:12

swordfish: same here - html seems not be fully accepted

Gallery version = 2.2-rc1 core 1.1.27
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8d
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Thu, 2007-01-11 21:59

Sorry for not keeping current on this thread.

ichiroboston: I have updated the manifest, so the latest version should be available. Please try again with the latest version.

swordfish, LFrank: Im glad you guys got the module working. Yes, imap support has to be in php for this to work. I'm using the built in stuff in php. I didn't want to rely on another package.

You are both correct. HTML email is not support. I originally wrote this with the intention of the emails being sent from a cell phone. So a very simple email was how i though things would work. If you want to send me copies of the html emails you sent, ill look for commonalities and see if i can code something to handle them.

- Cobalt027 (Brian)

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sat, 2007-01-13 03:48

@cobalt027
See attached file for html email.

Thanks!

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Sun, 2007-01-14 01:54

Swordfish: thanks! I'll try and figure out why its not working with this format, and code for it. From what device did you send this message from? How was it generated? It looks like it came from MS Outlook? If so, how did you attach the file? did you drag the image into the body of the message, or did you click "attach" and navigate to the image?

- Cobalt027 (Brian)

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sun, 2007-01-14 03:29
cobalt027 wrote:
Swordfish: thanks! I'll try and figure out why its not working with this format, and code for it. From what device did you send this message from? How was it generated? It looks like it came from MS Outlook? If so, how did you attach the file? did you drag the image into the body of the message, or did you click "attach" and navigate to the image?

- Cobalt027 (Brian)

Yes, Outlook 2003. Clicked "attach" and navigated to the image. Image was not embedded in body.

 
hemsoe

Joined: 2004-09-09
Posts: 38
Posted: Mon, 2007-01-15 11:52

Hi...

Thx for this module....

cobalt027 wrote:
swordfish, LFrank: Im glad you guys got the module working. Yes, imap support has to be in php for this to work. I'm using the built in stuff in php. I didn't want to rely on another package.

Why is that IMAP has to be installed, even if I just want to use POP3..?
Would it not be a better idea to do this check if IMAP was selected?

/Hemsoe

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Tue, 2007-01-16 20:12

hemsoe: the same package is used for BOTH protocols. There is no pop_* group of functions.

- Cobalt027 (Brian)

 
nolageek

Joined: 2007-01-25
Posts: 8
Posted: Tue, 2007-01-30 12:15

This sounds very promising, although the idea of the subject to match 'feature' seems a bit annoying. I understand this is to prevent spam, but it seems like that should be a configurable setting.. if spam isn't a problem, then why treat it like it is? :) Why not check to see if the message has an image attachment? Either way, I've been looking for something like this since I started using G2. Very excied to try it out!

OK, I'm getting the same error:

Authentication Failure

Your change cannot be completed due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in.

Back to the Gallery
Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1 (Also using SMF Bridge)
PHP version 4.4.4 apache
Webserver Apache 3
Database mysql 4.0.27-standard
Toolkits SquareThumb, ImageMagick, Gd
Operating system Linux sun.bounceweb.com 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

 
mccalml

Joined: 2007-01-31
Posts: 8
Posted: Thu, 2007-02-01 00:29

cobalt027 - There is tremendous interest in this plug-in. Good job. Perhaps recruiting a couple more developers to build it out and support it until the Gallery guys adopt it (hint) wouldn't be a bad idea. I am getting the forged request error as well and it makes me feel like a minor at the counter in a liquor store. Any ideas?

Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.3.10 apache2handler
Webserver Apache/2.0.53 (Linux/SUSE)
Database mysql 4.1.10a
Toolkits Thumbnail, NetPBM
Operating system Linux loki 2.6.11.4-21.15-default #1 Tue Nov 28 13:39:58 UTC 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Thu, 2007-02-01 03:03

You two with the "ERROR_REQUEST_FORGED", what version of this module do you have installed.? I'm using 0.7.3.
Try grabbing the latest from svn. See here

 
mccalml

Joined: 2007-01-31
Posts: 8
Posted: Thu, 2007-02-01 06:20

I am on 073 - the latest from svn. I get the same error from the activation URL and I get no emails processed ( no pics and no DELE'd emails on the POP server). Nor can I see the status block which I have added to the theme layout. What's wrong here?

 
hemsoe

Joined: 2004-09-09
Posts: 38
Posted: Thu, 2007-02-01 09:50

Hi.....

Could the 0.73 be update to be used from the plugin manager in G2...??

:-)

/hemsoe

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2007-02-02 02:54

@hemsoe

No, as Cobalt027 needs to update manifest. You have to get directly from svn.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2007-02-02 03:33
mccalml wrote:
I am on 073 - the latest from svn. I get the same error from the activation URL and I get no emails processed ( no pics and no DELE'd emails on the POP server). Nor can I see the status block which I have added to the theme layout. What's wrong here?

Sorry, I'm at a loss here. Guess we need to wait for Cobalt027 to make another appearance.
The status block will only show when you're logged in as Admin. You probably already knew that.
The only sliver of help I can offer is to delete your cache in G2 Admin|Maintenance, Deactivate the module then activate. Make sure your Addviaemail.tpl is revision 885.

 
mccalml

Joined: 2007-01-31
Posts: 8
Posted: Fri, 2007-02-02 05:12

Well, I'll be a monkeys uncle. fish, I was already at that revision, but I did follow the sequence you mentioned and now I have pictures.... Hot darn. Thanks. Now I have to go in there and hack out a way to strip the Verizon "I was sent by a Verizon Phone, bla, bla, ba..." out. THanks!!!

 
mccalml

Joined: 2007-01-31
Posts: 8
Posted: Fri, 2007-02-02 16:23

cobalt - When you get around to adding the stripping of Verizon crud, here is a working start:

/* Verizon addition here */
$vpos = strpos($body, 'This message was sent using PIX-FLIX');
$gallery->debug('ADDVIAEMAIL: vpos=' . $vpos);
if ( $vpos !== false ) {
$body = substr($body, 0, $vpos-1);
$gallery->debug('ADDVIAEMAIL: verizonless text=' . $body);
unset($vpos);
}

 
garyamort

Joined: 2007-01-28
Posts: 14
Posted: Sat, 2007-02-03 16:26

I installed the .71 version using the built in download/install function and have 2 problems, both of which I think are fixed in .73
(I get an access denied error message when trying to run the process manually, and I am not allowed to leave the subject field blank)

Can anyone tell me how to checkout the .73 code to overlay my existing code? (the server is a linux box and has access to svn, I just am not familiar with the commands).

In addition, what is the string you use to include the addvieemail block to the template? I've created my own custom tpl's for google adsense and inserted them, but I was merely following instructions, so I don't know what the other include commands are for blocks outside the local templates folder)

 
garyamort

Joined: 2007-01-28
Posts: 14
Posted: Sun, 2007-02-04 20:07

Ok, I got subversion working and checked out the .73 version.

Still not able to enter a blank subject in the configuration page.

And when I try to run the web page manually to import photo's I get:

Your change cannot be completed due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in.

Back to the Gallery
Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.4.4 apache
Webserver Apache/1.3.37 (Unix) PHP/4.4.4
Database mysql 4.0.27-log
Toolkits SquareThumb, ImageMagick, Thumbnail, Gd
Operating system Linux enigma 2.4.32-FQ_Enigma-xsE1043 #1 SMP Fri Sep 29 18:29:05 EDT 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9

Any thoughts?

 
Xaneth

Joined: 2006-12-26
Posts: 20
Posted: Fri, 2007-02-09 06:53

I too have the latest version installed and am having similar problems like everyone else. I have a chron job set up to run every other minute, but it's not firing as it should I guess. The pictures ended up making it to the album, but not timely. Swordfish, how to recompile PHP for IMAP support? I'm not running a dedicated server, I'm on a hosting plan, but I do have .htaccess pointed to my own local php.ini file. Can it be edited for support there?

Error Detail -
Error (ERROR_REQUEST_FORGED)

* in modules/core/classes/GalleryController.class at line 235 (gallerycoreapi::error)
* in main.php at line 224 (gallerycontroller::assertisgenuinerequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2-rc-1
PHP version 4.4.4 cgi
Webserver Apache Webserver
Database mysql 4.0.25-standard
Toolkits ImageMagick, Thumbnail, Gd
Operating system Linux biham.lunarpages.com 2.4.21-47.ELsmp #1 SMP Tue Aug 1 08:47:53 EDT 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2007-02-09 07:45

@Xaneth
I maintain my own Linux server and therefore simply re-compiled PHP with --with-imap[=DIR], where DIR is the c-client install prefix.
Windows users may include the php_imap.dll in php.ini

Some hosting providers allow their users to have their own PHP version such as Dreamhost.
http://wiki.dreamhost.com/index.php/Installing_PHP5

Far as I know with Linux you must have imap compiled in; the php.ini can't do anything for you.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2007-02-09 08:34

Voting for an email module may help drive more attention.
http://gallery.menalto.com/sfvote

 
cobalt027
cobalt027's picture

Joined: 2005-06-29
Posts: 22
Posted: Mon, 2007-02-12 16:15

Sorry for the absence - work (my real job) has been tough of late.

The ERROR_REQUEST_FORGED error stems from a new security measure implemented in G2. Can someone please detail at what point you are getting the error, and who you are logged in as. Give me steps to reproduce please. :)

Also, that is a great suggestion to not _have_ to force it to match a subject. I shall add a checkbox to the interface for that option. Thanks for the suggestion!

- Cobalt027 (Brian)

 
garyamort

Joined: 2007-01-28
Posts: 14
Posted: Thu, 2007-02-15 14:33

I get it after running the configuration and trying to load the import routine manually for the first time.
http://www.saplings.us/gallery/main.php?g2_controller=addviaemail.Addviaemailpage

I'm logged in with the admin account.

If you want to do some troubleshooting, just send me an email and I can change the userid on the admin account so you can give it a try.

One feature that would be nice to have is the ability to reconfigure addviaemail.

As it stands now, in order to reconfigure it(say to change the password for the email account) I have to:
Delete the module
Reinstall the module
Configure the module

The configure link disappears once it is configured.

However, since I had other problems, I wasn't sure if this was because it wasn't working to import, or if it was just me.

 
garyamort

Joined: 2007-01-28
Posts: 14
Posted: Thu, 2007-02-15 15:11

Hmm, I modified the main.php and disabled that check and it worked.

I also had to modify the Addviaemail class and disable the subject check. I'm using Shozu on a TMobile dash and the subject line is set to the datetime of the image. I tried a subject line of 2007 in the hopes of matching everything but it didn't work.

I'll take a closer look at that function later and see if I can change it to a regular expression comparison(so subject line 2007 would match anything with 2007 in the subject line).

 
hemsoe

Joined: 2004-09-09
Posts: 38
Posted: Fri, 2007-02-16 06:36

Hi....

To disable the subject check I have added a line in /classes/AddviaemailHelper.class

/* We need to pull the header into so we can check the subject */
$header_info = imap_headerinfo($mbox, $currentMsg);
add-> $subjectToMatch = $header_info->subject;
if ($header_info->subject == $subjectToMatch

Simple workaround... :-)
But it works...

/hemsoe