Php & Imap

ctnchris said:
I tried to use it using up2date imap then running the configure, but It tells me it cant find "rfc822.h."

rpm -e imapd

cd /usr/local/directadmin/scripts/
./imapd.sh

Chris
 
Hello,

Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.

The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)

John
 
I am using imap-2004c1, and it is in Fedora Core 3.

When i try to compile php with imap i got the followin error

/usr/bin/ld: Warning: size of symbol `hash_reset' changed from 94 in /usr/lib/mysql/libmysqlclient.a(hash.o) to 89 in /usr/local/imap-2004c1/lib/libc-client.a(misc.o)


Any idea?

Thanks.
 
Warnings should not stop the compile.

Does the resulting program work?

Jeff
 
Has anyone made this work for FreeBSD? I have been tring for months to get this to work on one of our boxes.

When you compile php with imap extensions this is the errors the the config.log. I REALLY appreciate any help!

Code:
configure:40064: checking for IMAP support
configure:40513: checking for pam_start in -lpam
configure:40532: gcc -o conftest -g -O2   -R/usr/local/lib -L/usr/local/lib conftest.c -lpam  -lintl -lpng -lz -ljpeg -lcurl -lz -
configure:40670: checking for crypt in -lcrypt
configure:40689: gcc -o conftest -g -O2   -R/usr/local/lib -L/usr/local/lib conftest.c -lcrypt  -lpam -lintl -lpng -lz -ljpeg -lcu
configure:41120: checking whether SSL libraries are needed for c-client
configure:41250: gcc -o conftest -g -O2   -R/usr/local/lib -L/usr/local/lib -R/usr/local/imap-2004/lib -L/usr/local/imap-2004/lib
/usr/bin/ld: cannot find -lgssapi_krb5
configure: failed program was:
#line 41225 "configure"
#include "confdefs.h"

    void mm_log(void){}
    void mm_dlog(void){}
    void mm_flags(void){}
    void mm_fatal(void){}
    void mm_critical(void){}
    void mm_nocritical(void){}
    void mm_notify(void){}
    void mm_login(void){}
    void mm_diskerror(void){}
    void mm_status(void){}
    void mm_lsub(void){}
    void mm_list(void){}
    void mm_exists(void){}
    void mm_searched(void){}
    void mm_expunged(void){}
    char auth_gssapi_valid();
    int main() {
      auth_gssapi_valid();
      return 0;
    }

configure:41276: checking whether IMAP works
configure:41309: gcc -o conftest -g -O2   -R/usr/local/lib -L/usr/local/lib -R/usr/local/imap-2004/lib -L/usr/local/imap-2004/lib
/usr/bin/ld: cannot find -lgssapi_krb5
configure: failed program was:
#line 41284 "configure"
#include "confdefs.h"

    void mm_log(void){}
    void mm_dlog(void){}
    void mm_flags(void){}
    void mm_fatal(void){}
    void mm_critical(void){}
    void mm_nocritical(void){}
    void mm_notify(void){}
    void mm_login(void){}
    void mm_diskerror(void){}
    void mm_status(void){}
    void mm_lsub(void){}
    void mm_list(void){}
    void mm_exists(void){}
    void mm_searched(void){}
    void mm_expunged(void){}
    char mail_newbody();
    int main() {
      mail_newbody();
      return 0;
    }
 
DirectAdmin Support said:
Hello,

Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.

The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)

John

Can't get it build... ./buildit gives a error Unknown command in my RH9
 
DirectAdmin Support said:
Hello,

Just a note that the imapd binary we've included isn't standard because it required changes to accomodate the virtual pop accounts. Using up2date might install another one that won't work with these email accounts.

The rfc822.h header that is used with the build of our imapd binary is found in the c-clients directory of the http://files.directadmin.com/services/imapback.tar.gz
file, after it's built (use ./buildit)

John

Can you please write the proper procedure how to install IMAP php for RH9. I can't get it done. A Lot of errors.

If someone has a step by step instruction for me!?

I tried every methode witch is writen in this topic but still IMAP doen't work.


Group-Office installation
Configuration tests
PHP version: Ok (4.3.10)
MySQL support: Ok
IMAP support: Warning: IMAP extension not installed, E-mail module will not work.
Iconv support: Warning: iconv extension not installed, E-mail module will be unreliable with character encodings.
File upload support: Ok
 
Last edited:
Small update maybe for usage with Fedora 2.

Commands have an # in front.

Code:
# wget [url]ftp://ftp.cac.washington.edu/imap/c-client.tar.Z[/url]
# tar -zxvf c-client.tar.Z

Version may differ on date used
# cd imap-2004d/

# make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib

Create directories.
Version may differ on date used
# mkdir /usr/local/imap-2004d

Create libraries dir
# mkdir /usr/local/imap-2004d/lib

Create include dir
# mkdir /usr/local/imap-2004d/include

Change dir into the c-client dir. 
# cd c-client/

Copy all .h files into /usr/local/imap-2004d/include/
# cp *.h /usr/local/imap-2004d/include/

Copy all .c files.
# cp *.c /usr/local/imap-2004d/lib/

Copy c-client.a
# cp c-client.a /usr/local/imap-2004d/lib/libc-client.a

Change the configure file of php.
# pico /usr/local/directadmin/customapache/configure.php

Add:
\
        --with-imap=/usr/local/imap-2004d

Where \ is on the end of the last line in the file before you started changing it.

# /usr/local/directadmin/customapache/build php

We are not recompiling other things besides php, so we said no to all questions.

After everything is finished, restart apache.

# service httpd restart

To check if the recompile worked properly, create a file called phpinfo.php, with the following content:

phpinfo.php
Code:
<?php
phpinfo();
?>

Surf to http://www.yourcompany.com/phpinfo.php and verify if the following information is there:

Code:
IMAP c-Client Version  2004

If so, the installation went fine.

This might be working on all RedHat based operating systems, but this is nor confirmed nor certain. I'm not responsible for any errors
 
Hi all,

I'm also trying to get this to work. Trying to suit on CentOS 4.0 with uptodate DirectAdmin.
During compiling the imap-2004d directory it just failes.

If you have any suggestions, please tell me !

Here the complete action log (and see by yourself where it failes):

wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
tar -xvzf c-client.tar.Z
[... extract all files ...]
cd imap-2004d/

Then tried two make options, but both failes:
make slx AND make lrh
[... sorry for the long code...]
Code:
make sslnopwd
make[1]: Entering directory `/root/imap-2004d'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Building in full compliance with RFC 3501 security
+ requirements:
++ TLS/SSL encryption is supported
++ Unencrypted plaintext passwords are prohibited
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
make[1]: Leaving directory `/root/imap-2004d'
Applying an process to sources...
tools/an "ln -s" src/c-client c-client
tools/an "ln -s" src/ansilib c-client
tools/an "ln -s" src/charset c-client
tools/an "ln -s" src/osdep/unix c-client
tools/an "ln -s" src/mtest mtest
tools/an "ln -s" src/ipopd ipopd
tools/an "ln -s" src/imapd imapd
tools/an "ln -s" src/mailutil mailutil
tools/an "ln -s" src/mlock mlock
tools/an "ln -s" src/dmail dmail
tools/an "ln -s" src/tmail tmail
ln -s tools/an .
make build EXTRACFLAGS='' EXTRALDFLAGS='' EXTRADRIVERS='mbox' EXTRAAUTHENTICATORS='' 
PASSWDTYPE=std SSLTYPE=nopwd IP=4 EXTRASPECIALS='' BUILDTYPE=lnp \
SPECIALS="GSSDIR=/usr/kerberos SSLDIR=/usr/share/ssl 
SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib LOCKPGM=/usr/sbin/mlock" \
EXTRACFLAGS=" -I/usr/kerberos/include"
make[1]: Entering directory `/root/imap-2004d'
Building c-client for lnp...
echo `cat SPECIALS`  > c-client/SPECIALS
cd c-client;make lnp EXTRACFLAGS='-I/usr/kerberos/include'\
 EXTRALDFLAGS=''\
 EXTRADRIVERS='mbox'\
 EXTRAAUTHENTICATORS=''\
PASSWDTYPE=std SSLTYPE=nopwd IP=4\
 GSSDIR=/usr/kerberos SSLDIR=/usr/share/ssl 
SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib LOCKPGM=/usr/sbin/mlock
make[2]: Entering directory `/root/imap-2004d/c-client'
make build EXTRACFLAGS='-I/usr/kerberos/include' EXTRALDFLAGS='' EXTRADRIVERS='mbox' EXTRAAUTHENTICATORS='' 
PASSWDTYPE=std SSLTYPE=nopwd IP=4 `cat SPECIALS` OS=lnx \
 SIGTYPE=psx CHECKPW=pam CRXTYPE=nfs \
 SPOOLDIR=/var/spool \
 ACTIVEFILE=/var/lib/news/active \
 RSHPATH=/usr/bin/rsh \
 BASECFLAGS="-g -fno-omit-frame-pointer -O2" \
 BASELDFLAGS="-lpam -ldl"
make[3]: Entering directory `/root/imap-2004d/c-client'
sh -c 'rm -rf auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o 
ARCHIVE *FLAGS *TYPE c-client.a || true'
Once-only environment setup...
echo cc > CCTYPE
echo -g -fno-omit-frame-pointer -O2 '-I/usr/kerberos/include' > CFLAGS
echo -DCREATEPROTO=unixproto -DEMPTYPROTO=unixproto \
 -DMAILSPOOL=\"/var/spool/mail\" \
 -DANONYMOUSHOME=\"/var/spool/mail/anonymous\" \
 -DACTIVEFILE=\"/var/lib/news/active\" -DNEWSSPOOL=\"/var/spool/news\" \
 -DRSHPATH=\"/usr/bin/rsh\" -DLOCKPGM=\"/usr/sbin/mlock\" > OSCFLAGS
echo -lpam -ldl  > LDFLAGS
echo "ar rc c-client.a osdep.o mail.o misc.o newsrc.o smanager.o utf8.o siglocal.o dummy.o pseudo.o 
netmsg.o flstring.o fdstring.o rfc822.o nntp.o smtp.o imap4r1.o pop3.o 
unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o;ranlib c-client.a" > ARCHIVE
echo lnx > OSTYPE
./drivers mbox imap nntp pop3 mh mx mbx tenex mtx mmdf unix news phile dummy
./mkauths  md5 pla log
make[4]: Entering directory `/root/imap-2004d/c-client'
echo -DMD5ENABLE=\"/etc/cram-md5.pwd\" >> OSCFLAGS
make[4]: Leaving directory `/root/imap-2004d/c-client'
ln -s os_lnx.h osdep.h
ln -s os_lnx.c osdepbas.c
ln -s log_std.c osdeplog.c
ln -s sig_psx.c siglocal.c
ln -s crx_nfs.c crexcl.c
ln -s ip4_unix.c ip_unix.c
sh -c '(test -f /usr/include/sys/statvfs.h -a lnx != sc5 -a lnx != sco) && ln -s 
nfstnew.c nfstest.c || ln -s nfstold.c nfstest.c'
Standard password authentication
ln -s ckp_pam.c osdepckp.c
Building with SSL
ln -s ssl_unix.c osdepssl.c
echo -I/usr/include/openssl -I/usr/include/openssl/openssl 
-DSSL_CERT_DIRECTORY=\"/usr/share/ssl/certs\" 
-DSSL_KEY_DIRECTORY=\"/usr/share/ssl/certs\" >> OSCFLAGS
echo "  ssl_onceonlyinit ();" >> linkage.c
echo -L/usr/lib -lssl -lcrypto  >> LDFLAGS
Building with SSL and plaintext passwords disabled unless SSL/TLS
echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 2);" >> linkage.c
cat osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
Building OS-dependent module
If you get No such file error messages for files x509.h, ssl.h,
pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
is not installed on your system. Either install OpenSSL first
or build with command: make lnx SSLTYPE=none
`cat CCTYPE` -c `cat CFLAGS` `cat OSCFLAGS` -c osdep.c
osdep.c:71:31: security/pam_appl.h: No such file or directory
osdep.c:88: warning: `struct pam_response' declared inside parameter list
osdep.c:88: warning: its scope is only this definition or declaration, which is probably not what you want
osdep.c:88: warning: `struct pam_message' declared inside parameter list
osdep.c: In function `checkpw_conv':
osdep.c:92: sizeof applied to an incomplete type
osdep.c:93: dereferencing pointer to incomplete type
osdep.c:94: `PAM_PROMPT_ECHO_ON' undeclared (first use in this function)
osdep.c:94: (Each undeclared identifier is reported only once
osdep.c:94: for each function it appears in.)
osdep.c:95: invalid use of undefined type `struct pam_response'
osdep.c:95: dereferencing pointer to incomplete type
osdep.c:95: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c:96: invalid use of undefined type `struct pam_response'
osdep.c:96: dereferencing pointer to incomplete type
osdep.c:98: `PAM_PROMPT_ECHO_OFF' undeclared (first use in this function)
osdep.c:99: invalid use of undefined type `struct pam_response'
osdep.c:99: dereferencing pointer to incomplete type
osdep.c:100: invalid use of undefined type `struct pam_response'
osdep.c:100: dereferencing pointer to incomplete type
osdep.c:102: `PAM_TEXT_INFO' undeclared (first use in this function)
osdep.c:103: `PAM_ERROR_MSG' undeclared (first use in this function)
osdep.c:104: invalid use of undefined type `struct pam_response'
osdep.c:104: dereferencing pointer to incomplete type
osdep.c:105: invalid use of undefined type `struct pam_response'
osdep.c:105: dereferencing pointer to incomplete type
osdep.c:109: `PAM_CONV_ERR' undeclared (first use in this function)
osdep.c: At top level:
osdep.c:120: syntax error before '*' token
osdep.c: In function `checkpw_cleanup':
osdep.c:125: `hdl' undeclared (first use in this function)
osdep.c:125: `PAM_DELETE_CRED' undeclared (first use in this function)
osdep.c:126: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c: In function `checkpw':
osdep.c:137: `pam_handle_t' undeclared (first use in this function)
osdep.c:137: `hdl' undeclared (first use in this function)
osdep.c:138: storage size of `conv' isn't known
osdep.c:145: `PAM_SUCCESS' undeclared (first use in this function)
osdep.c:146: `PAM_RHOST' undeclared (first use in this function)
osdep.c:149: `PAM_ESTABLISH_CRED' undeclared (first use in this function)
osdep.c:151: `PAM_DELETE_CRED' undeclared (first use in this function)
osdep.c:152: `PAM_AUTH_ERR' undeclared (first use in this function)
make[3]: *** [osdep.o] Error 1
make[3]: Leaving directory `/root/imap-2004d/c-client'
make[2]: *** [lnp] Error 2
make[2]: Leaving directory `/root/imap-2004d/c-client'
make[1]: *** [OSTYPE] Error 2
make[1]: Leaving directory `/root/imap-2004d'
make: *** [lrh] Error 2
 
Mikej0h said:
Code:
`cat CFLAGS` `cat OSCFLAGS` -c osdep.c
osdep.c:71:31: security/pam_appl.h: No such file or directory
pam_appl.h is included in the pam-devel package in RH3, probably the same for RH/Centos4.
 
Thanks, downloading and installing the pam-devel package was the solution to this problem.
By the way my os is CentOS 3.4 instead of CentOS 4.0.

Thanks anyway !
 
Cannot find rfc822.h. Please check your c-client installation

I am not sure what I am doing wrong... I followed the instructions for imap-2004e given earlier in this thread, copying everything to the /usr/local/imap-2004e 'lib' and 'include' dirs.

Then modified the configure.php and added:

Code:
/
--with-imap=/usr/local/imap-2004e

Running ./build php returns this error:

Code:
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... no
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... (cached) yes
configure: error: Cannot find rfc822.h. Please check your c-client installation.

*** There was an error while trying to configure php. Check the configure.php file

Any ideas? I checked and rfc822.h IS located in the imap-2004e/include dir.
 
Re: Cannot find rfc822.h. Please check your c-client installation

costarica said:
I am not sure what I am doing wrong... I followed the instructions for imap-2004e given earlier in this thread, copying everything to the /usr/local/imap-2004e 'lib' and 'include' dirs.

Then modified the configure.php and added:

Code:
/
--with-imap=/usr/local/imap-2004e

Running ./build php returns this error:

Any ideas? I checked and rfc822.h IS located in the imap-2004e/include dir.

Try this: http://www.directadmin.com/forum/showthread.php?threadid=1640&perpage=20&pagenumber=2
Scroll down...
 
--with-imap should suffice..

Make sure to also have installed imap-devel-*
 
What to do?


checking for iconv support... no
checking for IMAP support... yes
checking for IMAP Kerberos support... yes
checking for IMAP SSL support... no
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
configure: error: Kerberos libraries not found.

Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )


*** There was an error while trying to configure php. Check the configure.php file
 
Awesome, that did the trick.

I was trying to recompile PHP% w/imap support, but when I followed the instructions and just used the included version of php4, it worked.

So, no php5 for me for now since I need imap support, which is fine since I also need jpgraph and it was not working right on php5 anyhow.

Thanks agian guys!
 
Just thought i'd also update this thread to mention that teh following works on 4.3.10 -



cd /home
mkdir build
cd build
wget http://files.directadmin.com/services/imapback.tar.gz
tar -zxvf imapback.tar.gz
cd imap-2002e
./buildit
cd c-client
make slx EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
mkdir /usr/local/imap-2000e/
mkdir /usr/local/imap-2000e/lib
mkdir /usr/local/imap-2000e/include
cp *.h /usr/local/imap-2000e/include
cp *.c /usr/local/imap-2000e/lib
cp c-client.a /usr/local/imap-2000e/lib
mv /usr/local/imap-2000e/lib/c-client.a /usr/local/imap-2000e/lib/libc-client.a
cd /usr/local/directadmin/customapache
nano -w configure.php (Add --with-imap=/usr/local/imap-2000e \ to php config)
./build php (answer n to all questions)



But on 4.3.11 this no longer works and needs further investigation.
 
Back
Top