phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Phpgroupware-developers] Sending email with attachments


From: Don Graver (dgraver)
Subject: RE: [Phpgroupware-developers] Sending email with attachments
Date: Fri, 26 Sep 2003 15:05:57 +0100

I do not use the email app, but I am quite certain it is not the mail
server I use, since I can use other email clients and send very large
files.  I am not using apache2, so I don't think that is the problem.
Since I am able to get the larger attachments sent when changing the
php.ini memory and max timeout...it leads me to believe that it is phpgw
and not my server.  

Just for debugging purposes, I noticed that when sending the 1MB file it
went through the 'do' loop 17,151 times!!!  I'm pretty sure that is why
things are timing out or using to much memory.  

P.s. just a quick look at the email app, and I see that it does not seem
to use the same 'send' class as the calendar app.

-- Don 


-----Original Message-----
From: Brian Johnson [mailto:address@hidden 
Sent: Friday, September 26, 2003 3:52 PM
To: Don Graver (dgraver)
Subject: Re: [Phpgroupware-developers] Re: [Phpgroupware-users] Sending
email with attachments


please confirm that you can send larger attachments with the regular
email app

That way we can narrow down whether it's a phpgw issue or your server
config

With apache2 php.conf (not just php.ini) needs to be configured to allow
larger uploads



Don Graver (address@hidden) wrote:
>
>I am sending this to the developers b/c I think you are more able to 
>help with the following technical issue.
>
>I have run into a problem with sending emails that have large 
>attachments (about 1MB+) using the class 'send'.  I am currently able 
>to add attachments to an event (see below for previous discussion from 
>phpgroupware-users), but when files get to the size of around 1MB, I 
>either timeout or memory is exceeded.  I have upped the memory in 
>php.ini to 20MB, with a timeout of 300seconds and things work fine. 
>However, with only 100 seconds it timesout.  I have tracked down the 
>problem to the following function in /phpgwapi/inc/class.send.inc.php:
>
>    function put2socket($socket,$message)
>
>It hangs in the 'do' loop b/c the file is so large.  To give you an 
>idea of what the $message contains: it has the standard event 
>notification message, along with the appropriate Mime headers, and the 
>attached file encoded using the following: 
>chunk_split(base64_encode($file).  I know my code is working b/c of 
>being able to send multiple smaller attachments, as well as being able 
>to send the larger ones by editing the php.ini file.  However, I don't 
>think I should have to edit the php.ini file to send a file that is 
>only 1MB.  Any thoughts of how the function can be optimized or how I 
>may be able to change something?
>
>I am using the following:
>phpGW: 0.9.14.508
>php: 4.2.3
>apache: Apache/1.3.27 (Unix) Debian GNU/Linux
>
>Thanks for the help.
>
>Don
>
>
>
>
>Don Graver (dgraver) wrote:
>
>>To answer my own question:
>>
>>Apparantely the msg function in the phpgwapi/inc/class.send.inc.php 
>>file accepts a mime 'boundary' variable, which can be used to separate

>>the text of the message from the attachments.  So, what I have done is

>>separate the attachments with a  mime boundary and the correct 
>>headers, then attach that to the end of the body message, and send the

>>new message body along with the mime boundary to the send 
>>class.....and Wahoo!, it works.
>>
>>Thanks for the help.
>>
>>Ps. I am not using the email app other than to be able to send 
>>emails...no user has rights to that app so storing it to the Sent 
>>folder is not necessary.  However, the emails are not only sent to 
>>registered users, but to extra participants as well...something else I

>>have added to the calendar.
>>
>>-- Don Graver
>>
>>
>>-----Original Message-----
>>From: Dave Hall [mailto:address@hidden
>>Sent: Wednesday, September 24, 2003 12:11 PM
>>To: address@hidden
>>Subject: Re: [Phpgroupware-users] Sending email with attachments
>>
>>
>>"Don Graver (dgraver)" <address@hidden> wrote:
>>
>>
>>
>>>I would like to send an email with attachments via the class 'send'. 
>>>More specifically, I would like for a user to be able to add files to

>>>a Calendar event, then when the notification email is sent to all 
>>>participants, the files are attached.  I have no problem adding the 
>>>newfield to the calendar app, I am just unsure how to create all the 
>>>necessary MIME headers and boundaries and use them in the send class.

>>>Has anyone else tried something similar?
>>>
>>>
>>>
>>
>>class.send.inc.php is a little broken atm.  It is on the to be fixed 
>>for 16-final list :)
>>
>>I think what you want to do is a good idea, but could be problematic 
>>also.
>>
>>Are you planning on emailing the attachments to phpgw users only?  If 
>>you are the VFS is a better choice.  Just to include a link to the 
>>file in the VFS.
>>
>>I hope in head (which will become 18 one day) that we can support 
>>saving attachments in the VFS and also direct import of v/iCals into 
>>calendar from attachments.
>>
>>Just some ideas, sorry I don't have the answers.
>>
>>Cheers
>>
>>Dave
>>
>>
>>_______________________________________________
>>Phpgroupware-users mailing list
>>address@hidden 
>>http://mail.gnu.org/mailman/listinfo/phpgroupware-users
>>
>>
>
>
>
>_______________________________________________
>Phpgroupware-developers mailing list address@hidden
>http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
>

--
Brian Johnson
* This is where my witty signature line would be if I bothered to edit
this line :) *






reply via email to

[Prev in Thread] Current Thread [Next in Thread]