Commit graph

190 commits

Author SHA1 Message Date
tokul
dca19f1eda aStutus -> aStatus 2004-05-20 09:46:07 +00:00
stekkel
f510138349 * Request UID and UIDVALIDITY from the status response if not available in the
select response.
* Tried to fix the broken del move next function and added a few arguments
  to the dmn_expunge function because the globals scared me when I couldn't
  get the job done.
2004-05-19 22:36:41 +00:00
stekkel
f630a0daf1 second try .. 2004-05-14 19:12:53 +00:00
stekkel
1069293bcd Detect untagged BYE responses in case the connection is terminated. 2004-05-14 18:37:40 +00:00
stekkel
5d2e086e5a Fixed on the fly decoding of base64 attachment. We need to do on the fly
decoding because otherwise we have to buffer entire attachments in memory
which will cause out of memory errors with large attachments.

The fix has to do with the grouping of bytes in pairs of 4 which represents
24 bits of data. If such group is splitted over 2 lines then on the fly
decoding went wrong. Now we count the pure base64 data (without \r\n, \r \n
and spaces), divide it by 4 and return incomplete pairs which get processed
the in the next loop.
2004-05-02 13:49:14 +00:00
stekkel
1b45d3c991 reminder for people that want to use the capability string. It's broken in
certain cases.
2004-04-22 18:20:38 +00:00
tokul
17c56f73ed two more subpackage blocks 2004-04-12 08:03:39 +00:00
Erin Schnabel
c83dcc0345 remove perlishly commented debug lines. my bad. 2004-03-29 16:58:20 +00:00
Erin Schnabel
c072809def finish "buttonizing" read_body header.
Correct some mistakes (compose_in_new, resume draft, edit as new)
Centralize javascript detection in prefs.php - checkForJavascript
Move javascript_on from prefs to session - have just javascript_setting in prefs.
2004-03-28 20:45:20 +00:00
Thijs Kinkhorst
28eadb73d0 Move $sqimap_session_id from global to static scope. 2004-03-15 19:57:20 +00:00
tassium
efc02d8258 Brain-damage in sqimap_create_stream(). Can't believe I let myself commit this function in such poor shape, and further that nobody else caught it until now ;)
sqimap_create_stream() was not as generalized as it should have been - it was still using $imap_server and $use_imap_tls, etc.  Now obeying passed params as it should.
2004-02-26 16:19:29 +00:00
Thijs Kinkhorst
cde0377d36 We're living in 2004 now... perl is your friend for these kinds of things :) 2004-02-24 15:51:22 +00:00
alex-brainstorm
73a4cc6748 Add an optional link parameter to sqimap_error_box(), allow self error handling even when connection is dropped, and remove the notices that happen in that case. 2003-11-09 17:50:54 +00:00
stekkel
1d79c4e994 The SASL intial response capability name is changed in
draft-siemborski-imap-sasl-initial-response-01b.txt to SASL-IR (imho a
better name). Currently Cyrus 2.2.2-BETA advertise SASL-IR and the next UW
release will do that too.
2003-10-30 01:18:52 +00:00
Thijs Kinkhorst
336662934c Add some basic documentation, and remove some long-obsolete functions. 2003-10-29 19:58:06 +00:00
tassium
9098cb73e4 Preparation to begin using phpdocumentor.
Added basic @package/@subpackage tags
The decode/ files were documented slightly more thoroughly, although they're almost self-explanatory anyway.

The individual functions in the functions/ files need to be documented though, and now that this commit is in, anyone willing to write docblocks for functions should get cracking ;)
2003-10-28 21:27:47 +00:00
stekkel
bbe8c907cc Today Cyrus 2.2.2-BETA with SASL Initial Client response was released so it
was a good moment to implement the SASL imap extension.
See also <draft-siemborski-imap-sasl-initial-response-00.txt>

NB: The code is untested and I like to know if it works. Volunteers to test
(Rob Siemborski maybe) ?
2003-10-28 21:13:28 +00:00
tassium
a6424e15e8 New function: sqimap_create_stream(). Returns an IMAP stream.
Cleaned up sqimap_login() to make use of new function, and fixed some of the poor code formatting I did before.
2003-10-22 21:51:25 +00:00
stekkel
a5081fdc11 Rewrote sqimap_fread to make it work on PHP 4.3.2.
The fread behaviour was changed with as result that fread didn't return
when the requested buffersize was full but at a earlier stage, at the end of
a tcp packet.
From now on fread stops on: EOF, full buffer and in case of sockets at end
of packet if the imap server isn't providing the requested data quick
enough.
2003-09-24 20:53:06 +00:00
tassium
160ebd3c07 By request, SASL PLAIN for IMAP and SMTP.
I did not add detection to conf.pl, perhaps later..
2003-09-23 18:06:12 +00:00
tassium
f4265d8463 Fix to prevent query containing username and password from being displayed if imap connection fails during login. Similar code committed to stable as well. 2003-08-11 17:11:14 +00:00
alex-brainstorm
75e1fc46ca Fix autodetect-delimiter-no-namespace code for devel sqimap_read_data(). Was breaking Mercury/32. 2003-07-27 00:32:34 +00:00
stekkel
e375cf726b Due to changed behaviour of fread (see php bug 24033) we cannot use large
buffersizes anymore because we cannot trust fread if the requested buffer is
actually returned.
blocking socket connections do not work anymore like they supposed to work
:(
2003-07-24 21:23:18 +00:00
alex-brainstorm
ae6e881c88 Extracted error_box() calling code into sqimap_error_box() for unified imap error display 2003-07-24 18:49:28 +00:00
stekkel
b3c5fc5794 Correct on the fly base64 decode algoritm in case the returned data does not
have "proper" lines with the same length. With an old uw server I discovered
that lines were split in the middle by \n. This fix will correct it.

The rfc about base64 decoding does not mention anything about line length.
rfc2045 does mention that lines should not be longer then 78 characters but
does not say all the lines (excluding the last of course) must be of the same
size.
There for i could not ignore it and fixed it.
2003-07-24 18:08:10 +00:00
alex-brainstorm
fc8568eca0 Fix more literal mailbox names 2003-07-23 03:02:08 +00:00
stekkel
c696c38d79 Typo:
I didn't mean that large people called chuck are slow
2003-07-03 18:10:56 +00:00
stekkel
b0521febb8 Finally nailed down the exchange problem. It was caused by a very stupid
mistake from me. I didn't ended the query with \r\n but ended it with \n. I
should have known better.
An interesting discovery was that setting the number of queries to process
at once influence performance. A higher number doesn't mean more performance.
In our tests 128 was slower then 32 (on Exchange 2000).
2003-07-03 16:18:51 +00:00
stekkel
dfe15394f6 Hopefully fixed pipelined responses, I did something stupid and didn't test
out of order reponses. Now it works.
In imap_mailbox te array with mailbox objects wasn't create correctly. It
contained double entries. That's fixed too.
2003-07-03 11:45:02 +00:00
stekkel
cf4ee7583d renamed sqimap_read_data_list => sqimap_retrieve_imap_response and created a
new function sqimap_read_data_list which will inform plugins that they
should call other functions.
2003-07-02 20:55:04 +00:00
stekkel
2aba346acf Modified pipelined request function by splitting up the the provided queries
in parts. Now we do a request for 32 queries and retrieve the response
before we continue with the next 32 queries.

The number 32 is experimental and should be tested on Exchange 2000 because
that was the imap-server which drops the connection with 100 calls at once.
Maybe we should lower it or raise it.
2003-07-02 20:24:11 +00:00
stekkel
9aa54202de return the result in case of pipelined responses 2003-06-29 10:51:31 +00:00
stekkel
37f4b81ceb fixed warning 2003-06-28 21:44:28 +00:00
stekkel
00d80d1d78 handle escaped quotes again 2003-06-28 15:34:00 +00:00
stekkel
12e70193dc Downloading attachments is fixed. Now we do not buffer the entire attachment
before echo it to stdout. with fread we detect how long the base64 encoded
liones are so we can do base64 decoding on the fly.
The advantage of using fread instead of fgets is that the buffersize can be
used so we reduce the number of echo calls (fread doesn't stop at \n).
2003-06-28 13:36:41 +00:00
stekkel
bc6e1e9fe9 Ahhh, this doesn't work when the buffer is smaller then the size of the
attachment. Can somebody fix this?
2003-06-18 22:11:09 +00:00
stekkel
5a36559d1b DO NOT buffer base64 encoded attachments before we decode them. Instead
decode them directly after we retrieved the data from the imapserver and
echo te result. This will safe a lot of memmory usage :)
2003-06-18 18:39:12 +00:00
stekkel
f11cb00d14 because we remove the quotes an empty string could be left => check if the
string is empty before we add it to the token array
2003-06-17 21:21:57 +00:00
stekkel
e990133084 fixes parseAddress. I think this thing is working brilliant :) 2003-06-17 17:17:17 +00:00
stekkel
596f4e8e2e Rewritten addressparser
Should solve infinite loops and hopefully it's also quicker.
2003-06-17 00:27:58 +00:00
stekkel
cea04e81b1 in case of BYE response display errormessage 2003-06-13 15:30:28 +00:00
stekkel
7a8f5cdf94 Another failsafe check which I missed. Thnx Erin. 2003-06-12 14:17:10 +00:00
stekkel
00da36c274 better error processing, immediate break out of the while loop in case of an
error.
2003-06-12 09:42:10 +00:00
Erin Schnabel
adbde2554f align cases so they're easier to find..
{} and comments for the bigger blocks
2003-06-11 20:41:39 +00:00
stekkel
430d013987 fixed formatting, sjeesh that's realy dull work. Makes me simple :(
The only exiting part was working with VIM for the first time. And I still
thing it's not the most user friendly editor unless you know all keycodes
which I don't know.
2003-06-11 19:53:22 +00:00
stekkel
9287970385 extra safetycheck before we process group addresses 2003-06-11 17:54:12 +00:00
stekkel
28a9dd7eb8 Rewrite of sqimap_read_data_list. This will raise performance and it's more
accurate.
2003-06-11 17:16:29 +00:00
Thijs Kinkhorst
5136084e4e Prevent loop in parseAddress: if the address is invalid and looks like:
Thijs <aap
(no closing ">"), parseAddress would enter an infinite loop. This is
solved by increasing $pos when no closing > is found. Closes 742584,
thanks Jeroen van Wolffelaar.
2003-05-25 18:58:15 +00:00
stekkel
00cbd8dac8 Minor fixes in parseAddress and limit the returned results to 1 address
(performance) in case we are displaying the sent folder
2003-05-23 11:51:05 +00:00
stekkel
fb9dea3eb1 fix for addresses containing groups 2003-04-25 17:35:24 +00:00