forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Uploading => Topic started by: rphMedia on July 17, 2006, 08:30:16 am

Title: [Unsupported]: Email images to your gallery
Post by: rphMedia on July 17, 2006, 08:30:16 am
The magic of GD and a few scripts I gathered/merged.

(http://gallery.rphmedia.net/albums/pixlog.jpg)

Email an image (attatchment) to "cam AT rphmedia DOT net" - come back to this post/thread and refresh (may have to refresh twice; nature of this example.  The hack in the Sample Gallery (http://gallery.rphmedia.net) appears upon entering :) )

I have to work out some details and I'll post everything after performing some more tests.

This could be used for simply emailing images to your gallery, cell phone pics/video, even documents or music.  There are filesize limits (where more testing needs to be done) and a couple of glitches here and there. 

Obviously, if more than one emails, your emailed image may not appear here, but if you go to the Sample Gallery (http://gallery.rphmedia.net) (instead of refreshing here - but do it quickly because if someone refreshes ((or even reads this topic)), then your image will not be here as the emails are deleted [I turned this off for now] as soon as they're probed), you should see your image(s) under the album "Emailed Pix".

For now, definitely don't send an image >1MB.  If this is abused in any way, I'll have to shut it down, goes without saying.  And I also ask you - please don't send anything that could be offensive to others.  Thanks.
Title: Re: Potential mod/hack - Email Pix
Post by: Joachim Müller on July 17, 2006, 08:35:45 am
Looks promising - I'm looking forward to see your code contribution.

Joachim
Title: Re: Potential mod/hack - Email Pix
Post by: Sami on July 17, 2006, 09:23:46 am
Realy nice job ....
waiting for your final code :)
Title: Re: Potential mod/hack - Email Pix
Post by: Pascal YAP on July 17, 2006, 02:09:07 pm
Yeah Ron,  ;D

I'm nice to read you again with a new terrific Mod/Hack  ;)
Me too, i'm waiting for your code !

PYAP
Title: Re: Potential mod/hack - Email Pix
Post by: rphMedia on August 20, 2006, 09:41:31 pm
I hope to get to this soon ... been really busy this summer.

Be back later ! 
Title: Re: Potential mod/hack - Email Pix
Post by: rphMedia on August 26, 2006, 12:31:26 pm
OK, here are the files needed for this mod.

One of the first things you'll have to do is create an album that 'Visitors' can upload files to - retrieve the id # of the album. ((if you don't like the idea of "Visitors can upload files" turned on [which turns on the "upload link"], you can always remove the upload link itself using an appropriate plugin. I just realized that all you have to do is set "Visitors can upload files" at the properties of the album (you don't need to turn anonymous group upload on).  You can also enable "Upload Requires Approval". I haven't had the time to figure out how to be notified, but the approval process works.

Create a folder off of your 'albums' folder to store the emailed items - this example uses 'pix' as the folder name.

Create or use an existing email address for the php file to read (supports either imap or pop3).

Configure a new anycontent?.php file (this example uses the name 'anycontent1.php').  This will silently include the file needed to fire the email read when entering the gallery.

Input your variables into the 'newcam.php' file (host, username, login, filepath, album#, folder).

I think that's it.  It works every time.  I believe that there are filesize / attachment limits, but I'm sure that it's reliant on individual hosts.

I will answer questions best I can. 

My first post in this thread utilizes GD, a php embedded (imposter) jpg file and a log file and is a separate entity used just for show (in other words, not really related to Coppermine structure).  If you'd like that feature, you can PM me and I'll be happy to give you those scripts, but limited support - just don't have the time lately.

EDIT: Typo in attachment - didn't affect performance
Title: Re: Potential mod/hack - Email Pix
Post by: Stramm on August 27, 2006, 09:42:20 am
great, have to give this a try asap  ;D
Title: Re: Potential mod/hack - Email Pix
Post by: taucher_0815 on August 27, 2006, 10:13:56 am
Thanks for this
.
Got it and tried to "install".

Any Idea of where to put the 3 files?

anycontent1 into the root?

but where to put the other2?

How to invoke the check for new "mail"?
Title: Re: Potential mod/hack - Email Pix
Post by: rphMedia on August 27, 2006, 02:30:58 pm
Thanks for this
.
Got it and tried to "install".

Any Idea of where to put the 3 files?

anycontent1 into the root?

but where to put the other2?

How to invoke the check for new "mail"?

Search the boards for configuring anycontent.

And yes, all files to the root.  For more advanced, they can actually be placed anywhere and modify paths as needed.

The email is checked (once anycontent is configured) when entering the gallery - home page.  Understand also that the email(s) is/are deleted once the script executes.  If you don't want the emails deleted, remove these lines:

Code: [Select]
imap_delete($mbox,$jk); // sends to trash, if available
imap_expunge($mbox); // totally deletes

I just (going by my instruction above to test) put this in my personal gallery --- worked out of the box :)
Title: Re: Email images to your gallery
Post by: Pascal YAP on August 27, 2006, 04:49:38 pm
Hi Ron,

So fine MOD  ;D

About Anycontent, maybe you can create a new "case" versus "anycontent" !
For exemple your MOD is about emaling into CPG ! Create a new "case" with the name : "receivemail".
Find in INDEX.PHP :
Code: [Select]
case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;

Just after add :
Code: [Select]
case 'receivemail':

                if ($cat == 0) {
                    include('RPHMEDIA-FILE.php');
                }
                flush();
                break;

PYAP
Title: Re: Email images to your gallery
Post by: rphMedia on August 27, 2006, 05:39:38 pm
Yeah, I wanted to avoid editing index.php, but yes, definitely an option  :)
Title: Re: Email images to your gallery
Post by: Pascal YAP on August 27, 2006, 11:36:33 pm
Hey Ron, Morning...

I just try your MOD, and post one picture on your Galery  ;D
(http://gallery.rphmedia.net/albums/pix/thumb_ruine-st-barnabe_3_19-05-2006.jpg)
http://gallery.rphmedia.net/displayimage.php?pos=-181
Work very fine.
  But us, your visitors, can'nt add any info about our pictures ! C'est la Vie :-)

PYAP
Title: Re: Email images to your gallery
Post by: rphMedia on August 28, 2006, 03:37:25 pm
I don't understand what you would like me to do.  No, this mod doesn't have that capability.
Title: Re: Email images to your gallery
Post by: Pascal YAP on August 28, 2006, 04:16:49 pm
Quote
I don't understand what you would like me to do.  No, this mod doesn't have that capability.
Exemple : my Object email become my Title picture in Coppemine
              and why not Body email, will be the file description.

I just discored a Fatal error: Call to undefined function: imap_open() in attachmentread.class.php on line 42 on one of my webs.
On other, your MOD work fine  ???

PYAP
Title: Re: Email images to your gallery
Post by: rphMedia on August 28, 2006, 09:41:17 pm
imap_open() ---- Probably need to upgrade your php version on that server.

As far as reading the body of an email (to add a description to the image), I'm sure it could be done, but I don't have the time right now  :P
Title: Re: Email images to your gallery
Post by: Pascal YAP on August 30, 2006, 11:21:18 am
Ron,

1, imap_open is perhaps not present on my host, I do not know!
In this case, how to turn around this fatal-error, to employ your MOD?
Secondly, some emails dispatched to my gallery towards emailpix(at)pays-dignois.com arrived on my emailbox!.
Unfortunately, nothing is recovered by my Coppermine (http://www.pays-dignois.com/galerie/thumbnails.php?album=35&theme=Fruity-ZONE)  ???

PYAP

ps:
It seems to me that there is no update of your pixlog.jpg (http://gallery.rphmedia.net/albums/pixlog.jpg) file, that one sees in your first post.
Title: Re: Email images to your gallery
Post by: rphMedia on August 30, 2006, 01:08:33 pm
Hi PYAP,

Remember,
Quote
My first post in this thread utilizes GD, a php embedded (imposter) jpg file and a log file and is a separate entity used just for show (in other words, not really related to Coppermine structure).  If you'd like that feature, you can PM me and I'll be happy to give you those scripts, but limited support - just don't have the time lately.
If you send an email to "cam AT rphmedia DOT net" and refresh here first, the email attachment will be in the post.  If you go to the sample gallery first, then the attacment will be inserted in the gallery and not this post.  Sorry for the confusion.

With the exception of your password, show me the scripts you're using and how you implement them (ie, how is the include call used) and where they are located (ie, paths ... root?).  Also make sure your email host supports - most do.  Maybe just try another email.  I see that it's Album="35"?  Hope you changed that  :)

Don't despair, we can get it working.  I may not respond today, but I'll be around later.

Title: Re: Email images to your gallery
Post by: Gizmo on August 30, 2006, 03:46:18 pm
I'm getting the same error as PYAP -
Quote
Fatal error: Call to undefined function: imap_open() in /home/content/B/i/l/BillyBullock/html/test/attachmentread.class.php on line 49

My PHP version is 4.3.11
Title: Re: Email images to your gallery
Post by: Nibbler on August 30, 2006, 03:47:18 pm
You need the imap extension installed to be able to use the imap_* functions.

http://php.net/imap
Title: Re: Email images to your gallery
Post by: Gizmo on August 30, 2006, 04:15:29 pm
Thanks Nibbler. I just called (I know I'm going to catch flack for saying this but...) GoDaddy and imap_* functions aren't installed and the tech support couldn't offer a reason why. I'll email them which usually gets a better answer. I do have the option to upgrade to a configuration that includes PHP 4 & 5 but doubt that these functions will be installed automatically. I also checked Gmail and it's not installed either- http://mail.google.com/support/bin/answer.py?answer=10339 (http://mail.google.com/support/bin/answer.py?answer=10339). A Google search shows a number of links to make it work with imap but I'm looking for a solid solution and not having to deal with email hacks. So unless there is a workaround, I doubt I'll be able to use this mod.  :'(
Title: Re: Email images to your gallery
Post by: rphMedia on September 02, 2006, 01:54:08 pm
For some reason, after updating to cpg1.4.9, this mod is broke.

Fatal error: Call to undefined function: is_known_filetype() in /homepages/38/d92220195/htdocs/rphgallery/include/picmgmt.inc.php on line 38

I'll be investigating in the next few days, but if anyone has any insight, please let me know.



The scripts, without the integration, still work.
Title: Re: Email images to your gallery
Post by: Sami on September 02, 2006, 02:36:16 pm
check this file :include/media.functions.inc.php
and re-upload it
Title: Re: Email images to your gallery
Post by: rphMedia on September 02, 2006, 02:57:51 pm
check this file :include/media.functions.inc.php
and re-upload it

I actually tried that, didn't work.
Title: Re: Email images to your gallery
Post by: Sami on September 02, 2006, 05:20:12 pm
I don't see any differences between 1.4.8 ver and 1.4.9 version of thoes files !
Title: Re: Email images to your gallery
Post by: rphMedia on September 02, 2006, 05:40:22 pm
Yeah, thanks for looking into it.  Something is definitely wrong.  I just tried to edit an image and nothing happens (blank output).  I've never used the edit feature before, so I don't know what to compare it to. 

But it also needs picmgmt.inc.php .... more troubleshooting.
Title: Re: Email images to your gallery
Post by: rphMedia on September 03, 2006, 12:44:28 pm
Nothing broke - didn't modify case 'anycontent?' in index.php  ::)
Title: Re: Email images to your gallery
Post by: lhenke on September 05, 2006, 07:54:23 pm
Hello!

I have tried to install this function, but without any luck.

I created a folder within the album directory, chmod the folder to 777.
I have a mailbox for the incoming files, and have put the information needed to the newcam.php, such as mail host, username, password, gallery #, and album paths..
In the index.php I changed the case for anycontent to anycontent1.php, this is the file I uploaded to my webserver.
In the settings for cpg I changed in the albumlist to anycontent1.

When I send mms to the mailbox I see that the files are there, but nothing happends in the gallery.
It seems like the script doesnt check the mailbox, is there any way I can debug this or anyone have a clue what I have missed :) .

I'm runnig cpg149..

Best Regards.
Title: Re: Email images to your gallery
Post by: rphMedia on September 06, 2006, 09:48:25 am
With the exception of your email password, show me every snippet of code (that you modified or otherwise) and I should be able to tell you where it's gone wrong. 

Reagarding anycontent - if you don't currently use anycontent, you can simply change the filename to anycontent.php and configure/add accordingly.  I only changed the name so novices wouldn't overwrite their current anycontent.php file.  So, you may want to undo your changes to index.php, change the name of anycontent1.php to anycontent.php and start from scratch there.
Title: Re: Email images to your gallery
Post by: lhenke on September 06, 2006, 03:03:16 pm
Hey!

I fixed it, I debuged newcam.php and the script connected to the mailbox and read the message but didnt find the attachment, and I dont know if there is a diffrent in mms settings for providers in Europe / US ?
Cause the mms I tried to send was attached and the script was looking for inside (disposition) so I had to modify the script to check for both type's of attachment, so now its working :D

//H
Title: Re: Email images to your gallery
Post by: rphMedia on September 06, 2006, 09:54:40 pm
I'm glad you got it working.  Most don't return once they have it working - thanks for the feedback, it may help others.
Title: Re: Email images to your gallery
Post by: jahumphr on November 26, 2006, 07:49:56 am
I get this error....any ideas?

can't connect: Certificate failure for kycities.com: self signed certificate: /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=localhost.localdomain/emailAddress=root@localhost

newcam.php:

<?php

define('IN_COPPERMINE', true);

require('include/picmgmt.inc.php');

require_once("attachmentread.class.php");

$host="{kycities.com:110/pop3}"; // pop3host

$login="pix"; //pop3 login

$password="*****"; //pop3 password

$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/pix/";  ; // attachement will save in same directory where scripts run, otherwise give abs path

$album="81"; // album id #

$folder = "pix/"; // foldername with a /

$jk=new readattachment(); // Creating instance of class####

$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function

?>
Title: Re: Email images to your gallery
Post by: rphMedia on November 26, 2006, 01:29:53 pm
You need to ensure that kycities email box will support this method.  Also, double check that host address, most will be something like pop.kycities.com ... for the pop3 connect.
Title: Re: Email images to your gallery
Post by: jahumphr on November 28, 2006, 02:16:33 am
I had to modify newcam.php to get it to work.

$host="{mail.kycities.com:110/pop3/novalidate-cert}"; // pop3host

It is working now via email but when I use MMS it deletes the email but does not copy the attached pic to the /pix folder and does not post to the gallery. Could this be because of the attached txt file also?

Also I am able to upload a .3gp(quicktime) video file via email but it will not play. If i download the same video from the email it plays on my pc. When i ftp the same file from the /pix directory to my pc it will not play....any ideas.

Title: Re: Email images to your gallery
Post by: jahumphr on November 28, 2006, 03:16:48 am
I left off the fact that if you dont include a subject and some text in the body the email attachment will not post.
Title: Re: Email images to your gallery
Post by: rphMedia on November 28, 2006, 12:01:58 pm
It is working now via email but when I use MMS it deletes the email but does not copy the attached pic to the /pix folder and does not post to the gallery. Could this be because of the attached txt file also?
No idea, works from my cellphone.  Don't think it's because of the text file because I can easily attach two items to my email and it works. Again, could be the email client and how they process incoming messages.

Also I am able to upload a .3gp(quicktime) video file via email but it will not play. If i download the same video from the email it plays on my pc. When i ftp the same file from the /pix directory to my pc it will not play....any ideas.
Beyond the scope of this mod.  That's a Coppermine config problem - search the boards, there's info on 3gp's out there.

I left off the fact that if you dont include a subject and some text in the body the email attachment will not post
I send pictures without subject AND body text all the time.  Once again, you may want to try a different email host ('novalidate-cert' - no idea what that is, but could be part of your problem).
Title: Re: Email images to your gallery
Post by: rphMedia on January 02, 2007, 09:22:20 pm
I apologize if some have sent emails to test, I use the site as a test platform and I inadvertantly removed the anycontent file associated with this mod.

Back on & works again.  Sorry 'bout that.
Title: Re: Email images to your gallery
Post by: zapakh on January 11, 2007, 01:47:07 am
Hey!

I fixed it, I debuged newcam.php and the script connected to the mailbox and read the message but didnt find the attachment, and I dont know if there is a diffrent in mms settings for providers in Europe / US ?
Cause the mms I tried to send was attached and the script was looking for inside (disposition) so I had to modify the script to check for both type's of attachment, so now its working :D

//H

I think I encountered the same difficulty.  In attachmentreadclass.php I modified

Code: [Select]
if($part->disposition == "ATTACHMENT")
to read

Code: [Select]
if($part->disposition == "ATTACHMENT" || $part->disposition == "INLINE")
Thereafter, I could MMS-email from my phone and have the images show up.

Great mod!
Title: Re: Email images to your gallery
Post by: zapakh on January 11, 2007, 04:26:18 am
As far as reading the body of an email (to add a description to the image), I'm sure it could be done, but I don't have the time right now  :P
As an example of something similar, I have modified my copy of the script to add a Title to the image from the Subject of the email, if one is provided.

In attachmentread.class.php, just after
Code: [Select]
        for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++)
        {
insert the lines
Code: [Select]
        $headerinfo = imap_header($mbox, $jk);
        $subject = $headerinfo->Subject;

Also in attachmentread.class.php, later on, alter the line
Code: [Select]
                        add_picture($album, $folder, $filename);
so that it looks like
Code: [Select]
                        add_picture($album, $folder, $filename, 0, $subject);
The 0 argument is the default value for the $position argument of add_picture().

One additional issue... In sending MMS from my cell phone, the resulting emails would have a subject line like
Code: [Select]
Subject: =?utf-8?B?Rmxvd2VycyE=?=

which apparently means it has encoded a utf-8 encoded subject using base64.  I worked around this by inserting an ugly hack consisting of the following lines just below the $headerinfo->Subject bit:

Code: [Select]
                        $matches = array();
                        if (preg_match('/^=\?[^?]*\?B\?(.*)\?=/m', $subject, $matches))
                                $subject = base64_decode($matches[1]);

This resulted in the desired behavior for this specific case, but does anyone know the Right Way to make sense of such a subject line in PHP?

Title: Re: Email images to your gallery
Post by: zapakh on January 11, 2007, 08:35:14 pm
I was testing the email functionality from a friend's cell phone, using a different wireless provider, and the pictures failed to show up in the gallery.

I inspected the emails that were arriving gallery-side, and discovered that through this particular phone/service/gateway configuration, those emails were arriving without any Content-Disposition headers to be seen.  This is doubly bad because the script relies on the existence of a filename attribute on that header.

My solution was to replace

Code: [Select]
  if($part->disposition == "ATTACHMENT")
  {
  ...
  $params = $part->dparameters;
  $filename=$part->dparameters[0]->value;

with

Code: [Select]
  if(TRUE)
  {
  ...
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;
                if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);

This snippet looks for a 'filename' attribute on Content-Disposition, followed by a 'name' attribute on Content-Type, and finally generates a random filename if all else fails.  It corrected my problem.
Title: Re: Email images to your gallery
Post by: rphMedia on January 11, 2007, 10:03:58 pm
zapakh, thanks much for all the refinements.  I just haven't had a lot of time to detail the code.  Seems you're doing my homework.  I'll look into them later and update the attachments if required ...

Keep it up !
Title: Re: Email images to your gallery
Post by: nolageek on January 17, 2007, 06:37:33 pm
I'm getting the same error that gizmo was getting:

Fatal error: Call to undefined function: imap_open() i


I thought his mod worked with both IMAP or POP3?
Title: Re: Email images to your gallery
Post by: Stramm on January 17, 2007, 06:41:39 pm
check with phpinfo if php on your box has been compiled with the imap library enabled
Title: Re: Email images to your gallery
Post by: Nibbler on January 17, 2007, 06:57:56 pm
The imap extension works for POP3 aswell.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 09:52:23 am
OK, I got them to fix that imap problem, now I'm getting:

Fatal error: Call to undefined function: is_known_filetype() in /home2/sexin/public_html/forum/gallery2/include/picmgmt.inc.php on line 38
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 09:59:59 am
Here is my newcam.php, BTW:

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.meninshirtandtie.com:110/pop3}"// pop3host 
$login="e-pix@meninshirtandtie.com"//pop3 login 
$password="***********"//pop3 password */
$filepath="/home2/sexin/public_html/forum/gallery2/albums/e-pix/";// attachement will save in same directory where scripts run, otherwise give abs path 
$album="3"// album id #
$folder "e-pix/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

Notice, I changed the $filepath a bit, since I wasn't sure what it was asking...  but that should work, huh?

Notice, when I had that path wrong, I got a message about not being able to write ".... path/me.jpg" to the "...../e-pix/" directory..  so, it managed to log in and get the filename from the mailbox... but it didnt clear the mailbox or anything, so I know it at least got that far.
Title: Re: Email images to your gallery
Post by: rphMedia on January 18, 2007, 10:44:58 am
OK, I got them to fix that imap problem, now I'm getting:

Fatal error: Call to undefined function: is_known_filetype() in /home2/sexin/public_html/forum/gallery2/include/picmgmt.inc.php on line 38

For this error, you simply didn't add your anycontent case to index.php.

I would start from scratch - this works out of the box if you follow the directions exactly.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 12:09:31 pm
what do you mean 'add your anycontent case to index.php'  I tried both adding include(webcam.php); to the stock anycontent.php and renaming anycontent1.php to anycontent.php (since I wasn't using it anyway.)

Is there something else I have to do to 'enable' anycontent.php? I've been looking.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 12:20:59 pm
That should be include("newcam.php"); up there. :)  I have just re-installed this, twice.  :)

I mean, it's just uploading three files, configuring one, and chmodding a directory right?  I'm not saying I didn't miss a step, but that I don't think I know what that step is. :)

Here's pretty much everything I've done:

root path is /home2/sexin/public_html

CFG URL is /forum/gallery2

files uploaded to
/forum/gallery2/anycontent.php (I renamed anycontent1.php)
/forum/gallery2/newcam.php (configured as below)
/forum/gallery2/attachmentread.class.php (didn't modify)

/forum/gallery2/albums/e-pix is chmodded 777

My anycontent.php:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.8
  $Source$
  $Revision: 3116 $
  $Author: gaugau $
  $Date: 2006-06-08 00:11:54 +0200 (Do, 08 Jun 2006) $
**********************************************/

/**
* Coppermine Photo Gallery 1.4.6 anycontent.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2005 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
* @version $Id: anycontent.php 3116 2006-06-07 22:11:54Z gaugau $
*/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
include(
"newcam.php");
?>



My newcam.php:

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.meninshirtandtie.com:110/pop3}"// pop3host 
$login="e-pix@meninshirtandtie.com"//pop3 login 
$password="**************"//pop3 password */
$filepath="/home2/sexin/public_html/forum/gallery2/albums/e-pix/";// attachement will save in same directory where scripts run, otherwise give abs path 
$album="3"// album id #
$folder "e-pix/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

no other files were altered.


Thanks so much, BTW!  :)
Title: Re: Email images to your gallery
Post by: rphMedia on January 18, 2007, 12:40:37 pm
Not too sure about the absolute server path ($filepath) - may want to revert to original.

Have you included the anycontent via your Admin Config?

breadcrumb/anycontent/alblist/catlist......

And make sure that your attachment (for starters) is a non-progressive .jpg file, then troubleshoot other file-types from there.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 12:51:56 pm
Have you included the anycontent via your Admin Config?

breadcrumb/anycontent/alblist/catlist......

Nope.  I've been looking for ANY information on this anycontent.php file ...  All I see is hwo to back it up.  I don't see anything about it on the admin config at all.  I even 'expanded all' and did a search for anycontent... nothing.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 12:56:35 pm
Nope.  I've been looking for ANY information on this anycontent.php file ...  All I see is hwo to back it up.  I don't see anything about it on the admin config at all.  I even 'expanded all' and did a search for anycontent... nothing.

Aha!  I did a search for breadcrumb/ and found where it was missing.  How is a newbie supposed to know that?! Damn, y'all are makin' me WORK. :)
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 12:58:26 pm
hot diggity that worked!   (I wish this forum let us edit our previous posts.... I hate to keep posting like this)
Title: Re: Email images to your gallery
Post by: rphMedia on January 18, 2007, 12:58:56 pm
How is a newbie supposed to know that?! Damn, y'all are makin' me WORK. :)

It's in the documentation.  It's a good read if you get time  ;)
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 01:41:59 pm
I promised I read.  Promised.  Well, I was looking for 'anycontent.php'

 I didnt know what that meant until you said "breadcrumb/anycontent/alblist/catlist......"

It might be obvious to someone who has been using this for a while... but I had NO CLUE what that meant. :)
Title: Re: Email images to your gallery
Post by: zapakh on January 18, 2007, 03:54:18 pm
Confidentially, it took me a little too long to find the meaning of "anycontent" as well, as I found this thread very early in my Coppermine experience.  My fellow newbies might fare better if given the hint "Admin, Config, Album list view".
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 06:27:45 pm
hmm. i spoke too soon.  I was able to get it to work one time.  Subsequent pictures are being removed from the mailbox, but not posted.  The one that worked was sent via my gmail account.  The ones that have not worked were sent via MMS message from my phone.

I'm gonna cry if this isn't going to work. I was THRILLED at the idea of being able to post photos from my phone. Grrrrr
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 06:30:39 pm
will try things previous posted on here.  (again, why cant we edit our own posts here?)
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 06:54:32 pm
My solution was to replace

Code: [Select]
  if($part->disposition == "ATTACHMENT")
  {
  ...
  $params = $part->dparameters;
  $filename=$part->dparameters[0]->value;

with

Code: [Select]
  if(TRUE)
  {
  ...
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;
                if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);

This snippet looks for a 'filename' attribute on Content-Disposition, followed by a 'name' attribute on Content-Type, and finally generates a random filename if all else fails.  It corrected my problem.

Could you be a little clearer with your replacement?  I'm not sure if I got it right or not...

mine before...

Code: [Select]
  if($part->disposition == "ATTACHMENT")
{
    $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;

        $mege="";
$data="";
  $mege = imap_fetchbody($mbox,$jk,$fpos); 
$fp=fopen($filepath . $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album, $folder, $filename, 0, $subject);
$fpos+=1;

and after

Code: [Select]
if(TRUE)
{
    $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;
                if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;

        $mege="";
$data="";
  $mege = imap_fetchbody($mbox,$jk,$fpos); 
$fp=fopen($filepath . $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album, $folder, $filename, 0, $subject);
$fpos+=1;
Title: Re: Email images to your gallery
Post by: zapakh on January 18, 2007, 07:29:30 pm
This is what I intended, except that you should also remove the two lines that say
Code: [Select]
$params = $part->dparameters;
$filename=$part->dparameters[0]->value;
immediately after the edited portion.

The $params line is harmless, but the $filename line would result in MMS-originated photos failing to appear for one of the wireless providers I tested, because the dparameter it's looking for may fail to exist, and we can't write to a file that doesn't have a name.

Not all wireless providers have been tested.  If pictures continue to fail to appear, it might be helpful to see the email headers you get when MMSing a photo to yourself.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 09:51:52 pm
This is driving me crazy!  This is compounded on with the fact that my internet got cut off last night, so I wont be able to test this anymore after I leave the coffee shop.


Here's the result of my experiments:

If I MMS it directly to the e-mail address on my domain, it doesn't work.  newcam.php runs, the file is removed from the mailbox but doesn't get copied to the directory nor appear in the gallery.

If I MMS it directly to my gmail account, then forward it via a FILTER to my domain's email address, not only it doesn't work but the message never gets forwarded. (does my domain block server-level forwards?)

If I MMS it directly to my gmail account, then forward it MANUALLY, it works just fine.

If I MMS is directly to a forward rule on my domain, to gmail FILTER to e-mail address on my domain, it doesn't work.  newcam.php runs, the file is removed from the mailbox but doesn't get copied to the directory nor appear in the gallery.

Can't connect to gmail directly.
Title: Re: Email images to your gallery
Post by: zapakh on January 18, 2007, 10:05:36 pm
If I MMS it directly to the e-mail address on my domain, it doesn't work.  newcam.php runs, the file is removed from the mailbox but doesn't get copied to the directory nor appear in the gallery.

This is the behavior I was getting when the script couldn't find a filename.  Have you finished applying my changes by removing the assignment to $filename from the dparameters[0] thing?

Quote
If I MMS it directly to my gmail account, then forward it via a FILTER to my domain's email address, not only it doesn't work but the message never gets forwarded. (does my domain block server-level forwards?)

Sounds like this is outside our scope.

Quote
If I MMS it directly to my gmail account, then forward it MANUALLY, it works just fine.

You may have to see how the email headers that come with a manually gmail-forwarded message differ from those that come with an MMS-originated message.  Send one of each type to yourself at a location where you can view that information, and compare.  It's possible that the change is gmail's use of the Content-Disposition header to specify a filename, which would avoid the filename problem I tried to patch.
Title: Re: Email images to your gallery
Post by: nolageek on January 18, 2007, 10:15:01 pm
Yes, I'm pretty sure I have the edits like you suggested...


Code: [Select]
<?
######################################

#Coded By Jijo Last Update Date[Jan/19/06]
#http://phpclasses.org

#####################################




##########################################################


###################### Class readattachment ###############
class readattachment
{
function getdecodevalue($message,$coding)
{
if ($coding == 0)
{
   $message = imap_8bit($message);
}
elseif ($coding == 1)
{
  $message = imap_8bit($message);
}
elseif ($coding == 2)
{
   $message = imap_binary($message);
}
elseif ($coding == 3)
{
   $message=imap_base64($message);
   }
elseif ($coding == 4)
{
   $message = imap_qprint($message);
}
elseif ($coding == 5)
{
$message = imap_base64($message);
}
return $message;
}

function getdata($host,$login,$password,$filepath,$album,$folder)
{
$mbox = imap_open ($host,  $login, $password) or die("can't connect: " . imap_last_error());
$message = array();
$message["attachment"]["type"][0] = "text";
$message["attachment"]["type"][1] = "multipart";
$message["attachment"]["type"][2] = "message";
//$message["attachment"]["type"][3] = "application";
$message["attachment"]["type"][4] = "audio";
$message["attachment"]["type"][5] = "image";
$message["attachment"]["type"][6] = "video";
$message["attachment"]["type"][7] = "other";

for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++)
{
        $headerinfo = imap_header($mbox, $jk);
        $subject = $headerinfo->Subject;
                        $matches = array();
                        if (preg_match('/^=\?[^?]*\?B\?(.*)\?=/m', $subject, $matches))
                                $subject = base64_decode($matches[1]);

$structure = imap_fetchstructure($mbox, $jk , FT_UID);   
$parts = $structure->parts;
$fpos=2;
for($i = 1; $i < count($parts); $i++)
   {
$message["pid"][$i] = ($i);
$part = $parts[$i];

if(TRUE)
{
    $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;
                if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);


        $mege="";
$data="";
  $mege = imap_fetchbody($mbox,$jk,$fpos); 
$fp=fopen($filepath . $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album, $folder, $filename, 0, $subject);
$fpos+=1;

}

}
imap_delete($mbox,$jk);
}
imap_expunge($mbox);
imap_close($mbox);
}
}
?>
Title: Re: Email images to your gallery
Post by: zapakh on January 18, 2007, 10:52:09 pm
Any chance you could get a full readout of the e-mail headers of the offending MMS-generated email and post them here for us to look at?
Title: Re: Email images to your gallery
Post by: nolageek on January 19, 2007, 02:52:31 pm
I'm back!  This is a message that does not work.

Subject:      Multimedia message
From:      XXXXXX AT mms.mycingular DOT com
Date:      Fri, January 19, 2007 7:44 am
To:      YYYY@meninshirtandtie DOT com
Priority:      Normal

Viewing Full Header - View message
Return-path: <XXXXXX AT mms.mycingular DOT com>
Envelope-to: YYYY AT meninshirtandtie DOT com
Delivery-date: Fri, 19 Jan 2007 07:44:03 -0600
Received: from [66.102.165.6] (helo=atlmtaow01.cingularme DOT com)
     by sun.bounceweb.com with esmtp (Exim 4.63)
     (envelope-from <XXXXXX AT mms.mycingular DOT com>)
     id 1H7u2E-0002pF-Oo
     for YYYY AT meninshirtandtie DOT com; Fri, 19 Jan 2007 07:44:03 -0600
X-Mms-MMS-Version: 16
Date: Fri, 19 Jan 2007 08:44:03 -0500
X-Nokia-Ag-Internal: ; smiltype=true; internaldate=1169214243916
Content-Type: multipart/mixed; boundary="----=_Part_1973954_8132742.1169214243922"
X-Mms-Delivery-Report: 1
Received: from alpagw02 ([209.183.34.196]) by atlmtaow01.cingularme DOT com (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20070119134403.KKVM2373.atlmtaow01.cingularme DOT com AT alpagw02> for <YYYY@meninshirtandtie DOT com>; Fri, 19 Jan 2007 08:44:03 -0500
X-Mms-Transaction-ID: 1169192597
From: <XXXXXX AT mms.mycingular DOT com>
To: YYYY AT meninshirtandtie DOT com
X-Mms-Read-Reply: 1
X-Mms-Expiry: RELATIVE: 50763648
Mime-Version: 1.0
Message-ID: <24947488.1169214243940.JavaMail.wluser AT alpagw02>
X-Mms-Priority: 1
X-Mms-Message-Type: 0
Subject: Multimedia message
X-Nokia-Ag-Version: 2.0



Attachments:
cid: 01-17-07_0850.jpg





This one does work, and it was send directly to a gmail account, then manually forwarded to my domain.

Subject:      Multimedia message
From:      "YYYY" <YYYY AT gmail DOT com>
Date:      Fri, January 19, 2007 7:50 am
To:      YYYY AT meninshirtandtie DOT com
Priority:      Normal

Return-path: <YYYY AT gmail DOT com>
Envelope-to: YYYY AT meninshirtandtie DOT com
Delivery-date: Fri, 19 Jan 2007 07:50:03 -0600
Received: from [72.14.246.250] (helo=ag-out-0708.google DOT com)
     by sun.bounceweb.com with esmtp (Exim 4.63)
     (envelope-from <YYYY AT gmail DOT com>)
     id 1H7u82-0003YG-J1
     for YYYY AT meninshirtandtie DOT com; Fri, 19 Jan 2007 07:50:02 -0600
Received: by ag-out-0708.google DOT com with SMTP id 8so439894agc
     for <YYYY AT meninshirtandtie DOT com>; Fri, 19 Jan 2007 05:50:04 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; c=nofws;
     d=gmail.com; s=beta;
     h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
     b=sQyvlm3rc/hc+K46GTduZKZpKaLN2HW85NhGtI7XHS0+6b5SF3Qd+sT/G+xvuCKofy6Uajec1CVUZCjLa9a7DsKTNkyAzqyP1PXFIyEuudJmanycLvaRPnff00vOADE4zjQB5t+KPVXQVeEApU8hkiS40Hn8LcQBkOHOEq+BVG4=
Received: by 10.90.92.7 with SMTP id p7mr2829067agb.1169214604091;
     Fri, 19 Jan 2007 05:50:04 -0800 (PST)
Received: by 10.90.114.15 with HTTP; Fri, 19 Jan 2007 05:50:03 -0800 (PST)
Message-ID: <8d1136e30701190550j338a21fcpda2584a98a7c2656@mail.gmail.com>
Date: Fri, 19 Jan 2007 07:50:03 -0600
From: "YYYY" < YYYY AT gmail DOT com>
To: YYYY AT meninshirtandtie DOT com
Subject: Multimedia message
In-Reply-To: <8d1136e30701181316x7d90edd2i4d0ab05e341af428@mail.gmail DOT com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
     boundary="----=_Part_112348_20826568.1169214603255"
References: <30048422.1169153442114.JavaMail.wluser@alpagw01>
     <8d1136e30701181316x7d90edd2i4d0ab05e341af428@mail.gmail DOT com>

untitled-[1.2]    0 k     [ text/html ]    
cid: 01-17-07_0908.jpg    42 k     [ image/jpeg ]




Hope this helps!

[Edited By Sami]:
Removed email address as requested
Title: Re: Email images to your gallery
Post by: zapakh on January 19, 2007, 09:48:42 pm
The complete headers from nolageek:

Code: [Select]
Return-Path: <XXXXXX AT mms DOT mycingular DOT com>
Received: from hitman1 DOT fuse DOT net ([69 DOT 89 DOT 21 DOT 25]) by mx3 DOT fuse DOT net
          (InterMail vM DOT 6 DOT 01 DOT 04 DOT 04 201-2131-118-104-20050224) with ESMTP
          id <20070119175933 DOT NIQR13749 DOT mx3 DOT fuse DOT net AT hitman1 DOT fuse DOT net>
          for <pricero AT fuse DOT net>; Fri, 19 Jan 2007 12:59:33 -0500
Received: from outbound-mail-65 DOT bluehost DOT com ([69 DOT 89 DOT 21 DOT 25])
          by hitman1 DOT fuse DOT net with SMTP
          id <20070119175928 DOT GEWT22353 DOT hitman1 DOT fuse DOT net AT outbound-mail-65 DOT bluehost DOT com>
          for <pricero AT fuse DOT net>; Fri, 19 Jan 2007 12:59:28 -0500
Received: (qmail 20965 invoked by uid 0); 19 Jan 2007 17:59:26 -0000
Received: from unknown (HELO box111 DOT bluehost DOT com) (70 DOT 103 DOT 189 DOT 170)
  by mailproxy4 DOT bluehost DOT com with SMTP; 19 Jan 2007 17:59:26 -0000
Received: from atlmtaow01 DOT cingularme DOT com ([66 DOT 102 DOT 165 DOT 6])
by box111 DOT bluehost DOT com with esmtp (Exim 4 DOT 63)
(envelope-from <XXXXXX AT mms DOT mycingular DOT com>)
id 1H7y1M-0002Tn-NB
for pricero AT proxims DOT com; Fri, 19 Jan 2007 10:59:25 -0700
X-Mms-MMS-Version: 16
Date: Fri, 19 Jan 2007 12:59:19 -0500
X-Nokia-Ag-Internal: ; smiltype=true; internaldate=1169229559544
Content-Type: multipart/mixed;
  boundary="----=_Part_2072086_25268642 DOT 1169229559556"
X-Mms-Delivery-Report: 1
Received: from alpagw02 ([209 DOT 183 DOT 34 DOT 196]) by atlmtaow01 DOT cingularme DOT com (InterMail vM DOT 6 DOT 01 DOT 04 DOT 00 201-2131-118-20041027) with ESMTP id <20070119175919 DOT LWIN2373 DOT atlmtaow01 DOT cingularme DOT com AT alpagw02> for <pricero AT proxims DOT com>; Fri, 19 Jan 2007 12:59:19 -0500
X-Mms-Transaction-ID: 1169207915
From: <XXXXXX AT mms DOT mycingular DOT com>
To: pricero AT proxims DOT com
X-Mms-Read-Reply: 1
X-Mms-Expiry: RELATIVE: 50763648
Mime-Version: 1 DOT 0
Message-ID: <18938791 DOT 1169229559690 DOT JavaMail DOT wluser AT alpagw02>
X-Mms-Priority: 1
X-Mms-Message-Type: 0
Subject: Multimedia message
X-Nokia-Ag-Version: 2 DOT 0
Status: R
X-Status: NC
X-KMail-EncryptionState: 
X-KMail-SignatureState: 
X-KMail-MDN-Sent: 

------=_Part_2072086_25268642 DOT 1169229559556
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
Content-Location: 01-17-07_2358 DOT jpg
Content-ID: <01-17-07_2358 DOT jpg>
Content-Disposition: inline

/9j/4QXtRXhpZgAATU0AKgAAAAgABQEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAL/
/wITAAMAAAABAAH//4dpAAQAAAABAAAAuAAAAFoAAABIAAAAAQAAAEgAAAABAAYBAwADAAAAAQAG
 DOT  DOT  DOT

This wireless provider's MMS thing is sending the image as the one and only message part.  This mod until now has skipped looking at the first part, assuming it to be an uninteresting text section.

Therefore, replace these lines:

Code: [Select]
$fpos=2;
    for($i = 1; $i < count($parts); $i++)

with these (two modifications) :

Code: [Select]
$fpos=1;
    for($i = 0; $i < count($parts); $i++)

A couple lines later, immediately after the line

Code: [Select]
    $part = $parts[$i];

insert the lines:

Code: [Select]
    if ($part->type == 0) {
        $fpos+=1;
        continue;
    }


[edited By Sami]:
Removed email address as requested
Title: Re: Email images to your gallery
Post by: zapakh on January 19, 2007, 10:08:38 pm
I left off the fact that if you dont include a subject and some text in the body the email attachment will not post.
I wonder if this problem wasn't related to nolageek's.  Maybe the above change fixes both.  However, an attachment could still go undetected if the MMS gateway is diabolical enough to wrap it in multiple nested multipart parts.
Title: Re: Email images to your gallery
Post by: zapakh on January 19, 2007, 10:17:05 pm
This wireless provider's MMS thing is sending the image as the one and only message part.

Also, the image part lacks both a name parameter on its Content-Type and a filename parameter on Content-Disposition, so you'd still end up with a filename that looks like 'nfn' . rand()

To correct this, we can make use of the supplied Content-ID header.  To do that, just before the line
Code: [Select]
    if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);

insert the lines
Code: [Select]
    if (empty($filename) && $part->ifid)
        $filename = trim($part->id, '<>');

Thanks nolageek for the information about your wireless provider's MMS output.
Title: Re: Email images to your gallery
Post by: carverjnr on March 07, 2007, 03:14:31 pm
Hopefully this topic isn't dead yet... It's a great mod! However, I spent hours trying to get it to work (by regular email, not MMS), with no success. The file was removed from my email server, but not stored into any folder or album. I tried all the code changes, etc, but nothing.

About 1:00am I discovered the cause: All my test emails were being sent through Mozilla Thunderbird as the email client. I then decided to give Outlook Express a go, and "presto", it worked, first time.

So, that's the cause of the problem. Now can anyone suggest a solution? I much prefer Thunderbird to Outlook Express, so would prefer to send emails via Thunderbird, but the attachments don't work.

Why do Outlook Express emails work and not Thunderbird's?  ??? Other than the email client, everything else is the same (ie I'm using the same sending account).

Many thanks for any suggestions  :)
Title: Re: Email images to your gallery
Post by: zapakh on March 07, 2007, 05:43:23 pm
About 1:00am I discovered the cause: All my test emails were being sent through Mozilla Thunderbird as the email client. I then decided to give Outlook Express a go, and "presto", it worked, first time.

So, that's the cause of the problem. Now can anyone suggest a solution? I much prefer Thunderbird to Outlook Express, so would prefer to send emails via Thunderbird, but the attachments don't work.

Given that the email disappears and no image appears, it certainly sounds as if the mod isn't finding the attachment.  For a start, please post the headers of an offending email message, as was done previously above in

http://forum.coppermine-gallery.net/index.php?topic=33950.msg191410#msg191410
Title: Re: Email images to your gallery
Post by: carverjnr on March 07, 2007, 11:29:42 pm
Thanks for the reply zapakh. Here's the header from emails sent through Mozilla Thunderbird (1.5.0.10) (ie this is the email header which does NOT work):  :(

Code: [Select]
Return-path: <cj@carversonline.com>
Envelope-to: photo@carversonline.com
Delivery-date: Wed, 07 Mar 2007 16:00:25 -0600
Received: from adsl-3-067.nsw.dft.com.au ([202.76.177.67] helo=[127.0.0.1])
by hathor.sslcatacombnetworking.com with esmtpa (Exim 4.63)
(envelope-from <cj@carversonline.com>)
id 1HP4BL-0005QI-37
for photo@carversonline.com; Wed, 07 Mar 2007 16:00:25 -0600
Message-ID: <45EF35F2.4050807@carversonline.com>
Date: Thu, 08 Mar 2007 09:00:18 +1100
From: "cj@carversonline.com" <cj@carversonline.com>
Reply-To:  cj@carversonline.com
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
To:  photo@carversonline.com
Subject: Test from Thunderbird
Content-Type: multipart/mixed;
 boundary="------------050604090302070408060908"

This is a multi-part message in MIME format.
--------------050604090302070408060908
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<small><font face="Helvetica, Arial, sans-serif">Test from Thunderbird</font></small>
</body>
</html>

--------------050604090302070408060908
Content-Type: image/jpeg;
 name="P1020731.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="P1020731.jpg"

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQY
...
Title: Re: Email images to your gallery
Post by: carverjnr on March 12, 2007, 05:47:39 am
Hang on everyone... I've carefully re-done all "the mods to the mod" as listed in the posts on this topic, and Thunderbird IS working ;D.

Very sorry for leading you up the garden path...   Must have been a typo.  :-[

It took the mods (eg MMS mods) to get it going though.
Title: Re: Email images to your gallery
Post by: rphMedia on April 04, 2007, 10:18:47 pm
A couple of you are sending emails that exceed 2MBs.  I explained in the first post that the current limit is 1MB.  Whoever "rafy AT cogeco DOT com" is, you're the latest victim.  Try again with a smaller image.
Title: Re: Email images to your gallery
Post by: helmutmk on May 27, 2007, 07:45:25 pm
Hello,
I crying. I install the software but I get no picture in my Album. I test with the the Server from rphmedia, works fine (upload as Mail and as MMS) but no chance by me.

I using coppermine 1.4.10
The Mail Header:
Quote
Content-Type:  multipart/related; type="multipart/alternative"; boundary="===============1443990321=="
Date:  Sun, 27 May 2007 19:30:28 +0200 [19:30:28 CEST]
Delivered-To:  3-pix@swedesign.de
emrout@mmsreply.tacn.detemobil.de
 
From:  "xxxxx@mmsreply.t-mobile.de" <NcBZRuOQ67l6jUvPoyvKv0u97y3rusXTdClTi7ah@mmsreply.t-mobile.de>
MIME-Version:  1.0
Message-Id:  <20070527173029.994F31100001@outmta.t-mobile.de>
Original_Msg_Size:  23060
Received:  (qmail 19024 invoked from network); 27 May 2007 19:31:07 +0200
from replymta.mmsreply.t-mobile.de (193.254.161.100) by goes-to.com with SMTP; 27 May 2007 19:31:07 +0200
from outmta.t-mobile.de (unknown [172.28.13.25]) by replymta.mmsreply.t-mobile.de (Postfix) with ESMTP id 9DE05117480C for <pix@swedesign.de>; Sun, 27 May 2007 19:30:29 +0200 (CEST)
from [10.101.82.17] (localhost.localdomain [127.0.0.1]) by outmta.t-mobile.de (Postfix) with ESMTP id 994F31100001 for <pix@swedesign.de>; Sun, 27 May 2007 19:30:29 +0200 (CEST)
from mms1.t-mobile.de (unknown [10.65.32.133]) by mmsreply.tacn.detemobil.de (Postfix) with ESMTP id 2B09610A8001 for <pix@swedesign.de>; Sun, 27 May 2007 19:30:28 +0200 (CEST)
 
Received-SPF:  none (goes-to.com: domain at mmsreply.t-mobile.de does not designate permitted sender hosts)
Return-Path:  <xxxx@mmsreply.t-mobile.de>
Subject:  Fw: L
To:  pix@swedesign.de
X-Mms-Delivery-Report:  No
X-Mms-Delivery-Time:  Sun, 27 May 2007 17:30:28 GMT
X-Mms-MMS-Version:  1.2
X-Mms-Message-Class:  Personal
X-Mms-Message-ID:  m69w2ty2k0ysgjbv300@mms.t-mobile.de
X-Mms-Message-Size:  21979
X-Mms-Message-Type:  m-send-req
X-Mms-Read-Reply:  No
X-Mms-Read-Report:  No
X-Mms-Sender-Visibility:  Show
X-Mms-Transaction-ID:  b-2694d791@
X-Priority:  3
X-Spam-Checker-Version:  SpamAssassin 3.0.4 (2005-06-05) on h894073.serverkompetenz.net
X-Spam-Level:  ***
X-Spam-Status:  No, score=3.3 required=5.0 tests=EXTRA_MPART_TYPE, FROM_ENDS_IN_NUMS,FROM_HAS_MIXED_NUMS,FROM_HAS_MIXED_NUMS3, HTML_MESSAGE,PRIORITY_NO_NAME autolearn=no version=3.0.4
 

The newcam.php
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{swedesign.de:110/pop3/novalidate-cert}"// pop3host
//$host="{swedesign.de:110/pop3}";
$login="xxx@swedesign.de"//pop3 login 
$password="****"//pop3 password 
$filepath="/vvvvvvvvvvvvvvv/httpdocs/albums/temppix/"
$album="78"// album id #
$folder "temppix/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

Code: [Select]
<?php
######################################

#Coded By Jijo Last Update Date[Jan/19/06]
#http://phpclasses.org

#####################################




##########################################################


###################### Class readattachment ###############
class readattachment
{
function getdecodevalue($message,$coding)
{
if ($coding == 0

   $message imap_8bit($message); 

elseif ($coding == 1

  $message imap_8bit($message); 

elseif ($coding == 2

   $message imap_binary($message); 

elseif ($coding == 3

   $message=imap_base64($message); 
   } 
elseif ($coding == 4

   $message imap_qprint($message); 

elseif ($coding == 5

 $message imap_base64($message); 

return $message;
}

function getdata($host,$login,$password,$filepath,$album,$folder)
{
$mbox imap_open ($host,  $login$password) or die("can't connect: " imap_last_error());
$message = array();
$message["attachment"]["type"][0] = "text";
$message["attachment"]["type"][1] = "multipart";
$message["attachment"]["type"][2] = "message";
//$message["attachment"]["type"][3] = "application";
$message["attachment"]["type"][4] = "audio";
$message["attachment"]["type"][5] = "image";
$message["attachment"]["type"][6] = "video";
$message["attachment"]["type"][7] = "other";

for ($jk 1$jk <= imap_num_msg($mbox); $jk++)
{
$structure imap_fetchstructure($mbox$jk FT_UID);    
$parts $structure->parts;
$fpos=2;
for($i 1$i count($parts); $i++)
   {
$message["pid"][$i] = ($i);
$part $parts[$i];

//if($part->disposition == "ATTACHMENT") 
  if($part->disposition == "ATTACHMENT" || $part->disposition == "INLINE")
{
    
$message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" strtolower($part->subtype);
$message["subtype"][$i] = strtolower($part->subtype);
$ext=$part->subtype;
$params $part->dparameters;
$filename=$part->dparameters[0]->value;

        $mege="";
$data="";
   $mege imap_fetchbody($mbox,$jk,$fpos);  
$fp=fopen($filepath $filename,w);
$data=$this->getdecodevalue($mege,$part->type);

fputs($fp,$data);
fclose($fp);
add_picture($album$folder$filename);
$fpos+=1;

}

}
//imap_delete($mbox,$jk);
}
//imap_expunge($mbox);
imap_close($mbox);
}
}
?>

Can anybody help me, I try also the solutions from zapakh , nothing.

Bet regards
Helmut
Title: Re: Email images to your gallery
Post by: mmek on May 27, 2007, 09:42:28 pm
Hi All,

Can you guys tell me where I can download this MOD?  Maybe I am just bind :) but I can't seem to find it.

Thanks.
Title: Re: Email images to your gallery
Post by: rphMedia on May 27, 2007, 10:40:19 pm
Edit; original post produced in error.
Title: Re: Email images to your gallery
Post by: helmutmk on May 27, 2007, 11:19:33 pm
Hella,
I solve my problem, very simpel, the filepath was not correct :(

The code to download is on page 1 "Reply #5 on: August 26, 2006, 12:31:26 PM" posting number six.

Best regards
Helmut
Title: Re: Email images to your gallery
Post by: mmek on May 27, 2007, 11:48:09 pm
Hi All,

Can you guys tell me where I can download this MOD?  Maybe I am just bind :) but I can't seem to find it.

Thanks.

Thanks for the location guys.  I am not sure how I missed that!

I do have another question though!


Here is what I've done:

But the pictures still do not upload correctly.  I know that the email works because I put in an echo within the attachmentread.class.php.  Is there something else I should be doing?

Please let me know.

Thans for the great work.

Title: Re: Email images to your gallery
Post by: mmek on May 28, 2007, 12:16:51 am
Thanks for the location guys.  I am not sure how I missed that!

I do have another question though!


Here is what I've done:
  • I copied the 3 files to my website
  • modified the newcam.php to reflect my information and path
  • renamed the anycontent1.php to anycontent.php
  • added anycontent to the Album List view
  • granted write permissions to the folder
  • granted "Visitors can upload files"

But the pictures still do not upload correctly.  I know that the email works because I put in an echo within the attachmentread.class.php.  Is there something else I should be doing?

Please let me know.

Thans for the great work.



Sorry guys!  Found my own mistake.  My filepath was not set correctly in newcam.php

Works like a charm.

Thanks.
Title: Re: Email images to your gallery
Post by: Dwilliams on June 14, 2007, 11:02:31 pm
Good afternoon everyone,
  I hope that this topic is still being monitored because this is an excellent mod. I am having an issue with getting mine to work with my gallery page and wanted to know if someone with experience in this would be able to send me in the right direction.

When I copy the new index.php to the coppermine root, I get a ton of garbage up on my screen and not the main gallery page example:

Code: [Select]
$lang_album_admin_menu['confirm_delete'], '{DELETE}' => $lang_album_admin_menu['delete'], '{MODIFY}' => $lang_album_admin_menu['modify'], '{EDIT_PICS}' => $lang_album_admin_menu['edit_pics'], ); $template = template_eval($template_album_admin_menu, $params); } $params = array('{ALBUM_ID}' => $id, ); return template_eval($template, $params); } /** * get_subcat_data() * * Get the data about the sub categories which are going to be shown on the index page, this function is called recursively * * @param integer $parent Parent Category * @param array $cat_data * @param array $album_set_array * @param integer $level Level being displayed * @param string $ident String to use as indentation for Categories * @return void **/ function get_subcat_data($parent, &$cat_data, &$album_set_array, $level, $ident = '') { global $CONFIG, $HIDE_USER_CAT, $FORBIDDEN_SET, $cpg_show_private_album; $album_filter = ''; $pic_filter = ''; if (!empty($FORBIDDEN_SET) && !$cpg_show_private_album) { $album_filter = ' and ' . str_replace('p.', 'a.', $FORBIDDEN_SET); $pic_filter = ' and ' . str_replace('p.', $CONFIG['TABLE_PICTURES'] . '.', $FORBIDDEN_SET); } if ($CONFIG['categories_alpha_sort'] == 1) {$cat_sort_order = 'name';}else{$cat_sort_order = 'pos';} $result = cpg_db_query("SELECT cid, name, description, thumb FROM
I have also included my newcam.php file:
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.gallery.hlcmarketingcorner.com:110/pop3}"// pop3host 
$login="****@gallery.hlcmarketingcorner.com"//pop3 login 
$password="****"//pop3 password 
$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/Custom/";  ; // attachement will save in same directory where scripts run, otherwise give abs path 
$album="7"// album id #
$folder "Custom/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

and added the suggested items to the anycontent.php
Code: [Select]
*/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

starttable("100%", "Welcome");
include("newcam.php");

?>
<tr><td class="tableb" >
and lastly the index.php snippet
Code: [Select]
                    case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;
case 'receivemail':
                if ($cat == 0) {
                    include('RPHMEDIA-FILE.php');
                }
                flush();
                break;
                }
            }
        }
    }

What am I missing here?
Thank you for taking the time to read this.
Title: Re: Email images to your gallery
Post by: Dwilliams on June 15, 2007, 06:02:36 pm
Quote
ood afternoon everyone,
  I hope that this topic is still being monitored because this is an excellent mod. I am having an issue with getting mine to work with my gallery page and wanted to know if someone with experience in this would be able to send me in the right direction.

    * I have uploaded the 3 files to the root of my coppermine directory
    * I created a new email account for the images to go to
    * I Set the folder permissions
    * Configured the newcam file
    * Added a case to the index file as suggested in one of the first messages of this thread
    * Allow visitors to upload files

After a reinstall and carefully following the instructions I have gotten it to work-----Once since that first message it will only delete the messages now and not post the image. What could have changed here that is causing this?
Title: Re: Email images to your gallery
Post by: nolageek on July 08, 2007, 09:01:28 am
Hey guys.  I need to get my cellphone's e-mail address out of this thread.. I've been getting slammed with spam the last week and this is the only place it's listed that I can find! it's the one with 504609 in it.  I can't edit the posts or I'd do it myself.
Title: Re: Email images to your gallery
Post by: Sami on July 08, 2007, 09:19:45 am
Done !
Never post email address to a public forum
Title: Re: Email images to your gallery
Post by: nolageek on July 08, 2007, 10:04:04 am
Like I said, this is the only place it was at because I don't normally  post my addresses like that.. I probably just cut and pasted without thinking about the the content. :)

I've gotten almost 200 pieces of spam sent to my cell phone the last 5 days and I just about nearly tore my hair out trying to find where it was coming from. 

Thank you very much.
Title: Re: Email images to your gallery
Post by: nolageek on July 09, 2007, 03:33:44 pm
Wow. I'm glad I don't use this gallery anymore.  Talk about verbally abusive moderators.

I'm very sorry I asked you to help me, but that's no reason to call me stupid over and over in PMs.

(I'm sorry I PMed you.)

Please, ban me.
Title: Re: Email images to your gallery
Post by: Sami on July 09, 2007, 10:23:08 pm
What !?  :o
I did not send you any PM at all  ???
What are you talking about ?
Title: Re: Email images to your gallery
Post by: nolageek on July 11, 2007, 10:00:37 am
What !?  :o
I did not send you any PM at all  ???
What are you talking about ?


Not you, Sami. GauGau.

I came here in a panic after receiving hundreds of spam e-mails to my cell phone (waking me up about 8 or 9 times a night) and since I saw GauGau was online and a moderator I PMed him asking if he could edit my messages on this board and remove my cellphone's e-mail address (which I admit I shouldn't have posted in the first place.. but I wasn't thinking.)

He then wrote back, talking down to me like a child, accusing me of mass-PMing all of the moderators - which I most certainly did NOT do. Scolding me for PMing a moderator and that it was 'against the rules'

I wrote back to him explaining that I was sorry for PMing him and clarifying that I did NOT pm anyone but him and he again scolded me like a child and threatened to ban me if I continued PMing him.
Title: Re: Email images to your gallery
Post by: Sami on July 11, 2007, 10:39:42 am
GauGau's as an admin receive many PMs and it is disgusting cause people keeps sending him support request without his permission check his signature , managing hundreds of PMs a day would make anybody angry
We can finish this here , this kind of discussions doesn't belongs here ....

Next time please be more careful with PMing Devs and supporters
Title: Re: Email images to your gallery
Post by: Joachim Müller on July 12, 2007, 09:45:00 am
Wow. I'm glad I don't use this gallery anymore.
OK, bye.

Please, ban me.
Did as suggested. Thanks for cluttering this thread with your remarks.
Title: Re: Email images to your gallery
Post by: Dwilliams on July 13, 2007, 05:20:51 pm
Good afternoon everyone,
  I hope that this topic is still being monitored because this is an excellent mod. I am having an issue with getting mine to work with my gallery page and wanted to know if someone with experience in this would be able to send me in the right direction.

  • I have uploaded the 3 files to the root of my coppermine directory
  • I created a new email account for the images to go to
  • I Set the folder permissions
  • Configured the newcam file
  • Added a case to the index file as suggested in one of the first messages of this thread
  • Allow visitors to upload files
When I copy the new index.php to the coppermine root, I get a ton of garbage up on my screen and not the main gallery page example:

Code: [Select]
$lang_album_admin_menu['confirm_delete'], '{DELETE}' => $lang_album_admin_menu['delete'], '{MODIFY}' => $lang_album_admin_menu['modify'], '{EDIT_PICS}' => $lang_album_admin_menu['edit_pics'], ); $template = template_eval($template_album_admin_menu, $params); } $params = array('{ALBUM_ID}' => $id, ); return template_eval($template, $params); } /** * get_subcat_data() * * Get the data about the sub categories which are going to be shown on the index page, this function is called recursively * * @param integer $parent Parent Category * @param array $cat_data * @param array $album_set_array * @param integer $level Level being displayed * @param string $ident String to use as indentation for Categories * @return void **/ function get_subcat_data($parent, &$cat_data, &$album_set_array, $level, $ident = '') { global $CONFIG, $HIDE_USER_CAT, $FORBIDDEN_SET, $cpg_show_private_album; $album_filter = ''; $pic_filter = ''; if (!empty($FORBIDDEN_SET) && !$cpg_show_private_album) { $album_filter = ' and ' . str_replace('p.', 'a.', $FORBIDDEN_SET); $pic_filter = ' and ' . str_replace('p.', $CONFIG['TABLE_PICTURES'] . '.', $FORBIDDEN_SET); } if ($CONFIG['categories_alpha_sort'] == 1) {$cat_sort_order = 'name';}else{$cat_sort_order = 'pos';} $result = cpg_db_query("SELECT cid, name, description, thumb FROM
I have also included my newcam.php file:
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/picmgmt.inc.php');
require_once(
"attachmentread.class.php"); 
$host="{mail.gallery.hlcmarketingcorner.com:110/pop3}"// pop3host 
$login="****@gallery.hlcmarketingcorner.com"//pop3 login 
$password="****"//pop3 password 
$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/Custom/";  ; // attachement will save in same directory where scripts run, otherwise give abs path 
$album="7"// album id #
$folder "Custom/"// foldername with a /
$jk=new readattachment(); // Creating instance of class#### 
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function 
?>

and added the suggested items to the anycontent.php
Code: [Select]
*/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

starttable("100%", "Welcome");
include("newcam.php");

?>
<tr><td class="tableb" >
and lastly the index.php snippet
Code: [Select]
                    case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;
case 'receivemail':
                if ($cat == 0) {
                    include('RPHMEDIA-FILE.php');
                }
                flush();
                break;
                }
            }
        }
    }

What am I missing here?
Thank you for taking the time to read this.

Does anyone have any suggestions for this issue? I've given this close to a month and tried different things but have no success as yet.

Thanks,
D
Title: Re: Email images to your gallery
Post by: zer0one on August 16, 2007, 10:43:33 pm
So is this a dead project? Or should it still work? I have the same issue Dwilliams is having but there seems to be no more support. Is anyone using this mod on their current (latest update) gallery?
Title: Re: Email images to your gallery
Post by: Nibbler on August 16, 2007, 11:05:18 pm
Post your anycontent.php
Title: Re: Email images to your gallery
Post by: rphMedia on August 16, 2007, 11:06:54 pm
So is this a dead project? Or should it still work? I have the same issue Dwilliams is having but there seems to be no more support. Is anyone using this mod on their current (latest update) gallery?

The problem is...no one asks a question. They post a bunch of code and expect someone to figure it out for them. What IS your question zer0one, Dwilliams? It works fine at my gallery (http://gallery.rphmedia.net). Email an image to cam@rphmedia.net - you'll see that it works just fine if you follow directions and your host/email supports it. There's no magic to it. And please, don't "expect" support, ask for it. You usually get better response.
Title: Re: Email images to your gallery
Post by: Dwilliams on August 17, 2007, 10:28:45 pm
So is this a dead project? Or should it still work? I have the same issue Dwilliams is having but there seems to be no more support. Is anyone using this mod on their current (latest update) gallery?

Double and triple check the filepath. example:
Code: [Select]
$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/Custom/";  ; // attachement will save in same directory where scripts run, otherwise give abs pathWas the original code for my path, however since I did NOT install the coppermine gallery in the root www directory. I had to add "/gallery/coppermine/albums/Custom/" to make the path work. RPH is correct, for the most part this should work out of the "box" with a few modifications to the default coppermine install. However now that I understand more about this, maybe I can assist some now as well. Here's my Exact steps that I follow for install now (now done on 3 different galleries)


 
Title: Re: Email images to your gallery
Post by: fallingintoZero on November 15, 2007, 09:15:37 pm
i'm starting to think this may not work anymore. i checked my gallery today for the first time in about a week, so i'm not sure how long this issue has been present, and i get this error message:

Quote
can't connect: Certificate failure for mail.redeemedplaces.com: self signed certificate: /C=US/ST=Unknown/L=Unknown/O=Unknown/OU=Unknown/CN=shared8.whbdns.com/emailAddress=ssl@shared8.whbdns.com

this prevents my gallery from loading at all. if anyone is interested in looking at the problem themself, the address is http://img.redeemedplaces.com
Title: Re: Email images to your gallery
Post by: rphMedia on November 15, 2007, 09:17:16 pm
Looks like a host problem to me.
Title: Re: Email images to your gallery
Post by: Nibbler on November 15, 2007, 09:45:50 pm
Try without SSL.
Title: Re: Email images to your gallery
Post by: fallingintoZero on November 15, 2007, 09:56:44 pm
Try without SSL.

how would i go about doing that?
Title: Re: Email images to your gallery
Post by: Nibbler on November 15, 2007, 09:58:04 pm
What did you set $host as in newcam.php?
Title: Re: Email images to your gallery
Post by: fallingintoZero on November 15, 2007, 09:59:25 pm
What did you set $host as in newcam.php?

set as:
Quote
$host="{mail.redeemedplaces.com:110/pop3}"; // pop3host
Title: Re: Email images to your gallery
Post by: Nibbler on November 15, 2007, 10:15:29 pm
Try

Code: [Select]
$host="{mail.redeemedplaces.com:110/pop3/novalidate-cert}"; // pop3host
Title: Re: Email images to your gallery
Post by: fallingintoZero on November 15, 2007, 10:20:46 pm
you sir, i owe a cookie. worked like a charm. thank you  ;D
Title: Re: Email images to your gallery
Post by: kimnz on November 23, 2007, 09:59:27 pm
Hi,

I'd just like to thank the original authors and those who posted their modifications to this. I have it running like a dream.

Thanks.
Title: Re: Email images to your gallery
Post by: rubenix on December 02, 2007, 11:34:40 pm
Hi Folks, I really want this mod working on my site. Cool idea  ;)

is someone using this with a gmail account??
tryed with mine and is not working...does the server need any 'extra' feature installed?? Im using a free hosting and I thing that might be the problem...  ???

Can someone give an idea??

Thanks!
Title: Re: Email images to your gallery
Post by: rubenix on December 15, 2007, 09:54:23 pm
what's the server required feature I can check in the php info??
Title: Re: Email images to your gallery
Post by: phpbbguy on December 17, 2007, 03:29:11 am
I need some help with this mod, i get this error
Fatal error: Call to undefined function is_known_filetype() in /home/xxxxxx/public_html/gallery/include/picmgmt.inc.php on line 38
Title: Re: Email images to your gallery
Post by: rphMedia on December 17, 2007, 08:42:09 am
I need some help with this mod, i get this error
Fatal error: Call to undefined function is_known_filetype() in /home/xxxxxx/public_html/gallery/include/picmgmt.inc.php on line 38
If using an additional anycontent file, you need to add the case in index.php.

@rubenix - If you read the thread, you'll see that this mod has problems with free web hosts. For starters, you need IMAP support via php.
Title: Re: Email images to your gallery
Post by: rubenix on December 17, 2007, 11:57:04 am
ok Thanks ,  [forgetting about this] I will ask the host if I have the possibility of adding this...[/forgetting about this]
Title: Re: Email images to your gallery
Post by: phpbbguy on December 18, 2007, 07:33:18 am
If using an additional anycontent file, you need to add the case in index.php.


Am using the anycontent that you provided. how do i add a case to the index. I forgot to add that i think i was deugging by running mysite.com/newcam.php.
thanks!
Title: Re: Email images to your gallery
Post by: Dwilliams on December 20, 2007, 09:11:58 pm
Try

Code: [Select]
$host="{mail.redeemedplaces.com:110/pop3/novalidate-cert}"; // pop3host


I realise you may not get much of this but,

THANK YOU.

I got this gallery working over the summer after reading up on php and learning *beep* I was trying to actually do. Fast forward a few months This exact error popped up this week, and I was at a loss, called the hosting provider over it, no real resolution. I came back here, searched for the string and found it immediately.
EXCELLENT WORK GENTLEMAN! Or ladies if any have worked on the project.

D
Title: Re: Email images to your gallery
Post by: radmofo on February 16, 2008, 09:12:53 pm
Worked on this for a week now, I have read and read and reread! Looking for like one small edit to be up and running!

If someone could take a look at what I have it would be great. I've posted my attachmenttread.class.php file as well as 2 different headers that dont work and one that does. I am nearly positive it is something to do with the headers or the way the messages are laid out but I cant pin point it. With the help of this forum I will post a modded attachmenttread.class.php that has all the threads tweaks and improvements if you guys want.

Eager to hear what my issue is...




This is my attachmenttread.class.php

Quote
<?
         ######################################
         
         #Coded By Jijo Last Update Date[Jan/19/06]
         #http://phpclasses.org
         
         #####################################

   

         
         ##########################################################         


         ###################### Class readattachment ###############
class readattachment
{
      function getdecodevalue($message,$coding)
      {
      if ($coding == 0)
      {
         $message = imap_8bit($message);
      }
      elseif ($coding == 1)
      {
        $message = imap_8bit($message);
      }
      elseif ($coding == 2)
      {
         $message = imap_binary($message);
      }
      elseif ($coding == 3)
      {
      $message=imap_base64($message);
      }
      elseif ($coding == 4)
      {
         $message = imap_qprint($message);
      }
      elseif ($coding == 5)
      {
       $message = imap_base64($message);
      }
      return $message;
      }

         function getdata($host,$login,$password,$filepath,$album,$folder)
         {
         $mbox = imap_open ($host,  $login, $password) or die("can't connect: " . imap_last_error());
         $message = array();
         $message["attachment"]["type"][0] = "text";
         $message["attachment"]["type"][1] = "multipart";
         $message["attachment"]["type"][2] = "message";
         //$message["attachment"]["type"][3] = "application";
         $message["attachment"]["type"][4] = "audio";
         $message["attachment"]["type"][5] = "image";
         $message["attachment"]["type"][6] = "video";
         $message["attachment"]["type"][7] = "other";
         
         for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++)
         {
        $headerinfo = imap_header($mbox, $jk);
        $subject = $headerinfo->Subject;
                        $matches = array();
                        if (preg_match('/^=\?[^?]*\?B\?(.*)\?=/m', $subject, $matches))
                                $subject = base64_decode($matches[1]);

         $structure = imap_fetchstructure($mbox, $jk , FT_UID);   
         $parts = $structure->parts;
         $fpos=1;
    for($i = 0; $i < count($parts); $i++)
{
                  $message["pid"][$i] = ($i);
                  $part = $parts[$i];
if ($part->type == 0) {
        $fpos+=1;
        continue;
    }


                  if(TRUE)
                     {
                      $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
                     $message["subtype"][$i] = strtolower($part->subtype);
                     $ext=$part->subtype;
                if ($part->ifdparameters)
                  foreach($part->dparameters as $dparam)
                    if (strtolower($dparam->attribute) == 'filename') $filename = $dparam->value;
                if (empty($filename))
                  if ($part->ifparameters)
                    foreach($part->parameters as $param)
                      if (strtolower($param->attribute) == 'name') $filename = $param->value;

if (empty($filename) && $part->ifid)
        $filename = trim($part->id, '<>');
           

     if (empty($filename)) $filename = 'nfn' . rand() . '.' . strtolower($part->subtype);

                           
                               $mege="";
                           $data="";
                             $mege = imap_fetchbody($mbox,$jk,$fpos); 
                           $fp=fopen($filepath . $filename,w);
                           $data=$this->getdecodevalue($mege,$part->type);   
                           
                           fputs($fp,$data);
                           fclose($fp);
                           add_picture($album, $folder, $filename, 0, $subject);
                           $fpos+=1;
                           
                     }
         
               }
         //imap_delete($mbox,$jk);
         }
         //imap_expunge($mbox);
         imap_close($mbox);
         }
}
?>



This one is an MMS sent from my phone that DONT work...

Quote
Content-Type:      multipart/mixed; boundary="----=_Part_3839038_23551565.1203191401046"
Date:     Sat, 16 Feb 2008 14:50:01 -0500 [01:50:01 PM CST]
Delivered-To:     upload@mysite.com
From:     ##########@mms.att.net
Message-ID:     <23076156.1203191401047.JavaMail.wluser@alpagw01>
Mime-Version:     1.0
Received:     

    * (qmail 11936 invoked by uid 399); 16 Feb 2008 19:50:16 -0000
    * from unknown (HELO atlmtaow02.cingularme.com) (66.102.165.7) by mail30.opentransfer.com with SMTP; 16 Feb 2008 19:50:16 -0000
    * from alpagw01 ([209.183.34.196]) by atlmtaow02.cingularme.com (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20080216195001.KJRN25910.atlmtaow02.cingularme.com@alpagw01> for <Upload@mysite.com>; Sat, 16 Feb 2008 14:50:01 -0500

Return-Path:     <##########@mms.att.net>
Subject:     Hi
To:     Upload@mysite.com
X-Mms-MMS-Version:     18
X-Mms-Message-Type:     0
X-Mms-Transaction-ID:     1203191315704
X-Nokia-Ag-Internal:     ; smiltype=true; internaldate=1203191401034
X-Nokia-Ag-Version:     2.0
X-Virus-Scan:     Scanned by clamdmail 0.15 (no viruses); Sat, 16 Feb 2008 13:50:18 -0600
Headers:     Show Limited Headers
     1     unnamed     [image/jpeg]     412.38 KB     Download     Download in .zip Format

This one does NOT work either. It is sent from my blackberry using the email portion.

Quote
Content-Type:      multipart/mixed; boundary="part109399-boundary-963297514-2110743521"
Date:     Sat, 16 Feb 2008 19:47:38 +0000 [01:47:38 PM CST]
Delivered-To:     upload@mysite.com
From:     me <me@mypersonalemail.com>
Importance:     Normal
MIME-Version:     1.0
Message-ID:     <157172620-1203191378-cardhu_decombobulator_blackberry.rim.net-1675838995-@bxe145.bisx.prod.on.blackberry>
Received:     

    * (qmail 11064 invoked by uid 399); 16 Feb 2008 19:49:47 -0000
    * from unknown (HELO py-out-1112.google.com) (64.233.166.181) by mail30.opentransfer.com with SMTP; 16 Feb 2008 19:49:47 -0000
    * by py-out-1112.google.com with SMTP id f31so1290029pyh.18 for <upload@mysite.com>; Sat, 16 Feb 2008 11:49:44 -0800 (PST)
    * by 10.65.191.3 with SMTP id t3mr6971818qbp.0.1203191383615; Sat, 16 Feb 2008 11:49:43 -0800 (PST)
    * from bda170-cell02.bisx.prod.on.blackberry ( [216.9.248.90]) by mx.google.com with ESMTPS id e11sm4828930qbc.5.2008.02.16.11.49.39 (version=SSLv3 cipher=RC4-MD5); Sat, 16 Feb 2008 11:49:41 -0800 (PST)

Reply-To:     me@mypersonalemail.com
Return-Path:     

    * <me@mypersonalemail.com>
    * <me@mypersonalemail.com>

Sensitivity:     Normal
Subject:     IMG00379.jpg
To:     upload@mysite.com
X-Priority:     Normal
X-Virus-Scan:     Scanned by clamdmail 0.15 (no viruses); Sat, 16 Feb 2008 13:49:49 -0600
X-rim-org-msg-ref-id:     157172620
Part(s):     
     2     IMG00379.jpg     [image/jpeg]     370 KB     Download     Download in .zip Format
   Download All Attachments (in .zip file) Download All Attachments (in .zip file)

This one is sent from a web based gmail account and DOES work.

Quote
Content-Type:      multipart/mixed; boundary="----=_Part_2549_4757736.1203189155175"
DKIM-Signature:     v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=MW4h7FaH/QDZmNEpnnDprq49MTgHgw2mpjOSiSEgE8Y=; b=JsevrYpBQneCKNvsbo7D/TjM6def+faaqTa3g+bKd1cwqPmK8EXmAA0t1NOIi+Ujp8a76RFOEuwQCRji+mgDOh+zCTNFh50bYo8GNQNqcPzfTxuRN0ZEqfY8tT7Iu9yrGv4pHdjXwXLBo0/GreBk4NAYjKvywd1qT9VyPyGWPBQ=
Date:     Sat, 16 Feb 2008 14:12:35 -0500 [01:12:35 PM CST]
Delivered-To:     upload@mysite.com
DomainKey-Signature:     a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=WRg7tT6AVbkr4cjb7eY2suYl3WsSE07N6GbcwfeABWvkTmOfmjm+96wpKBtwOngIafPoCLlbdrydCTfz5+cqKmpDNcVKZxJw/mCE8VPHEvStU2jLX8hMg1sBVGJPsyxiwnrVCEI6f/WQgNuoLOZMf8/mAjKqH5CWugVVjXv3uJs=
From:     me <me@mypersonalemail.com>
In-Reply-To:     <7a5fa6a0802160955q4e263acexe745c91693ddc257@mail.gmail.com>
MIME-Version:     1.0
Message-ID:     <7a5fa6a0802161112h16409a3epd16c446d67689843@mail.gmail.com>
Received:     

    * (qmail 5244 invoked by uid 399); 16 Feb 2008 19:12:39 -0000
    * from unknown (HELO wa-out-1112.google.com) (209.85.146.180) by mail30.opentransfer.com with SMTP; 16 Feb 2008 19:12:39 -0000
    * by wa-out-1112.google.com with SMTP id j32so1747450waf.19 for <upload@mysite.com>; Sat, 16 Feb 2008 11:12:35 -0800 (PST)
    * by 10.114.161.11 with SMTP id j11mr767941wae.127.1203189155175; Sat, 16 Feb 2008 11:12:35 -0800 (PST)
    * by 10.114.151.7 with HTTP; Sat, 16 Feb 2008 11:12:35 -0800 (PST)

References:     <7a5fa6a0802160954t3292a7bdvff03f71e33fa1a25@mail.gmail.com> <7a5fa6a0802160955q4e263acexe745c91693ddc257@mail.gmail.com>
Return-Path:     <me@mypersonalemail.com>
Sender:     me@mypersonalemail.com
Subject:     Fwd:
To:     upload@mysite.com
X-Google-Sender-Auth:     652bd123b537d236
X-Spam-Checker-Version:     SpamAssassin 3.0.2 (2004-11-16) on localhost
X-Spam-Level:     
X-Spam-Status:     No, score=0.5 required=5.0 tests=HTML_40_50,HTML_MESSAGE autolearn=disabled version=3.0.2
X-Virus-Scan:     Scanned by clamdmail 0.15 (no viruses); Sat, 16 Feb 2008 13:12:40 -0600
Part(s):     
     2     flight.jpg     [image/jpeg]     53 KB     Download
Title: Re: Email images to your gallery
Post by: radmofo on February 18, 2008, 05:20:04 am
Dying to get this working guys!

Here is a more complete example of the email header that DON'T work.

Code: [Select]
Return-Path: <me@mypersonnalemail.com>
Delivered-To: upload@mysite.com
Received: (qmail 14964 invoked by uid 399); 17 Feb 2008 01:49:29 -0000
X-Virus-Scan: Scanned by clamdmail 0.15 (no viruses);
  Sat, 16 Feb 2008 19:49:30 -0600
Received: from unknown (HELO py-out-1112.google.com) (64.233.166.181)
  by mail30.opentransfer.com with SMTP; 17 Feb 2008 01:49:29 -0000
Received: by py-out-1112.google.com with SMTP id f31so1374595pyh.18
        for <upload@mysite.com>; Sat, 16 Feb 2008 17:49:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:x-rim-org-msg-ref-id:message-id:reply-to:x-priority:sensitivity:importance:to:subject:from:date:content-type:mime-version;
        bh=E5vfVNKc6YDOCb5D0wG7PI+NGR0vPje0PQGwvsHCPv0=;
        b=iaA+oayEk7x5CWF8qwEOmJHAL3Hhn7upTjTXyjpPEwYsdPoj4g9cfLiPo8VdbbLy23rZNg4f7Zqn9WXeTRllMr0juq8WnbXMPm+Ukp1INBruPt2epaxhEMtwydCTbeny1ZzG0EX+cI9oW8ZidHxEL63f32MDqnRnur5M1fplUGQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=x-rim-org-msg-ref-id:message-id:reply-to:x-priority:sensitivity:importance:to:subject:from:date:content-type:mime-version;
        b=gNnIVukg3yfmnsHnAW6inrkuah6CRmPi0DOpHbuVf6jY7D/Ky/qRmq97B4Iw7xm3vkS2FuK5PZnqB0zG6Y3V8eGMpwB1kPnFMGeiKDPpUDOLpYcSDWiDFKpTezT9gdbrQ3kPCHK37qwMLprUVm/T28n7ag2kapCJwrR80RbHACE=
Received: by 10.65.219.20 with SMTP id w20mr7337301qbq.68.1203212968876;
        Sat, 16 Feb 2008 17:49:28 -0800 (PST)
Return-Path: <me@mypersonnalemail.com>
Received: from bda170-cell02.bisx.prod.on.blackberry ( [216.9.248.90])
        by mx.google.com with ESMTPS id p4sm5118364qba.15.2008.02.16.17.49.27
        (version=SSLv3 cipher=RC4-MD5);
        Sat, 16 Feb 2008 17:49:28 -0800 (PST)
X-rim-org-msg-ref-id:881719303
Message-ID:<881719303-1203212962-cardhu_decombobulator_blackberry.rim.net-1967158926-@bxe145.bisx.prod.on.blackberry>
Reply-To: me@mypersonnalemail.com
X-Priority: Normal
Sensitivity: Normal
Importance: Normal
To: "Uploader To RFS" <upload@mysite.com>
Subject: Fw: Pic
From: "=?utf-8?B?S2V2aW4gUm9iYmlucw==?=" <me@mypersonnalemail.com>
Date: Sun, 17 Feb 2008 01:49:32 +0000
Content-Type: multipart/mixed; boundary="part112341-boundary-578476062-1602154594"
MIME-Version: 1.0
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on localhost
X-Spam-Status: No, score=1.5 required=5.0 tests=MIME_BASE64_NO_NAME,
PRIORITY_NO_NAME autolearn=disabled version=3.0.2
X-Spam-Level: *


--part112341-boundary-578476062-1602154594
Content-Type: text/plain




*******************
Sent from my BlackBerry wireless handheld.
*******************

-----Original Message-----
From: "me" <me@mypersonnalemail.com>

Date: Sat, 16 Feb 2008 21:11:16
To:"Uploader To RFS" <upload@mysite.com>

I know it has something to do with the way the email headers are written, I just don't have the skill to fix it. I've tried every mod to the mod in this thread 20 times and the MMS or Blackberry emailed image attachments I have in the inbox just wont add to the gallery. However the ones sent via gmail work everytime. Uggg ???
Title: Re: Email images to your gallery
Post by: radmofo on February 18, 2008, 05:28:21 am
Lets try again, this is a COMPLETE header of a non-working email.  ::)

Code: [Select]
Return-Path: <me@mypersonnalemail.com>
Delivered-To: upload@mysite.com
Received: (qmail 14964 invoked by uid 399); 17 Feb 2008 01:49:29 -0000
X-Virus-Scan: Scanned by clamdmail 0.15 (no viruses);
  Sat, 16 Feb 2008 19:49:30 -0600
Received: from unknown (HELO py-out-1112.google.com) (64.233.166.181)
  by mail30.opentransfer.com with SMTP; 17 Feb 2008 01:49:29 -0000
Received: by py-out-1112.google.com with SMTP id f31so1374595pyh.18
        for <upload@mysite.com>; Sat, 16 Feb 2008 17:49:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:x-rim-org-msg-ref-id:message-id:reply-to:x-priority:sensitivity:importance:to:subject:from:date:content-type:mime-version;
        bh=E5vfVNKc6YDOCb5D0wG7PI+NGR0vPje0PQGwvsHCPv0=;
        b=iaA+oayEk7x5CWF8qwEOmJHAL3Hhn7upTjTXyjpPEwYsdPoj4g9cfLiPo8VdbbLy23rZNg4f7Zqn9WXeTRllMr0juq8WnbXMPm+Ukp1INBruPt2epaxhEMtwydCTbeny1ZzG0EX+cI9oW8ZidHxEL63f32MDqnRnur5M1fplUGQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=x-rim-org-msg-ref-id:message-id:reply-to:x-priority:sensitivity:importance:to:subject:from:date:content-type:mime-version;
        b=gNnIVukg3yfmnsHnAW6inrkuah6CRmPi0DOpHbuVf6jY7D/Ky/qRmq97B4Iw7xm3vkS2FuK5PZnqB0zG6Y3V8eGMpwB1kPnFMGeiKDPpUDOLpYcSDWiDFKpTezT9gdbrQ3kPCHK37qwMLprUVm/T28n7ag2kapCJwrR80RbHACE=
Received: by 10.65.219.20 with SMTP id w20mr7337301qbq.68.1203212968876;
        Sat, 16 Feb 2008 17:49:28 -0800 (PST)
Return-Path: <me@mypersonnalemail.com>
Received: from bda170-cell02.bisx.prod.on.blackberry ( [216.9.248.90])
        by mx.google.com with ESMTPS id p4sm5118364qba.15.2008.02.16.17.49.27
        (version=SSLv3 cipher=RC4-MD5);
        Sat, 16 Feb 2008 17:49:28 -0800 (PST)
X-rim-org-msg-ref-id:881719303
Message-ID:<881719303-1203212962-cardhu_decombobulator_blackberry.rim.net-1967158926-@bxe145.bisx.prod.on.blackberry>
Reply-To: me@mypersonnalemail.com
X-Priority: Normal
Sensitivity: Normal
Importance: Normal
To: "Uploader To RFS" <upload@mysite.com>
Subject: Fw: Pic
From: "=?utf-8?B?S2V2aW4gUm9iYmlucw==?=" <me@mypersonnalemail.com>
Date: Sun, 17 Feb 2008 01:49:32 +0000
Content-Type: multipart/mixed; boundary="part112341-boundary-578476062-1602154594"
MIME-Version: 1.0
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on localhost
X-Spam-Status: No, score=1.5 required=5.0 tests=MIME_BASE64_NO_NAME,
PRIORITY_NO_NAME autolearn=disabled version=3.0.2
X-Spam-Level: *


--part112341-boundary-578476062-1602154594
Content-Type: text/plain




*******************
Sent from my BlackBerry wireless handheld.
*******************

-----Original Message-----
From: "me" <me@mypersonnalemail.com>

Date: Sat, 16 Feb 2008 21:11:16
To:"Uploader To RFS" <upload@mysite.com>
Subject: Pic




*******************
Sent from my BlackBerry wireless handheld.
*******************

--part112341-boundary-578476062-1602154594
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
Content-Disposition: attachment; filename="=?Windows-1252?B?SU1HMDAzMTMuanBn?="

/9j/4QEsRXhpZgAASUkqAAgAAAAJAA8BAgATAAAAegAAABABAgAQAAAAjgAAABIBAwABAAAAAQAA
ABoBBQABAAAAngAAABsBBQABAAAApgAAACgBAwABAAAAAgAAADIBAgAUAAAArgAAABMCAwABAAAA
AgAAAGmHBAABAAAAwgAAAAAAAABSZXNlYXJjaCBJbiBNb3Rpb24AAEJsYWNrQmVycnkgODMwMABI
AAAAAQAAAEgAAAABAAAAMjAwODowMToxNyAxNToyNToyOQAGAACQBwAEAAAAMDIyMAOQAgAUAAAA
EAEAAAGgAwABAAAAAQAAAAGRBwAEAAAAAQIDAAKgAwABAAAAEAIAAAOgAwABAAAAkAEAAAAAAAAy
MDA4OjAxOjE3IDE1OjI1OjI5AP/bAIQAIBYYHBgUIBwaHCQiICYwUDQwLCwwYkZKOlB0Znp4cmZw
boCQuJyAiK6KbnCg2qKuvsTO0M58muLy4MjwuMrOxgEiJCQwKjBeNDRexoRwhMbGxsbGxsbGxsbG
xsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbG/90ABAAy/8AAEQgBkAIQAwEh
AAIRAQMRAf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9
AQIDAAQRBRI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RKxO5XZu5phOaaAbRVAF
KBQA4CgnFS3cBpJNFAxQCxwBU8dser0N2JLCqFHApagApaACikAtFABRQAUtAEUswjHqfSqTMWYl
jkmqihjaKoQUlMLCUUDJYYWkbjp3NX441jXAFS2IfRUAFLQMKMUCDFFABijFABijFAwxSYoAvUVJ
YUUAFLQAUlABRmgAzRQAVHJIEHuegoAiPJ3SdfT0qCWYCtEiGynJIWPHSoicVQDSaSmAUtMQoFOx
ik2NCFvSm1IBUscJbk8CnsBZRAnSpMn1qNxC7vajI9KAP//XrYBpdh7c1AhMEUUAJS0AFFIBahmm
CDA5NMCmSScnrTasAopgJSUDCp4Yd43NwtDAseckY2qOBTTdHsBU2uIb9okPTH5Unnzeq/lRZD0F
+0S/7P5U5bs5wy/lS5UGhZVw4ypyKdUgFLQIKKACigApKANTMDdQRR5UR+7Jj61JoBtm/hZTTGhk
HVfyoC4wqR1B/KkxQAUUAFFIAopgRPJnhOT6+lQlguTnLetUkS2Vpp8dKqs5Y81oJDC1MpgwopgK
BTgKTYATikJJqRhSqhY8UxFmOEL15NS1LYhaKQC0UgClBoAcHPcA0ZU/w/lQAbVPc0bB/eFAC7B/
eFGz3FAFa4lCEopBb+VVCecnrVoBKKoBDSUDEooAlt0DyAH64qe5kwdo4AqXvYCtmnL1qmIkApdt
SAoWmSJgZpXGS2b8lT9at0nuIWkpAFLQAUlAwooEf//Z


--part112341-boundary-578476062-1602154594--
Title: Re: Email images to your gallery
Post by: radmofo on March 12, 2008, 04:28:59 am
Ok, so I see there is not much traffic here on this topic. I have been working on a solution and its nearly complete. So far I have had success in retrieving attachments from every Provider I've tested via MMS, email, Blackberry etc. It will check the storage folder for file names and add them incrementally. IE 1.jpg, 2.jpg etc. It will take the subject block and add it as the pictures title. The part I am still working on is the ability to have separate email accounts for each user so it uploads to that particular users album.

Does anyone know an easy way to use the anycontent.php or something similiar perform a different function depending on the logged in user?

Is there ANY interest in this hack?
Title: Re: Email images to your gallery
Post by: aveo on March 13, 2008, 03:01:28 am
I looked for a script to do what I want and this thread was the closest.

Can this mod be slightly modified to just send information to the index or other page.

Example:

Joke of the day next to the picture of the day.

I would like to be able to send the joke through email in the body of the email.

It seem like it would be a slight mod, but I cant figure it out.

If someone would like to talk to more in dept, please pm me. I am not opposed to compensating someone for their time.

My site www.want2see.com (http://www.want2see.com)

Thank you,
Tom
Title: Re: Email images to your gallery
Post by: rphMedia on April 13, 2008, 02:17:38 pm
I have [temporarily?] discontinued this feature at my test site because of the latest exploit.
Reinstated.
Title: Re: Email images to your gallery
Post by: fallenturtle on April 18, 2008, 12:34:34 am
Is there a setting or something in this mod or one that I can add that will let me filter the email attachments by extension. I ask because my provider (US T-Mobile) when I send an email with a photo via mms throws in a few of their own branding graphics, but their graphics are gifs where as my photo is a jpg, so I'm thinking that to avoid having it post the gifs I could filter them out.

Thanks.
Title: Re: Email images to your gallery
Post by: radmofo on April 18, 2008, 02:50:18 am
Sure...Its not fully complete as there is some stuff in there that don't need to be. it's a conglomeration of diffrent codes all smushed into 1.....along with a LOT of trial and error.

Things I have done.

1 allow filtering of images in the config file.

2 allow nearly infinite attachment size user settable max size.

3 max processing time user setting (if you get 100 messages emailed it can take a long time to load index.php)
solve this by running a cron job using lynx -dump

4 renames the files in order of them being sent in on the server EX. 1.jpg, 2.jpg 3.jpg ETC. but keeps the original filename in coppermine.

5 works with every carrier (I'm pretty sure)

6 puts the subject block as the pictures title.

7 puts the senders name in the title as well.

Things I still need to make it do...

1 Check the senders email against the users list and process it accordingly so it can be added by that user to that users album.

2 notify admin via email if it is an image from a non user email or was and added via cron as guest.

3 UH, a whole bunch more cool stuff.

just don't forget to add edit attachtoserverconfig.php accordingly and include it in your anycontent.php   (and remove the other one)

And I'm looking for people to perfect this hack......
Title: Re: Email images to your gallery
Post by: fallenturtle on April 18, 2008, 03:14:52 am
Awesome... are these files instead of the original files in email.zip from the first page of posts or is it to be used in combination with?
Title: Re: Email images to your gallery
Post by: radmofo on April 18, 2008, 03:24:35 am
instead of
Title: Re: Email images to your gallery
Post by: rphMedia on April 18, 2008, 09:19:00 am
instead of

It would probably be a better idea to start your own thread, instead of belittling/hijacking this one.
Title: Re: Email images to your gallery
Post by: radmofo on April 18, 2008, 03:07:39 pm
No belittling, intended. The files I uploaded do the same thing as your originals with refinements.  I simply named them something else to prevent utter confusion. (or cause it). As far as the basis for this functionality it works the same way.
If a MOD wants to move it to a new thread thats fine. Or just delete them, I was only trying to help.
Title: Re: Email images to your gallery
Post by: rphMedia on May 01, 2008, 01:34:59 pm
Understand, thanks.
Title: No emailed images to my gallery
Post by: jecepede on May 21, 2008, 12:06:02 am
Aloha !!!!


As so many of you I thought it would be very nice to be able to mail my piccies to the gallery.
Well my computer apparently has other plans...

I have an e-mail account set up for my gallery : ongein (AT) wabbit-wion DOT nl
And my gallery resides at : http://ongein.wabbit-wion.nl
I made an album in with visitors can upload (without approval) and vote named : Mailed-Stuff (album 45)
Which resides in the category : Things

Now the first thing that hits me as weird, when I run the newcam.php script from the browser I get :

Code: [Select]
Warning: imap_fetchstructure() [function.imap-fetchstructure]:
Bad message number in /home/www/ongein/htdocs/attachmentread.class.php on line 62

And the mail is gone from the account.

So I thought maybe my way of attaching files was incorrect so I tested it with sending a mail to the Muvipix gallery and it arrived.
It is the "Stupid Dad" pic, thank you for letting me (us) test...

Also, when I logout and browse as a Guest, I do not see an [UPLOAD] button in the Mailed-Stuff folder ?
Hey I tought I turned that on ?

I am completely at a loss ?
Could some one please push me in the right direction ???

I run CPG 1.4.18(Stable)


Thank you sooooooooooo much in advance....


Jessy


OH PS :

Here is my newcam.php
Quote
<?php
define('IN_COPPERMINE', true);
require('include/picmgmt.inc.php');
require_once("attachmentread.class.php");
$host="{imap.wabbit-wion.nl:143/imap4/novalidate-cert}"; // imap4host
$login="ongein (AT) wabbit-wion DOT nl"; //imap4 login
$password="nothingspecialhere"; //imap4 password
$filepath=$_SERVER["DOCUMENT_ROOT"]."/albums/pix/";  ; // attachement will save in same directory where scripts run, otherwise give abs path
$album="45"; // album id #
$folder = "pix/"; // foldername with a /
$jk=new readattachment(); // Creating instance of class####
$jk->getdata($host,$login,$password,$filepath,$album,$folder); // calling member function
?>

And my attachment.class.php
Quote
<?
                        ######################################

                        #Coded By Jijo Last Update Date[Jan/19/06]
                        #http://phpclasses.org

                        #####################################




                        ##########################################################


                        ###################### Class readattachment ###############
class readattachment
{
                function getdecodevalue($message,$coding)
                {
                if ($coding == 0)
                {
                   $message = imap_8bit($message);
                }
                elseif ($coding == 1)
                {
                  $message = imap_8bit($message);
                }
                elseif ($coding == 2)
                {
                   $message = imap_binary($message);
                }
                elseif ($coding == 3)
                {
           $message=imap_base64($message);
           }
                elseif ($coding == 4)
                {
                   $message = imap_qprint($message);
                }
                elseif ($coding == 5)
                {
                 $message = imap_base64($message);
                }
                return $message;
                }

                        function getdata($host,$login,$password,$filepath,$album,$folder)
                        {
                        $mbox = imap_open ($host,  $login, $password) or die("can't connect: " . imap_last_error());
                        $message = array();
                        $message["attachment"]["type"][0] = "text";
                        $message["attachment"]["type"][1] = "multipart";
                        $message["attachment"]["type"][2] = "message";
                        //$message["attachment"]["type"][3] = "application";
                        $message["attachment"]["type"][4] = "audio";
                        $message["attachment"]["type"][5] = "image";
                        $message["attachment"]["type"][6] = "video";
                        $message["attachment"]["type"][7] = "other";

                        for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++)
                        {
                        $structure = imap_fetchstructure($mbox, $jk , FT_UID);
                        $parts = $structure->parts;
                        $fpos=2;
                                        for($i = 1; $i < count($parts); $i++)
                                           {
                                                $message["pid"][$i] = ($i);
                                                $part = $parts[$i];

                                                if($part->disposition == "ATTACHMENT")
                                                        {
                                                $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype);
                                                        $message["subtype"][$i] = strtolower($part->subtype);
                                                        $ext=$part->subtype;
                                                        $params = $part->dparameters;
                                                        $filename=$part->dparameters[0]->value;

                                                                $mege="";
                                                                        $data="";
                                                                        $mege = imap_fetchbody($mbox,$jk,$fpos);
                                                                        $fp=fopen($filepath . $filename,w);
                                                                        $data=$this->getdecodevalue($mege,$part->type);

                                                                        fputs($fp,$data);
                                                                        fclose($fp);
                                                                        add_picture($album, $folder, $filename);
                                                                        $fpos+=1;

                                                        }

                                        }
                        imap_delete($mbox,$jk);
                        }
                        imap_expunge($mbox);
                        imap_close($mbox);
                        }
}
?>
Title: Re: Email images to your gallery
Post by: jecepede on May 25, 2008, 09:58:58 pm
Okie


I am very sorry to bother everyone...

Code: [Select]
$album="45"; // album id #
Didn't do the trick...
It should of been :

Code: [Select]
$album="54"; // album id #

CHEEEEEEEEEEEEEEEERS !


GREAT mod, works out-of-the-box :D



Jessy

Title: Re: Email images to your gallery
Post by: radmofo on June 04, 2008, 05:29:57 pm
Glad to hear you ironed it out! Good work.
Title: Re: Email images to your gallery
Post by: stuffradio on August 18, 2008, 02:00:27 am
I'm not using the script for coppermine, but I am using it for another gallery website thing... and I'm trying to figure out why it won't read alternative files with the content type "multipart/related".

Code: [Select]
<?php

            
######################################

            #Coded By Jijo Last Update Date[Jan/19/06]

            #####################################




            ##########################################################


            ###################### Class readattachment ###############
class Readattachment
{
 var 
$username;
 var 
$encrypted;
 var 
$pic;
 var 
$time;
 var 
$url;
 var 
$caption;
 var 
$tag;
 var 
$mes;

     function 
Readattachment()
     {
       
$this->CI=& get_instance();

     }
     
     function 
checkExists($username$password)
     {
       
$query $this->CI->db->get_where('project_users', array('username' => $username'password' => $password));
       if (
$query->num_rows() > 0)
       {
         return 
true;
       } else {
         return 
false;
         exit;
       }
     }


     function 
checkAndUpload($arg$pic)
     {

preg_match("#username: ([a-zA-Z0-9]+)#i",$arg,$username);
$username $username[1];
preg_match("#password: ([a-zA-Z0-9]+)#i",$arg,$password);
$password $password[1];
preg_match("#caption: ([a-zA-Z0-9]+)#i",$arg,$caption);
$caption 'Default';
$encrypted md5($password);
$this->checkExists($username$encrypted);
$this->uploadData($username$encrypted$pictime(), ''$caption'nsfw');
     }


        function 
getdecodevalue($message,$coding)
        {
        if (
$coding == 0)
        {
           
$message imap_8bit($message);
        }
        elseif (
$coding == 1)
        {
          
$message imap_8bit($message);
        }
        elseif (
$coding == 2)
        {
           
$message imap_binary($message);
        }
        elseif (
$coding == 3)
        {
       
$message=imap_base64($message);
       }
        elseif (
$coding == 4)
        {
           
$message imap_qprint($message);
        }
        elseif (
$coding == 5)
        {
         
$message imap_base64($message);
        }
        return 
$message;
        }

            function 
getdata($host,$login,$password,$savedirpath)
            {
 
$mbox imap_open ($host,  $login$password) or die("can't connect: " imap_last_error());
         
$message = array();
         
$message["attachment"]["type"][0] = "text";
         
$message["attachment"]["type"][1] = "multipart";
         
$message["attachment"]["type"][2] = "message";
         
//$message["attachment"]["type"][3] = "application";
         //$message["attachment"]["type"][4] = "audio";
         
$message["attachment"]["type"][5] = "image";
         
//$message["attachment"]["type"][6] = "video";
         
$message["attachment"]["type"][7] = "other";
         
         for (
$jk 1$jk <= imap_num_msg($mbox); $jk++)
         {
        
$headerinfo imap_header($mbox$jk);

        
$subject $headerinfo->Subject;
                        
$matches = array();
                        if (
preg_match('/^=\?[^?]*\?B\?(.*)\?=/m'$subject$matches))
                                
$subject base64_decode($matches[1]);

         
$structure imap_fetchstructure($mbox$jk FT_UID);   
         
$parts $structure->parts;
         
$fpos=1;
    for(
$i 0$i count($parts); $i++)
{
                  
$message["pid"][$i] = ($i);
                  
$part $parts[$i];
if (
$part->type == 0) {
        
$fpos+=1;
        continue;
    }


                  if(
TRUE)
                     {
                      
                      
$message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" strtolower($part->subtype);
                     
$message["subtype"][$i] = strtolower($part->subtype);
                     
$ext=$part->subtype;
                if (
$part->ifdparameters)
                  foreach(
$part->dparameters as $dparam)
                    if (
strtolower($dparam->attribute) == 'filename'$filename $dparam->value;
                if (empty(
$filename))
                  if (
$part->ifparameters)
                    foreach(
$part->parameters as $param)
                      if (
strtolower($param->attribute) == 'name'$filename $param->value;

if (empty(
$filename) && $part->ifid)
        
$filename trim($part->id'<>');


     if (empty(
$filename)) $filename 'nfn' rand() . '.' strtolower($part->subtype);



                               
$mege="";
                               
$data="";
                               
$mege imap_fetchbody($mbox,$jk,$fpos);
                               
$body imap_body($mbox$jk);

                           
$fp=fopen($savedirpath $filename,w);
                           
$data=$this->getdecodevalue($mege,$part->type);
                           
fputs($fp,$data);
                           
fclose($fp);
                           
$this->checkAndUpload($body$filename);
                           
$fpos+=1;



                     }

               }
         
imap_delete($mbox,$jk);
         }
         
imap_expunge($mbox);
         
imap_close($mbox);
         }

         
           function 
uploadData($username$encrypted$pic$time$url$caption$tag)
            {
        
$this->CI->db->insert('pb_photos', array('time' => time(), 'pic' => $pic'url' => base_url() . 'system/application/views/uploads/''caption' => $caption'poster' => $username'tag' => $tag));

            }


            }
?>

I commented out a couple attachment types because I only want images to be uploaded. If you see any easy solution to this, please let me know. It downloads the attachment from the multipart/related, but saves as something like nfn242525.alternative. So the folder path isn't what's wrong here... it's the saving part that is wrong.
Title: Re: Email images to your gallery
Post by: rphMedia on August 30, 2008, 10:04:19 pm
I am no longer supporting this mod/hack. I've removed the email address as some people still want to send humongous images to try to take my test gallery down. It's pretty senseless because once I see that the image is larger than most monitor resolutions ( don't know what they're thinking sending 4000px X 3000px rez images ??? ), the email was immediately deleted and subsequently the image never made it to the album.

Well, no more extra work managing the email account.

You may lock this thread, guys.
Title: Re: Email images to your gallery
Post by: Joachim Müller on August 31, 2008, 10:33:21 am
It's sad to see this nice little mod go down because of jerks misbehaving, but I guess this is how the internet works. So I'm locking this thread as per suggestion. To everyone else: rphMedia said the mod will go unsupported, so there is no point in starting another thread asking for support on this mod. "Unsupported" means exactly what the word says: no support at all.