PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links 
search for in the  
previousread_exif_dataimap_8bitnext
Last updated: Tue, 03 Sep 2002
view the printer friendly version or the printer friendly version with notes or change language to English | Brazilian Portuguese | Chinese | Czech | Dutch | Finnish | French | German | Hungarian | Japanese | Korean | Polish | Romanian | Russian | Spanish | Swedish | Turkish

XLII. IMAP, POP3 and NNTP functions

Introduzione

These functions are not limited to the IMAP protocol, despite their name. The underlying c-client library also supports NNTP, POP3 and local mailbox access methods.

Requisiti

This extension requires the c-client library to be installed. Grab the latest version from and compile it.

Istallazione

To get these functions to work, you have to compile PHP with --with-imap.

Then copy c-client/c-client.a to /usr/local/lib/libc-client.a or some other directory on your link path and copy c-client/c-client.h, c-client/imap4r1.h, c-client/rfc-882.h, c-client/mail.h and c-client/linkage.h to /usr/local/include or some other directory in your include path.

Nota: Depending how the c-client was configured, you might also need to add --with-imap-ssl=/path/to/openssl/ and/or --with-kerberos into the PHP configure line.

Configurazione Runtime

Questa estensione non definisce alcuna direttiva di configurazione

Resource Type

Costanti Predefinite

Queste costanti sono definite da questa estensione e sono disponibili solo se l'estensione � stata compilata nel PHP o se � stata caricata dinamicamente a runtime.

NIL (integer)

OP_DEBUG (integer)

OP_READONLY (integer)

OP_ANONYMOUS (integer)

OP_SHORTCACHE (integer)

OP_SILENT (integer)

OP_PROTOTYPE (integer)

OP_HALFOPEN (integer)

OP_EXPUNGE (integer)

OP_SECURE (integer)

CL_EXPUNGE (integer)

FT_UID (integer)

FT_PEEK (integer)

FT_NOT (integer)

FT_INTERNAL (integer)

FT_PREFETCHTEXT (integer)

ST_UID (integer)

ST_SILENT (integer)

ST_SET (integer)

CP_UID (integer)

CP_MOVE (integer)

SE_UID (integer)

SE_FREE (integer)

SE_NOPREFETCH (integer)

SO_FREE (integer)

SO_NOSERVER (integer)

SA_MESSAGES (integer)

SA_RECENT (integer)

SA_UNSEEN (integer)

SA_UIDNEXT (integer)

SA_UIDVALIDITY (integer)

SA_ALL (integer)

LATT_NOINFERIORS (integer)

LATT_NOSELECT (integer)

LATT_MARKED (integer)

LATT_UNMARKED (integer)

SORTDATE (integer)

SORTARRIVAL (integer)

SORTFROM (integer)

SORTSUBJECT (integer)

SORTTO (integer)

SORTCC (integer)

SORTSIZE (integer)

TYPETEXT (integer)

TYPEMULTIPART (integer)

TYPEMESSAGE (integer)

TYPEAPPLICATION (integer)

TYPEAUDIO (integer)

TYPEIMAGE (integer)

TYPEVIDEO (integer)

TYPEOTHER (integer)

ENC7BIT (integer)

ENC8BIT (integer)

ENCBINARY (integer)

ENCBASE64 (integer)

ENCQUOTEDPRINTABLE (integer)

ENCOTHER (integer)

Vedere Anche

This document can't go into detail on all the topics touched by the provided functions. Further information is provided by the documentation of the c-client library source (docs/internal.txt). and the following RFC documents:

  • : Simple Mail Transfer Protocol (SMTP).

  • : Standard for ARPA internet text messages.

  • : Internet Message Access Protocol (IMAP) Version 4rev1.

  • : Post Office Protocol Version 3 (POP3).

  • : Network News Transfer Protocol (NNTP).

  • : Common Internet Message Headers.

  • , , , & : Multipurpose Internet Mail Extensions (MIME).

A detailed overview is also available in the books by David Wood and by Dianna Mullet & Kevin Mullet.

Attenzione

Crashes and startup problems of PHP may be encountered when loading this extension in conjunction with the recode extension. See the recode extension for more information.

Sommario
imap_8bit --  Convert an 8bit string to a quoted-printable string
imap_alerts --  This function returns all IMAP alert messages (if any) that have occurred during this page request or since the alert stack was reset
imap_append --  Append a string message to a specified mailbox
imap_base64 -- Decode BASE64 encoded text
imap_binary --  Convert an 8bit string to a base64 string
imap_body -- Read the message body
imap_bodystruct --  Read the structure of a specified body section of a specific message
imap_check -- Check current mailbox
imap_clearflag_full -- Clears flags on messages
imap_close -- Close an IMAP stream
imap_createmailbox -- Create a new mailbox
imap_delete --  Mark a messge for deletion from current mailbox
imap_deletemailbox -- Delete a mailbox
imap_errors --  This function returns all of the IMAP errors (if any) that have occurred during this page request or since the error stack was reset.
imap_expunge -- Delete all messages marked for deletion
imap_fetch_overview --  Read an overview of the information in the headers of the given message
imap_fetchbody --  Fetch a particular section of the body of the message
imap_fetchheader -- Returns header for a message
imap_fetchstructure --  Read the structure of a particular message
imap_get_quota --  Retrieve the quota level settings, and usage statics per mailbox
imap_get_quotaroot --  Retrieve the quota settings per user
imap_getmailboxes --  Read the list of mailboxes, returning detailed information on each one
imap_getsubscribed -- List all the subscribed mailboxes
imap_header -- Read the header of the message
imap_headerinfo -- Read the header of the message
imap_headers --  Returns headers for all messages in a mailbox
imap_last_error --  This function returns the last IMAP error (if any) that occurred during this page request
imap_listmailbox -- Read the list of mailboxes
imap_listsubscribed -- List all the subscribed mailboxes
imap_mail_compose --  Create a MIME message based on given envelope and body sections
imap_mail_copy -- Copy specified messages to a mailbox
imap_mail_move -- Move specified messages to a mailbox
imap_mail --  Send an email message
imap_mailboxmsginfo -- Get information about the current mailbox
imap_mime_header_decode -- Decode MIME header elements
imap_msgno --  This function returns the message sequence number for the given UID
imap_num_msg --  Gives the number of messages in the current mailbox
imap_num_recent -- Gives the number of recent messages in current mailbox
imap_open -- Open an IMAP stream to a mailbox
imap_ping -- Check if the IMAP stream is still active
imap_qprint -- Convert a quoted-printable string to an 8 bit string
imap_renamemailbox -- Rename an old mailbox to new mailbox
imap_reopen -- Reopen IMAP stream to new mailbox
imap_rfc822_parse_adrlist -- Parses an address string
imap_rfc822_parse_headers -- Parse mail headers from a string
imap_rfc822_write_address --  Returns a properly formatted email address given the mailbox, host, and personal info.
imap_scanmailbox --  Read the list of mailboxes, takes a string to search for in the text of the mailbox
imap_search --  This function returns an array of messages matching the given search criteria
imap_set_quota -- Sets a quota for a given mailbox
imap_setacl --  Sets the ACL for a giving mailbox
imap_setflag_full -- Sets flags on messages
imap_sort -- Sort an array of message headers
imap_status --  This function returns status information on a mailbox other than the current one
imap_subscribe -- Subscribe to a mailbox
imap_thread --  Return threaded by REFERENCES tree
imap_uid --  This function returns the UID for the given message sequence number
imap_undelete --  Unmark the message which is marked deleted
imap_unsubscribe -- Unsubscribe from a mailbox
imap_utf7_decode --  Decodes a modified UTF-7 encoded string.
imap_utf7_encode --  Converts 8bit data to modified UTF-7 text.
imap_utf8 --  Converts text to UTF8
User Contributed Notes
IMAP, POP3 and NNTP functions
add a note about notes
[email protected]
29-Mar-1999 03:37

The documentation on objects is sketchy for those of us (me) who don't do OOP. I searched for info on how to access parts of an object (properties) for a long time before finding the only e.g. in the manual, and it is not obvious what to do to actually implement these in code. I realize it isn't tough to figure out once you get started, but it is a black box without that tiny little hint which is not well presented. I also don't see anything about the bit masks for the flags nor anything about the flags themselves.
[email protected]
06-Sep-1999 03:44

In order to get the IMAP functions to compile under apache (1.3.6) on FreeBSD (3.2-R) and IMAP-4.6-BETA I had to unlink libc-client4.so from libc-client4.so.5 and then link libc-client4.so to c-client.a. Hope this is of use to anyone else in the future.
[email protected]
19-Sep-1999 01:19

The information at the top of this page IS A LIE.
If you want the IMAP functions then DO NOT
copy c-client.a into (for example) /usr/local/lib.
Instead, copy it to some appropriate directory in
your link path, but give it the new name:

libc-client4.a

It has GOT to have that name or else you will get
really weird *configure-time* failures when doing
the second configure step on Apache.

Also, if you are on a FreeBSD 3.1 system, look
around and see if you already had files installed
whose names are:

/usr/local/lib/libc-client4.so
/usr/local/lib/libc-client4.so.4

If you have these then DELETE THEM before you start the second configure step on Apache or
else things will go very wrong. Don't ask me why.
I don't know. I just know that they don't work and
they must not be in your link path or else you won't even be able to do the second Apache configure step.

[email protected]
21-Sep-1999 09:46

I've written <a href=">instructions for installing IMAP support on Red Hat</a> (amongst other things) that might help you get started.
[email protected]
14-Nov-1999 12:27

Some of the functions return Objects when in the docs it says Array.
echo the var to see it's type
to access an object member use ->
<PRE>
&lt;?php
$mbox = imap_open("{localhost:143}INBOX", "username", "password");
if ($hdr = imap_check($mbox)) {
echo "Num Messages " . $hdr->Nmsgs;
}
else {
echo "failed";
}
?>
</pre>

[email protected]
03-Dec-1999 09:18

I had all kinds of problems compiling and installing the latest version of imap (4.7). So, i went and got imap-4.4.tar.Z to see if maybe it was a version problem. 4.4 installed just fine. But you have to rename c-client.a to libc-client4.a like [email protected] said above.
[email protected]
29-Dec-1999 08:22

I banged my head for hours getting configure-time errors when doing a ./configure in the apache directory after configuring PHP with IMAP support. I had followed the instructions above. In the end, I had to delete the file "/usr/lib/libimap.so" in order to get it to compile okay. This was on Red Hat 6.1 with the 4.6-3 imap RPMs installed.

Just in case that helps somebody.

[email protected]
25-Jan-2000 08:27

To paraphrase Mark Musone:

The base you need to properly understand the php IMAP
functions is to know the c-client library, since the IMAP
module is just a port of the c-client library.

Start by looking at the internals.txt file in the doc directory of
c-client.

(Presumably this c-client/doc directory is in the IMAP directory, not the PHP source itself... If I'm following Mark correctly.)

[email protected]
30-Mar-2000 07:58

How can I retrieve the messages flags?
I try all the IMAP functions such as imap_fetch_structure, imap_fetch_overview, but i can't have the informations I need.
Maybe there is a BUG with these functions.
By the way why is the following functions undocumented? imap_fetch_overview, imap_mail_compose, imap_popen.

[email protected]
03-Apr-2000 05:20

Note to RedHat users:

To get php imap support with redhat's shipped IMAP rpm, do the following.

1) Install both the imap and imap-devel rpm's

2) As mentioned above, copy /usr/lib/c-client.a to /usr/lib/libc-client.a and the three headers (mail.h, linkage.h, and rfc822.h from /usr/include/imap to /usr/include

3) Important! Before configuring PHP, you'll need to set a few environmental variables. With bash, do:

export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam"

or c shell:

setenv LDFLAGS "-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam"

Now configure php --with-imap and other options and all should work well.

[email protected]
28-Jul-2000 02:13

As stated above, "The underlying c-client library.... and local mailbox access methods". How might one open a stream to a local mail file such as /var/spool/mail/$USER ??


[email protected]: by using the filename as $mbox parameter

[email protected]
27-Feb-2001 12:28

I found that just adding the LDFlags to the PHP configure does not do the job on a RedHat 7 System with User Compiled Apache /PHP but RPM imap.

what I did is following:

php config script :

export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam"
./configure --with-mysql=/usr/local --with-apxs=/usr/local/apache/bin/apxs --with-imap --includedir=/usr --with-openssl=/root/server/openssl-0.9.6


then the APACHE Config script:
export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam"
./configure with the rest of the apache options

Now it Finaly works for me..

[email protected]
08-Apr-2001 12:36

Tried compiling PHP4 (latest @ 08:45 07 Apr 01) with IMAP and with Apache 1.3.19, on a RedHat (6.2) system.
Once IMAP is compiled, and you've exported the LDFLAGS (above), run ldconfig before compiling PHP & Apache, then and only then it worked.

Regards,
paule.

[email protected]
04-May-2001 02:57

To activate quota support from the IMAP library, it is necessary to specify the directory for the files c-client.a and *.h, because the above mentioned header files are not enough for a successful compilation. e.g. ./configure --with-imap=../imap-2000c
[email protected]
25-May-2001 12:17

If you want to get PHP 4.0.5 to work with IMAP and Sybase, you may have to rename some of the imap functions in the library source code, because they conflict with functions of the same name in Sybase.
Search for everything starting with tcp_ and replace it by e.g. cc_tcp_. Otherwise, the imap_open function won't be able to connect.

25-May-2001 07:43
The IMAP Client API does not login to Cyrus POP3 Servers correctly, Only getting the capablities of the Cyrus server ie:

C:CAPA
S:+OK List of capabilities follows
S:STLS
S:EXPIRE 2
S:LOGIN-DELAY 0
S:TOP
S:UIDL
S:PIPELINING
S:RESP-CODES
S:USER
S:IMPLEMENTATION Cyrus POP3 server v2.0.13
S:.

Instead of somthing like this:
C:CAPA
S: ****
C:USER aaa
S: ****
C:PASS aaa
S: ****
C:LIST aaa
S: ****
C:QUIT aaa
S: ****

This is strange since it works for other pop3 servers

[email protected]
12-Jun-2001 10:29

for install imap for php4 pls refer

the install instruction as:
under php-x.x.x directory:
./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext

mv php /your.httpd/cgi-bin
add:
AddType application/php4script .php
Action application/php4script /cgi-bin/php
to your httpd.conf
then restart httpd

[email protected]
14-Jun-2001 07:57

I have RedHat 7.1 with imap-2000-9 and imap-devel-2000-9 rpms installed and I tried to install php with imap support following some advices posted in this list but I could't get it works.
What I did to get it works was:
In the php configure script I put this options:
./configure --with-apache=../apache_1.3.20 --with-imap --with-ssl=../openssl-0.9.6a --with-kerberos

After executing the apache configure script I put this options in the src/Makefile inmmediatly after lmodphp4:
-lc-client -lssl

And now It works!!!

[email protected]
26-Jun-2001 08:20

I've just upgraded from PHP 4.0.5 to 4.0.6 compiled with IMAP support. With all versions up to 4.0.5 I have been able to keep with the old UW IMAP 4-4 client libraries, but the IMAP changes in 4.0.6 appear to require the IMAP 2000 series client. Upgrading to IMAP-2000c worked fine for me. Hope this helps someone!
[email protected]
19-Jul-2001 03:17

If you are having problems with "segmentation fault (core dumped)" errors when using the imap functions, probably you are using the qpopper pop server. The qpopper aparently sends a invalid return message when opening a conection with imap_open() function. Try to substitute the qpopper with another server like tpop or imap instead.
[email protected]
27-Aug-2001 03:30

Various functions including imap_headerinfo() and imap_rfc822_parse_adrlist() were buggy because I had downloaded the very latest version of c-client.

Look carefully at and you'll find an "old" directory containing previous versions.

imap-2000c.tar.Z worked much better for me; build it and then recompile php by including --with-imap=../imap-2000c in your configure args.

[email protected]
06-Sep-2001 04:33

Yes! Using the imap 2000c plus php 4.0.6 version works!
No need to do that export and ldconfig thing.
(Tried it under Mandrake 7.2)

[email protected]
10-Sep-2001 02:19

I can only repeat what others said. DON�T USE THE LATEST C-CLIENT!!!!

all my imap php programs refused to work and even the mtest bundled with the WU-Imap refused to connect to my Cyrus Imapd. but the Imap-2000c works. and even the mtest program works!

13-Sep-2001 06:55
I have successfully compile php with imap under RedHat 7.1. This is my step:
1. export CFLAGS="-I/usr/include/imap"
2. export LDFLAGS=-lc-client
3. ./configure --enable-versioning --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local --enable-tracks-vars --with-imap --with-xml --with-gd --with-jpeg-dir=/usr --with-kerberos --with-openssl
4. make
5. make install

[email protected]
22-Oct-2001 02:11

I have found the order in which you connect to you POP server with IMAP 2000 and your database with PostgreSQL 7.1.2 can cause problems.

Make sure that you connect first to your POP server then get your db connection. This will prevent you from getting an invalid stream from imap_open().

[email protected]
02-Nov-2001 05:38

Compiling in IMAP support.

I recently successfully compiled in IMAP support for PHP4.0.6 statically compiled into apache on my FreeBSD4.3 box. I did this using the most recent version of c-client(2001a/RC2). Originally I got loads of "call to undefined....blahblah" errors.

The solution was this:
d/l, configure, and make the c-client library. (you do not need to make install)

Create 2 directories under the c-client subdirectory, lib/ and include/.

Copy c-client.a into lib and rename it to libc-client4.a.

Copy rfc822.h, mail.h, and linkage.h into include/.

Configure PHP with the path to the c-client subdir in the imap option (--with-imap=/tmp/dircreatedbyuntar/c-client).

make and make install for php.

After this, the configure and make for apache went normally.

This worked fine for me on my BSD box, I assume that it would work in Linux as well, though I am not familliar enough with it to say for sure

[email protected]
03-Nov-2001 08:42

I just found something a bit bizarre. I was having problems with the pages taking too long to load (15-20sec) when they opened an imap connection. I was pulling my hair out trying to figure out what was wrong.

Turns out it was quite simple. I was letting it default to 143 for the port. When i specified the port number (i.e. {localhost:143} rather than {localhost} ) It reduced page load time to a few seconds.

[email protected]
21-Nov-2001 12:22

to get apache 1.3.22 to work with php-3.0.8, php-4.0.6 and imap (imap-devel-2000c-15 from RPM) on redhat-7.2, try doing

export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam -lz -lssl"

before compiling apache and both php modules.

[email protected]
10-Dec-2001 02:07

How to build PHP for IMAP support on FreeBSD-4.2+:

1. Update your ports tree. (Read the Handbook if you don't know how)
2. pkg_delete cclient (pkg_info for the complete name). Perhaps you have to remove pine aswell, as it requires cclient.
3. cd /usr/ports/mail/cclient; make install
3.1 cd /usr/ports/mail/pine; make install (if you removed pine earlier)
4. Copy c-client.a from /usr/ports/mail/cclient/work/imap-2001a/c-client/c-client.a to /usr/local/lib
5. cd php-dir; ./configure [your options] --with-imap=/usr/local --with-apache=[apache dir]
6. make install
7. cd [apache dir]
8. config, make
9. Done.

[email protected]
13-Dec-2001 07:06

To fully support the last UW IMAP version 2001a here are the contents of the directory I used as DIR for --with-imap:

include/c-client.h
include/env.h
include/env_unix.h
include/2000 fs.h
include/ftl.h
include/imap4r1.h
include/linkage.h
include/mail.h
include/misc.h
include/nl.h
include/nntp.h
include/os_slx.h
include/osdep.h -> os_slx.h
include/rfc822.h
include/smtp.h
include/tcp.h

lib/c-client.a
lib/libc-client.a -> c-client.a

[email protected]
29-Dec-2001 03:36

OS version: Debian GNU/Linux "Potato"
Apache version: 1.3.22

After reading the notes here and bangind my head against the wall a bit, I found that all I needed to do was remove /usr/lib/libc-client.so.* in order to get apache's configure to work.

[email protected]
15-Jan-2002 10:01

For IMAP installation on cobalt RAQ4:

cp c-client.a /usr/lib
cp rfc822.h mail.h linkage.h /usr/include

This should also work for Red Hat. The example given above doesnt work for me.

[email protected]
31-Jan-2002 05:02

Here�s how I installed php4.1.1 with mysql and imap support for apache 1.3.19. I hope it help you.

I used:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql --with-imap --with-kerberos --with-imap-ssl

and it worked fine but i got this error during make:

/usr/bin/ld: cannot find -lgssapi_krb5
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/root/tars/php-4.1.1'
make: *** [all-recursive] Error 1
When exporting env vars (export LDFLAGS="-L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam") i get: checking whether the C compiler (gcc -L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 -lpam) works... no

configure: error: installation or configuration problem: C compiler cannot create executables.

Obviously, this didn�t work, I simply installed krb5-devel and reinstalled without exporting the env var.

This allowed me to compile successfully, but when I started apache I got

Cannot load /usr/local/apache/libexec/libphp4.so into server: undefined symbol:pam_end

I checked to make sure the libraries were linked properly:

The cause for this was not having libpam_devel installed. Make sure that if you clear config.cache and run make clean after configure.

Install krb5-devel
Install libpam �devel
ldconfig
./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql --with-imap --with-kerberos --with-imap-ssl

make clean
make
make install

if you come into any other errors, try installing the devel packages and recompiling don�t forget to remove config.cache before each compile attempt.

[email protected]
21-Feb-2002 05:47

I have downloaded IMAP webmail and tried to install it. My configuration is Slackware 8 with Apache 1.3.20. Webmail require PHP 4.1.1 so I download it and compile with options:
./configure --with-mysql --with-apxs --enable- trans-sid --with-gettext --with-imap=/usr/local/lib --with-imap-ssl=/usr/local/lib
I use c-client from imap-2001a and have libc-client.a in /usr/locla/lib.
When I tried to run Webmail I always got error " TLS/SSL failure for localhost: SSL negotiation failed". I note that there is no request to IMAP server, so the problems is in the c-client itself. After a few hours tests and many READMEs I found in c-client documentation that the correct url for IMAP connection is
{imapserver:143/notls}INBOX
/notls is to disable TLS connection.
Hope this will help someone and save him/her a lot of time and headache :)

[email protected]
16-Apr-2002 06:30

there are a nice pop3/imap Tutorial @ devhed



have fun

[email protected]
30-Apr-2002 04:40

Just fought php compile 4.2.0 on RH7.1 linux w/IMAP. Had to include /usr/include/imap/ into lib path and had to manually configure --with-kerberos to satisfy c-client.h which had Kerberos in it. My c-client was from RH .rpm. HTH
[email protected]
15-May-2002 06:24

The tutorial from DevShed.com is awesome! I recommend it to all PHP developers!
[email protected]
18-May-2002 12:42

I was going crazy trying to get PHP 4.2.1 to work with the imap-2001a c-client in RH-7.2.

The problem was the instructions provided by PHP. Do NOT copy c-client/*.h to /usr/local/include! Make will crash when it tries to include unix.h. Instead, only copy the following:
cp c-client.a /usr/local/lib
cp rfc822.h mail.h linkage.h /usr/local/include

This was what the old instructions for this said, but someone revised them in the last month or so.

I used the shared module install instructions found here, compiled mcrypt and imap (with ssl support), and then used the following for configure:

--enable-dbase --with-mysql=/usr/local/mysql --with-zlib --enable-ftp --with-mcrypt=/usr/local/lib --enable-trans-sid --with-apxs=/usr/local/apache/bin/apxs --with-imap --with-kerberos --with-imap-ssl

[email protected]
22-May-2002 06:16

please don't copy the .h files in the system include directory! the unix.h file from the washington.edu c-client conflicts with another file called unix.h
make a dir called "imap" in either /usr/include or /usr/local/include or whatever you wish, copy the header files there and the .a file prefix'ish in /usr/lib or /usr/local/lib or whatever you used for the include files.
then tell configure with --with-imap=/usr the "prefix" of your installation.
then works without problem ;)

[email protected]
07-Jun-2002 08:27

I just installed c-client from imap-2002.DEV.SNAP-0205241716. To make it work on my GNU/Linux system (2.4 kernel, glibc 2.2.5), I had to edit the imap source.

In the file src/osdep/unix/tcp_unix.c, I changed the function tcp_socket_open to run getprotobyname("tcp") instead of "ip".

Suddenly I was able to make IMP work for the first time in several months. :)

Sverre.

[email protected]
10-Jun-2002 04:20

RH7.2, PHP 4.2.1, Apache 2.0.36. Installed all "whistles" required - pam-dev, kerberos, ssl, copied .h and .a files, still was having "unable to load libphp4.so, undefined pam_end". What I changed in my ./configure - got rid of "--with-openssl", on my humble opinion Apache needs to be configured with ssl support, otherwise it will swear at you as it did at me :). After that everything went ok.
[email protected]
22-Jun-2002 05:02

Suse 8.0 for Intel, Apache 1.3.26, PHP 4.2.1, Mod_ssl, et al...
The note from the Debian guy was the answer. I discovered two things:
#1. You have to specify BOTH --with-imap AND --with-imap-ssl - NOT JUST the ssl one!
#2. You have to remove or rename /usr/lib/libc-client.so so it uses the static version.
Those two things solved it for me!

28-Jun-2002 06:02
On Solaris 8, php mistakenly sets unix.h to yes. This is due to configure getting confused about whether 'cc' is available.
setenv CC gcc; Will fix this.

?num=3&id=111236&thread=111226

[email protected]
11-Jul-2002 12:52

I needed imap support, and most configurations of php say that imap2001a has ssl, so you need to use --with-imap-ssl or --with-kerberos. But after getting a nasty error in apachectl start like: undefined symbol: ssl_onceonlyinit, or something, this is what I did:

1. NOT use --with-imap-ssl (sorry if you need this, I have no idea how to make this option work)
2. use --with-imap=DIR, where DIR has all of these:

include/c-client.h
include/env.h
include/env_unix.h
include/fs.h
include/ftl.h
include/imap4r1.h
include/linkage.h
include/mail.h
include/misc.h
include/nl.h
include/nntp.h
include/os_slx.h
include/osdep.h -> os_slx.h
include/rfc822.h
include/smtp.h
include/tcp.h

lib/c-client.a
lib/libc-client.a -> c-client.a

[
just in case, one.a -> two.a is a link, created with "ln -s two.a one.a"
]

3. remove /path/to/php-inst/config.cache
4. remove /path/to/apache/libexec/libphp4.so
5. do /path/to/php-inst/make clean

then configure, make and make install

Cheers!

AlexM.

crobinsoNOSPAM.at.fit.edu
17-Jul-2002 11:02

Build Notes for PHP IMAP:
To Build c-client with SSL.
Versions:
imap-2002RC2
php-4.2.1
apache-1.3.26

IMAP c-client building:
1. extract imap-2002.RC.tar.Z
2. cd imap-2002.RC2
3. make <build type> SSLTYPE=unix
<build type> described in Makefile
4. Modify src/osdep/unix/Makefile for SSLDIR, SSLCRYPTO, and SSLRSA
5. ln -s c-client include
6. mkdir lib
7. cd lib
8. ln -s ../c-client/c-client.a libc-client.a
9. cd ..

PHP Build:
1. cd php-4.2.1
2. ./configure --with-imap=../imap-2002.RC2 \
--with-imap-ssl=../imap-2002.RC2 \
<other options>
3. make
4. make install
5. cd ..

Then you should be good to go.

[email protected]
24-Jul-2002 12:28

Installing on a FreeBSD 4.4 box with Apache:

Do this if you don't have cclient-200x installed already
(installed if you have PINE, etc. setup). Use pkg_info
to see if it's already installed.

01) cd /usr/ports/mail/cclient
02) make
03) cd work/imap-2001a/c-client
04) cp c-client.a /usr/local/lib
cp c-client.h /usr/local/include
cp imap4r1.h /usr/local/include
cp rfc822.h /usr/local/include
cp mail.h /usr/local/include
cp linkage.h /usr/local/include
cp osdep.h /usr/local/include
cp misc.h /usr/local/include
cp smtp.h /usr/local/include
cp nntp.h /usr/local/include
cp env_unix.h /usr/local/include
cp fs.h /usr/local/include
cp ftl.h /usr/local/include
cp nl.h /usr/local/include
05) cd to your PHP source dir.
06) ./configure [your options] --with-imap=/usr/local
07) make
08) apachectl stop
09) make install
10) apachectl start

You should be good to go now. Aren't you glad I've screwed with
this for the past few months off and on trying to make it work
now. :)

-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech

[email protected]
24-Jul-2002 12:30

Installing on a FreeBSD 4.4 box with Apache:

Do this if you DO have cclient-200x installed already
(installed if you have PINE, etc. setup). Use pkg_info
to see if it's already there.

1) ./configure [your options] --with-imap
2) make
3) apachectl stop
4) make install
5) apachectl start

You should be good to go now. :)

-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech

rezzo-at-ngi-dot-it
25-Jul-2002 02:25

There's a solution to the Apache loading error:

/usr/local/libexec/apache/libphp4.so:
Undefined symbol "ssl_onceonlyinit"

In this case you have to recompile the cclient package with SSL support. So, for FreeBSD users:

# pkg_delete [-f] cclient-2001a,1
# cd /usr/ports/mail/cclient/
# make clean
# make install -D WITH_SSL

After that Apache, PHP and IMAP+SSL should work correctly.

add a note about notes
previousread_exif_dataimap_8bitnext
Last updated: Tue, 03 Sep 2002
show source | credits | stats | mirror sites
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Fri Sep 6 12:35:50 2002 CEST