Add via Email module - still alive?

BillWill

Joined: 2008-08-28
Posts: 205
Posted: Thu, 2008-12-25 10:37

Hello -

At http://codex.gallery2.org/Gallery2:Modules:addviaemail I found these instructions for adding the Add via Email module:

site Admin" -> "plugins" -> "Get More Plugins" tab -> "Import" section -> download the Add via Email module.

However, I do not see this option listed. Has this module been abandoned, or are there an updated version of the docs somewhere?

Thanks,
Bill

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Fri, 2008-12-26 23:44

Well apparently the documentation has fallen behind reality here.

I found the module here:
http://gallery.svn.sourceforge.net/viewvc/gallery-contrib/trunk/gallery2/modules/

I downloaded it, unzipped it, uploaded it to the modules directory of my install, and THEN I could install it via the admin panel. Added the block, put in the correct info, and the block says it is checking email correctly.

The only problem is, it isn't downloading anything. The emails and attached images are getting to the email account, but the addviaemail module is not bringing it down.

Any solutions out there, or did this not make it all the way to Gallery 2.3?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2008-12-27 13:15

I've just done some testing for you:

The Addviaemail module is in the repository, it does install 100% correctly from the "Get More Plugins Page" (site Admin" -> "plugins" -> "Get More Plugins" tab -> "Import" section -> download the Add via Email module) and when installed as per the instructions, it does download emails and install the contained images into the Gallery pretty much as advertised - I can't fault it.

I haven't checked running it via a crontab though.

That's on top of a stock G2.3 installation.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Sun, 2008-12-28 03:16

Thanks for doing the testing. I really appreciate it, since I've banging my head against the wall for a couple of days now with no positive results.

I unistalled it, thinking my method of uploading the file had caused the problem, and then added it through the control panel (yes, there it was - don't know how I missed it before).

Fresh install, I checked all the settings again, and sent two photos. One from hotmail, and another from a different account. Neither photo showed up in the gallery.

All of my tests are making it to the account I setup for this mod, and I have 10 photos in my outlook express inbox to prove it. I have "leave copy on server" checked, so they are still up there for the mod to get to, and many of the photos have been up there for over 24 hours.

Also, I get this message from the mod:

AddviaEmail results:
Mailbox Checked
0 pictures added.

Any idea as to why yours is working and mine is not?

Thanks again for your help.

Bill

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2008-12-28 11:19

Looks like the module author has helpfully put some debugging info in - try again with debug enabled (buffered mode) in your config.php.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2008-12-29 09:39

Hi Alec-

Thanks for the info. I did as you suggested, and got a lot of information. However, I don' know what to do with it. If I paste it into a post, can you help me interpret the results?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2008-12-29 09:42

Sure. You probably want to post it as an attachment, though.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Tue, 2008-12-30 17:53

here goes . . .

one attachment is from the debug, the second from when I run the cron from my browser to check the mail.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-12-30 18:08

Don't know about the cron thing - but you have this in the debug log:

Quote:
ADDVIAEMAIL: Message not in expected structure ....

A quick look through the code reveals this:

if ($struct->type != 1 /* Multipart */ || count($struct->parts) < 2
	    || $struct->parts[0]->type != 0 /* Text body */
	    || $struct->parts[1]->type != 5 /* Image attachment */
	    || $struct->parts[1]->encoding != 3 /* base64 encoding */) {
	    $gallery->debug('ADDVIAEMAIL: Message not in expected structure');
	    $gallery->debug_r($struct);
	    return false;
	}

So it looks like your email is encoded with the wrong (unexpected/unhandled) format.

The email I tested it with was sent from outlook express, a simple message with a single attachment. Try a different email client, and keep the email as simple as possible.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Tue, 2008-12-30 18:23

Hello -

All but one of the test emails I've sent are from Outlook express. The one that wasn't was from hotmail.

In all cases, I sent one attachment, the subject line matched the one I created in the admin area, and a message with a couple of words like "here it is."

So basically, my unsuccessful tests have been the same as your successful ones.

I've uninstalled and reinstalled it, and still no change.

Is this encoding problem something I can fix in addviaemail mod?

Thanks again,
Bill

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-12-30 18:31

are you using OE on a mac or a pc?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-12-30 18:46

Having a perfunctory look at the struct of your email message as reported in the log, the problem is that your Primary Body Type is 1 (multipart) when it should (according to addviaemail code) be 0 (text)

I guess therefore you're sending the email as multipart coded text/html. Send the body as plain-text only, and it has a better chance of working.

Quote:
Is this encoding problem something I can fix in addviaemail mod?

Well, anything is fixable because you have the source code. But I suspect if you had the ability to fix it in short order, you wouldn't be asking me to tell you what was wrong, you'd have found out yourself by now.

 
mjason
mjason's picture

Joined: 2007-12-12
Posts: 15
Posted: Fri, 2009-03-13 05:26
alecmyers wrote:
Having a perfunctory look at the struct of your email message as reported in the log, the problem is that your Primary Body Type is 1 (multipart) when it should (according to addviaemail code) be 0 (text)

I guess therefore you're sending the email as multipart coded text/html. Send the body as plain-text only, and it has a better chance of working.

Quote:
Is this encoding problem something I can fix in addviaemail mod?

Well, anything is fixable because you have the source code. But I suspect if you had the ability to fix it in short order, you wouldn't be asking me to tell you what was wrong, you'd have found out yourself by now.

You are 100% correct. It must be a plain text email.
A few tips. (Can be found in the read me file)
You must publish the block in the sidebar or somewhere else in the template (in themes)
Multiple files sent at once.

A superior man is modest in his speech, but exceeds in his actions.
Confucius

 
windjunkie

Joined: 2005-05-19
Posts: 9
Posted: Thu, 2009-07-30 22:24

I can't make Add via Email plugin to work under my 1and1 account. Do I need to setup some cron job to pool emails from my POP3 account? Can anyone suggest any steps to debug the problem? I scanned through the g2 debug output but didn't find any traces of the plugin problems. Here is all I see that has to do with Add via Email:

Loading plugin addviaemail
Class not defined, trying to include it.
file_exists(/homepages/7/d93225776/htdocs/photos/modules/addviaemail/module.inc)
addviaemail plugin successfully instantiated
Check the version of the addviaemail plugin
The version of the addviaemail plugin is ok

Thank you,

--Alik