ВрСбования

ΠœΠΎΠ΄ΡƒΠ»ΡŒ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ с установлСнной Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΎΠΉ c-client. Π’ΠΎΠ·ΡŒΠΌΠΈΡ‚Π΅ послСднюю Π²Π΅Ρ€ΡΠΈΡŽ с » https://github.com/uw-imap/imap ΠΈ скомпилируйтС Π΅Ρ‘.

Π’Π°ΠΆΠ½ΠΎ Π½Π΅ ΠΊΠΎΠΏΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ исходныС Ρ„Π°ΠΉΠ»Ρ‹ модуля IMAP нСпосрСдствСнно Π² систСмный ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ include, ΠΏΠΎΡΠΊΠΎΠ»ΡŒΠΊΡƒ ΠΈΠ½ΠΎΠ³Π΄Π° это Π²Ρ‹Π·Ρ‹Π²Π°Π΅Ρ‚ ΠΊΠΎΠ½Ρ„Π»ΠΈΠΊΡ‚. ВмСсто этого создайтС Π½ΠΎΠ²Ρ‹ΠΉ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ Π²Π½ΡƒΡ‚Ρ€ΠΈ систСмного ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° с ΠΏΡƒΡ‚Ρ‘ΠΌ Π½Π°ΠΏΠΎΠ΄ΠΎΠ±ΠΈΠ΅ /usr/local/imap-2000b/. Π’ΠΎΡ‡Π½ΠΎΠ΅ располоТСниС ΠΈ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° зависят ΠΎΡ‚ настроСк ΠΈ вСрсии модуля IMAP. Π—Π°Ρ‚Π΅ΠΌ Π²Π½ΡƒΡ‚Ρ€ΠΈ этого Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° создайтС Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ΠΈ с ΠΈΠΌΠ΅Π½Π°ΠΌΠΈ lib/ ΠΈ include/. Из ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ c-client, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ Π»Π΅ΠΆΠΈΡ‚ Π²Π½ΡƒΡ‚Ρ€ΠΈ Π΄Π΅Ρ€Π΅Π²Π° исходных Ρ„Π°ΠΉΠ»ΠΎΠ² модуля IMAP, скопируйтС Ρ„Π°ΠΉΠ»Ρ‹ с Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ΠΌ *.h Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ include/, Π° Ρ„Π°ΠΉΠ»Ρ‹ с Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ΠΌ *.c β€” Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ lib/. ΠšΡ€ΠΎΠΌΠ΅ Ρ‚ΠΎΠ³ΠΎ, ΠΏΡ€ΠΈ компиляции IMAP создаётся Ρ„Π°ΠΉΠ» с ΠΈΠΌΠ΅Π½Π΅ΠΌ c-client.a. ΠŸΠ΅Ρ€Π΅ΠΈΠΌΠ΅Π½ΡƒΠΉΡ‚Π΅ этот Ρ„Π°ΠΉΠ» Π² libc-client.a ΠΈ скопируйтС Π΅Π³ΠΎ Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ lib/.

Π—Π°ΠΌΠ΅Ρ‡Π°Π½ΠΈΠ΅:

Для сборки Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ c-client с ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΎΠΉ ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»Π° SSL ΠΈ (ΠΈΠ»ΠΈ) ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»Π° Kerberos ΠΏΡ€ΠΎΡ‡ΠΈΡ‚Π°ΠΉΡ‚Π΅ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΡŽ, которая поставляСтся с ΠΏΠ°ΠΊΠ΅Ρ‚ΠΎΠΌ.

Π—Π°ΠΌΠ΅Ρ‡Π°Π½ΠΈΠ΅: Π’ дистрибутивС Mandrake Linux Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° IMAP (Ρ„Π°ΠΉΠ» libc-client.a) компилируСтся Π±Π΅Π· ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΈ ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»Π° Kerberos. ВСрсия с ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΎΠΉ ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»Π° SSL (Ρ„Π°ΠΉΠ» client-PHP4.a) устанавливаСтся ΠΎΡ‚Π΄Π΅Π»ΡŒΠ½ΠΎ. Π‘ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΡƒ ΠΏΠ΅Ρ€Π΅ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡ€ΡƒΡŽΡ‚, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ сСтСвого ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»Π° Kerberos.

οΌ‹Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ 4 notes

up
13
crabb1d at gmail dot com ΒΆ
12 years ago
For those using Ubuntu and who are completely daunted by compiling this, it's easy under Ubuntu:

Install libc-client-dev
# sudo apt-get install libc-client-dev

Install PHP5 imap:
# sudo apt-get install php5-imap

Restart Apache
# sudo service apache2 reload

Should work for most people.
up
5
allan at umich dot edu ΒΆ
7 years ago
It should be noted that the source code archives at the University of Washington, and the mirrors, have been dead for some time.

There is a github repository located here: https://github.com/uw-imap/imap
up
2
obeco ΒΆ
3 years ago
php-imap package is not available neither in Red Hat Enterprise Linux 7 nor 8.

To compile the extension yourself:

Prerequisites
# yum install pam-devel openssl-devel

Follow steps 2 and 3 from the previous post of "ldi at email dot cz"

Download the c-client library from github, you can see the link at the top of the page and compile with:
# make lr5 SSLINCLUDE=/usr/include/openssl/ EXTRACFLAGS=-fPIC
(if you are using another distro, instead of lr5 you will type something else, you can view the Makefile for other unix flavors)

Follow step 5 from the previous post of "ldi at email dot cz" which is what the second paragraph at the top of the page explains.

Download the PHP source code of the version installed in your system and go to the php/ext/imap folder.

# phpize
(If you installed the PHP packages from the Red Hat Software Collections you must run the following command before to set the enviroment eg: scl enable rh-php73 bash)

# ./configure --with-imap=<<path_to_where_you_unpacked_the_c-client_library_and_compiled_it>> --with-imap-ssl

# make

This creates the file php/ext/imap/modules/imap.so :)
Copy it to your extension_dir (you can find it in the phpinfo() page).
Create an .ini file in the php.d folder with the text: extension=imap.so

Restart apache and be happy.

P.S. You could probably find the extension compiled out there but who knows the trustiness of the source so better to get the official unaltered sources.
up
1
Anonymous ΒΆ
2 years ago
The Alpine email client which was also originally developed by Mark Crispin at UW also uses the "c-client" library and that it is still actively developed by Eduardo Chappa: https://alpineapp.email/alpine/release/ . It has its own updated copy of the "c-client" library which supports new features like OAuth2 authentication, etc.

The development of the UW IMAP and Alpine "c-client" libraries can be compared via https://github.com/uw-imap/imap/commits/master/src/c-client and https://repo.or.cz/alpine.git/history/HEAD:/imap/src/c-client

If this PHP extension does not work with Alpine "c-client", it might behoove someone to port the PHP so it does.