[Dovecot] DRAC support?
Hi,
I was hoping someone had a quick and dirty (is there any other
kind) of patch for DRAC support for dovecot.
This daemon is very slick, and I wish to replace my complex courier-imap setup.
Regards, C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Wed, 2003-05-14 at 11:52, Charlie Allom wrote:
Hi,
I was hoping someone had a quick and dirty (is there any other kind) of patch for DRAC support for dovecot.
Doesn't look too difficult to implement. You'll just have to tell DRAC once in a while to keep the relay open. Um. I was just going to give a few ideas how to do it, but I ended up writing the thing. Try if the included patch works. You'll still need to add the needed libraries to Makefile.
Hmm .. Maybe it's time to add support for runtime loadable IMAP/POP3 modules.
On Wed, May 14, 2003 at 07:18:45PM +0300, Timo Sirainen wrote:
On Wed, 2003-05-14 at 11:52, Charlie Allom wrote:
Hi,
I was hoping someone had a quick and dirty (is there any other kind) of patch for DRAC support for dovecot.
Doesn't look too difficult to implement. You'll just have to tell DRAC once in a while to keep the relay open.
Which relay? I assumed by calling drac, drac kept it's own DB with IPs.
Um. I was just going to give a few ideas how to do it, but I ended up writing the thing.
Wow thanks!
Try if the included patch works. You'll still need to add the needed libraries to Makefile.
Done. But doesn't update the dracdb.
hrmm what can I do to help you debug it? btw if you wouldlike to test yourself I am using drac 1.12
Regards, C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Thu, May 15, 2003 at 11:13:06AM +1000, Charlie Allom wrote:
Which relay? I assumed by calling drac, drac kept it's own DB with IPs.
Here are some examples of other patches:
http://mail.cc.umanitoba.ca/drac/pop.html
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Wednesday 14 May 2003 21:30, Charlie Allom wrote: => On Thu, May 15, 2003 at 11:13:06AM +1000, Charlie Allom wrote: => > => > Which relay? I assumed by calling drac, drac kept it's own DB with => > IPs. => > => => Here are some examples of other patches: => => http://mail.cc.umanitoba.ca/drac/pop.html
DRAC, pop-before-smtp and other such implementations really is a "broken" way of implementing the desired result, IMHO, and I would much prefer this code stays out of dovecot. You should be using SMTP auth. Really.
--Jo
On Thu, 2003-05-15 at 07:37, Joakim Ryden wrote:
DRAC, pop-before-smtp and other such implementations really is a "broken" way of implementing the desired result, IMHO, and I would much prefer this code stays out of dovecot. You should be using SMTP auth. Really.
CVS has now support for dynamically loadable modules (disabled by default). Support for things like this could then be distributed completely separately from rest of Dovecot.
- On 2003.05.14, in 200305142137.11186.jryden@thebox.our-own.net,
- "Joakim Ryden" jryden@thebox.our-own.net wrote:
DRAC, pop-before-smtp and other such implementations really is a "broken" way of implementing the desired result, IMHO, and I would much prefer this code stays out of dovecot. You should be using SMTP auth. Really.
I agree that it's not as good an answer as SMTP auth, but SMTP auth isn't always an option. *-before-SMTP is. That's why it's popular, and that's why it will exist for dovecot whether Timo puts it in the distribution or not. It just makes things easier if he does.
-- -D. dgc@uchicago.edu NSIT University of Chicago When using any driving directions or map, it's a good idea to do a reality check and make sure the road still exists, watch out for construction, and follow all traffic safety precautions.
On Fri, May 16, 2003 at 02:13:35PM -0500, David Champion wrote:
- On 2003.05.14, in 200305142137.11186.jryden@thebox.our-own.net,
- "Joakim Ryden" jryden@thebox.our-own.net wrote:
DRAC, pop-before-smtp and other such implementations really is a "broken" way of implementing the desired result, IMHO, and I would much prefer this code stays out of dovecot. You should be using SMTP auth. Really.
I agree that it's not as good an answer as SMTP auth, but SMTP auth isn't always an option. *-before-SMTP is. That's why it's popular, and that's why it will exist for dovecot whether Timo puts it in the distribution or not. It just makes things easier if he does.
On this note,
has anyone else tried this patch ? with Timo's modifications to his original patch I got it updating the DRAC db, but only able to use the local interfaces.
I'm not sure dovecot is structured, but maybe the patch should be in the auth parts of the code?
don't shoot me :) Just seeing if someone else is interested in DRAC atm with dovecot.
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Sat, 2003-05-17 at 09:31, Charlie Allom wrote:
has anyone else tried this patch ? with Timo's modifications to his original patch I got it updating the DRAC db, but only able to use the local interfaces.
Install Dovecot 0.99.10-test2 and http://dovecot.procontrol.fi/patches/drac-imap.c
Set "imap_use_modules = yes" in config file and that should hopefully do it.
On Sun, 2003-05-18 at 20:07, Timo Sirainen wrote:
Actually :) This has nothing IMAP-specific. The same thing works for both IMAP and POP3 servers. Changed the filename to drac.c
On Sun, May 18, 2003 at 08:07:12PM +0300, Timo Sirainen wrote:
On Sat, 2003-05-17 at 09:31, Charlie Allom wrote:
has anyone else tried this patch ? with Timo's modifications to his original patch I got it updating the DRAC db, but only able to use the local interfaces.
Install Dovecot 0.99.10-test2 and http://dovecot.procontrol.fi/patches/drac-imap.c
The instructions specify:
gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib \
drac.c -o drac.so -ldrac
and the C defines common.h - which one? "-I$dovecot/src/master" ?
11:19 root@lazy:/usr/src/dovecot# find . -name common.h ./src/auth/common.h ./src/imap/common.h ./src/imap-login/common.h ./src/login-common/common.h ./src/master/common.h ./src/pop3/common.h ./src/pop3-login/common.h
11:29 root@lazy:/usr/src/dovecot# export dovecot=/usr/src/dovecot/ 11:46 root@lazy:/usr/src/dovecot# gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib -I$dovecot/src/master drac.c -o drac.so -ldrac In file included from /usr/src/dovecot/src/master/common.h:6, from drac.c:14: /usr/src/dovecot/src/lib/lib.h:6: ../../config.h: No such file or directory In file included from /usr/src/dovecot/src/lib/lib.h:20, from /usr/src/dovecot/src/master/common.h:6, from drac.c:14: /usr/src/dovecot/src/lib/compat.h:17: #error uoff_t size not set
Regards, C.
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Mon, May 19, 2003 at 09:27:36AM +0300, Timo Sirainen wrote:
On Mon, 2003-05-19 at 04:48, Charlie Allom wrote:
The instructions specify:
gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib
drac.c -o drac.so -ldracand the C defines common.h - which one? "-I$dovecot/src/master" ?
Oh, change it to lib.h instead.
Done, and:
16:46 yeled@lazy:/usr/src/dovecot$ gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib drac.c -o drac.so -ldrac In file included from drac.c:14: /usr/src/dovecot/src/lib/lib.h:6: ../../config.h: No such file or directory In file included from /usr/src/dovecot/src/lib/lib.h:20, from drac.c:14: /usr/src/dovecot/src/lib/compat.h:17: #error uoff_t size not set
um..
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Mon, 2003-05-19 at 09:48, Charlie Allom wrote:
16:46 yeled@lazy:/usr/src/dovecot$ gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib drac.c -o drac.so -ldrac In file included from drac.c:14: /usr/src/dovecot/src/lib/lib.h:6: ../../config.h: No such file or directory In file included from /usr/src/dovecot/src/lib/lib.h:20, from drac.c:14: /usr/src/dovecot/src/lib/compat.h:17: #error uoff_t size not set
um..
Well .. worked with me :) But since it wants ../../config.h, compile it in eg. src/imap/ directory.
On Mon, May 19, 2003 at 10:07:43AM +0300, Timo Sirainen wrote:
On Mon, 2003-05-19 at 09:48, Charlie Allom wrote:
16:46 yeled@lazy:/usr/src/dovecot$ gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib drac.c -o drac.so -ldrac In file included from drac.c:14: /usr/src/dovecot/src/lib/lib.h:6: ../../config.h: No such file or directory In file included from /usr/src/dovecot/src/lib/lib.h:20, from drac.c:14: /usr/src/dovecot/src/lib/compat.h:17: #error uoff_t size not set
um..
Well .. worked with me :) But since it wants ../../config.h, compile it in eg. src/imap/ directory.
Are you sure?
17:22 yeled@lazy:/usr/src/dovecot$ find . -name config.h 17:22 yeled@lazy:/usr/src/dovecot$
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Mon, 2003-05-19 at 10:22, Charlie Allom wrote:
Well .. worked with me :) But since it wants ../../config.h, compile it in eg. src/imap/ directory.
Are you sure?
17:22 yeled@lazy:/usr/src/dovecot$ find . -name config.h 17:22 yeled@lazy:/usr/src/dovecot$
Oh, you haven't compiled Dovecot in that tree? You'll have to run at least configure there which generates config.h
On Sun, May 18, 2003 at 08:07:12PM +0300, Timo Sirainen wrote:
On Sat, 2003-05-17 at 09:31, Charlie Allom wrote:
has anyone else tried this patch ? with Timo's modifications to his original patch I got it updating the DRAC db, but only able to use the local interfaces.
Install Dovecot 0.99.10-test2 and http://dovecot.procontrol.fi/patches/drac-imap.c
Set "imap_use_modules = yes" in config file and that should hopefully do it.
Hi,
this does less than the original patch.
can I strace/ktruss something for you?
C.
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
http://groups.google.com/groups?selm=3266D499.342E%40student.uq.edu.au <
On Tue, 2003-05-20 at 04:13, Charlie Allom wrote:
http://dovecot.procontrol.fi/patches/drac-imap.c
Set "imap_use_modules = yes" in config file and that should hopefully do it. this does less than the original patch.
Sounds like it's not even trying to use the module. Are you sure you put it in the correct directory?
can I strace/ktruss something for you?
"strace -f dovecot" would work. You should see something like this after logging in:
[pid 10271] open("/usr/local/lib/dovecot/imap", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 .. [pid 10271] open("/usr/local/lib/dovecot/imap/drac.so", O_RDONLY) = 5
On Tue, May 20, 2003 at 09:40:36PM +0300, Timo Sirainen wrote:
On Tue, 2003-05-20 at 04:13, Charlie Allom wrote:
http://dovecot.procontrol.fi/patches/drac-imap.c
Set "imap_use_modules = yes" in config file and that should hopefully do it. this does less than the original patch.
Sounds like it's not even trying to use the module. Are you sure you put it in the correct directory?
#imap_use_modules = no #imap_modules = /usr/lib/dovecot/imap imap_use_modules = no imap_modules = /usr/pkg/lib/dovecot/imap
# Support for dynamically loadable modules. #pop3_use_modules = no #pop3_modules = /usr/lib/dovecot/pop3 pop3_use_modules = no pop3_modules = /usr/pkg/lib/dovecot/pop3
14:32 yeled@lazy:~$ ls -Rl /usr/pkg/lib/dovecot total 4 drwxr-xr-x 2 root wheel 512 May 20 11:07 imap/ drwxr-xr-x 2 root wheel 512 May 20 11:07 pop3/
/usr/pkg/lib/dovecot/imap: total 12 -rwxr-xr-x 1 root wheel 6031 May 20 21:51 drac.so*
/usr/pkg/lib/dovecot/pop3: total 12 -rwxr-xr-x 1 root wheel 6031 May 20 21:51 drac.so*
can I strace/ktruss something for you?
"strace -f dovecot" would work. You should see something like this after logging in:
[pid 10271] open("/usr/local/lib/dovecot/imap", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4 .. [pid 10271] open("/usr/local/lib/dovecot/imap/drac.so", O_RDONLY) = 5
gah nothing mentioning drac.so there... I am using ktruss -ip o nthe first dovecot PID.
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, May 21, 2003 at 02:33:13PM +1000, Charlie Allom wrote:
14:32 yeled@lazy:~$ ls -Rl /usr/pkg/lib/dovecot total 4 drwxr-xr-x 2 root wheel 512 May 20 11:07 imap/ drwxr-xr-x 2 root wheel 512 May 20 11:07 pop3/
/usr/pkg/lib/dovecot/imap: total 12 -rwxr-xr-x 1 root wheel 6031 May 20 21:51 drac.so*
/usr/pkg/lib/dovecot/pop3: total 12 -rwxr-xr-x 1 root wheel 6031 May 20 21:51 drac.so*
PS. Instead of -ldrac when compilling drac.so I used -I/usr/pkg/lib/libdrac.a
Don't know what the difference is.
I agree it doesn't look like the modules are being loaded.
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, May 21, 2003 at 10:09:15AM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 07:33, Charlie Allom wrote:
Set "imap_use_modules = yes" in config file and that should hopefully do it. imap_use_modules = no pop3_use_modules = no
"no"?
I may just die.
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
OK.
finally.
http://rubberduck.com/~yeled/NetBSD/dovecot.ktruss.1.txt
and in syslog:
May 21 17:18:57 lazy imap-login: Login: thom [203.31.232.2] May 21 17:18:57 lazy imap(thom): dlopen(/usr/pkg/lib/dovecot/imap/drac.so) failed: /usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, May 21, 2003 at 10:30:16AM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:20, Charlie Allom wrote:
/usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
Are you really running 0.99.10-test2 or newer? I changed that function's name recently.
Yes I really am.
Check your latest commits to network.h and network.c
17:35 yeled@lazy:~$ grep -ir net_addr2ip /usr/src/pkgsrc/mail/dovecot/work.i386//usr/src/pkgsrc/mail/dovecot/work.i386/dovecot-0.99.10-test2/src/lib/network.c:int net_addr2ip(const char *addr, struct ip_addr *ip) /usr/src/pkgsrc/mail/dovecot/work.i386/dovecot-0.99.10-test2/src/lib/network.h:int net_addr2ip(const char *addr, struct ip_addr *ip); /usr/src/pkgsrc/mail/dovecot/work.i386/dovecot-0.99.10-test2/drac.c: else if (net_addr2ip(ip_str, &ip) < 0)
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, 2003-05-21 at 10:39, Charlie Allom wrote:
On Wed, May 21, 2003 at 10:30:16AM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:20, Charlie Allom wrote:
/usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
Are you really running 0.99.10-test2 or newer? I changed that function's name recently.
Yes I really am.
Check your latest commits to network.h and network.c
Oh! I got it :) The linker optimizes that function away since it's not used elsewhere. Well, I'll include that function into the drac.c. Updated http://dovecot.procontrol.fi/patches/drac.c
On Wed, May 21, 2003 at 12:14:09PM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:39, Charlie Allom wrote:
On Wed, May 21, 2003 at 10:30:16AM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:20, Charlie Allom wrote:
/usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
Are you really running 0.99.10-test2 or newer? I changed that function's name recently.
Yes I really am.
Check your latest commits to network.h and network.c
Oh! I got it :) The linker optimizes that function away since it's not used elsewhere. Well, I'll include that function into the drac.c. Updated http://dovecot.procontrol.fi/patches/drac.c
Thanks!
May 21 19:23:26 lazy imap-login: Login: thom [203.31.232.2] May 21 19:23:26 lazy imap(thom): dlopen(/usr/pkg/lib/dovecot/imap/drac.so) failed: /usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "i_error" (symnum = 22)
Oops.
ktruss: http://rubberduck.com/~yeled/NetBSD/dovecot.ktruss.2.txt
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, 2003-05-21 at 12:26, Charlie Allom wrote:
Oh! I got it :) The linker optimizes that function away since it's not used elsewhere. Well, I'll include that function into the drac.c. Updated http://dovecot.procontrol.fi/patches/drac.c
dlopen(/usr/pkg/lib/dovecot/imap/drac.so) failed: /usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "i_error" (symnum = 22)
Well, I think the module stuff is somehow broken with your system then.
And I think I'll revert the net_addr2ip() change too since it's probably
the same reason :)
When linking imap binary, does it include -Wl,--export-dynamic option
somewhere in the gcc line?
Or you could just built it in by modifying src/imap/main.c:
diff -u -r1.33 main.c
--- main.c 14 May 2003 18:23:04 -0000 1.33
+++ main.c 21 May 2003 09:35:06 -0000
@@ -10,6 +10,7 @@
#include "module-dir.h"
#include "mail-storage.h"
#include "commands.h"
+#include "drac.c"
#include
On Wed, May 21, 2003 at 12:35:49PM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 12:26, Charlie Allom wrote:
Oh! I got it :) The linker optimizes that function away since it's not used elsewhere. Well, I'll include that function into the drac.c. Updated http://dovecot.procontrol.fi/patches/drac.c
dlopen(/usr/pkg/lib/dovecot/imap/drac.so) failed: /usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "i_error" (symnum = 22)
Well, I think the module stuff is somehow broken with your system then. And I think I'll revert the net_addr2ip() change too since it's probably the same reason :)
When linking imap binary, does it include -Wl,--export-dynamic option somewhere in the gcc line?
no.
diff -u -r1.33 main.c --- main.c 14 May 2003 18:23:04 -0000 1.33 +++ main.c 21 May 2003 09:35:06 -0000 @@ -10,6 +10,7 @@ #include "module-dir.h" #include "mail-storage.h" #include "commands.h" +#include "drac.c"
Cheers. -- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, May 21, 2003 at 12:14:09PM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:39, Charlie Allom wrote:
On Wed, May 21, 2003 at 10:30:16AM +0300, Timo Sirainen wrote:
On Wed, 2003-05-21 at 10:20, Charlie Allom wrote:
/usr/pkg/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
Are you really running 0.99.10-test2 or newer? I changed that function's name recently.
Yes I really am.
Check your latest commits to network.h and network.c
Oh! I got it :) The linker optimizes that function away since it's not used elsewhere. Well, I'll include that function into the drac.c. Updated http://dovecot.procontrol.fi/patches/drac.c
Sorry Timo,
still going here .. I have test2 and last drac.c
it all compiled much more cleanly this time.
NB you have to hand edit and #define HAVE_MODULES in config.h
and I still get this error:
May 28 15:03:35 lazy imap-login: Login: jen [203.31.232.2] May 28 15:03:35 lazy imap(jen): dlopen(/usr/local/lib/dovecot/imap/drac.so) failed: /usr/local/lib/dovecot/imap/drac.so: Undefined PLT symbol "net_addr2ip" (symnum = 21)
even when there is this in drac.c:
ip_str = getenv("IP");
if (ip_str == NULL)
i_error("DRAC: IP environment not given");
else if (net_addr2ip(ip_str, &ip) < 0)
i_error("DRAC: net_ip2addr(%s) failed: %m", ip_str);
.. how did this happen .. shall I use a newer test?
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Wed, 2003-05-28 at 08:08, Charlie Allom wrote:
still going here .. I have test2 and last drac.c
it all compiled much more cleanly this time.
NB you have to hand edit and #define HAVE_MODULES in config.h
That's not enough. If configure doesn't detect that you have modules, it's not setting the linker flags correctly and it won't work.
Looks like BSDs don't have libdl which is why configure's test fails.
Try -test7, I just updated it so that the check should work.
On Wed, May 28, 2003 at 02:30:19PM +0300, Timo Sirainen wrote:
On Wed, 2003-05-28 at 08:08, Charlie Allom wrote:
still going here .. I have test2 and last drac.c
it all compiled much more cleanly this time.
NB you have to hand edit and #define HAVE_MODULES in config.h
That's not enough. If configure doesn't detect that you have modules, it's not setting the linker flags correctly and it won't work.
Looks like BSDs don't have libdl which is why configure's test fails.
Try -test7, I just updated it so that the check should work.
Thanks, but drac.so will not compile with this anymore.
test2 does it cleanly, I will paste in my findings:
10:58 yeled@lazy:~/dovecot-0.99.10-test2$ export dovecot=~/dovecot-0.99.10-test2
10:58 yeled@lazy:~/dovecot-0.99.10-test2$ gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib drac.c -o drac.so -I/usr/pkg/lib/libdrac.a
10:59 yeled@lazy:~/dovecot-0.99.10-test2$ cd ../dovecot-0.99.10-test7/
10:59 yeled@lazy:~/dovecot-0.99.10-test7$ export dovecot=~/dovecot-0.99.10-test7
10:59 yeled@lazy:~/dovecot-0.99.10-test7$ gcc -Wall -W -shared -fPIC -DHAVE_CONFIG_H -I$dovecot -I$dovecot/src/lib drac.c -o drac.so -I/usr/pkg/lib/libdrac.a
In file included from drac.c:14:
/home/yeled/dovecot-0.99.10-test7/src/lib/lib.h:6: ../../config.h: No such file or directory
In file included from /home/yeled/dovecot-0.99.10-test7/src/lib/lib.h:20,
from drac.c:14:
/home/yeled/dovecot-0.99.10-test7/src/lib/compat.h:17: #error uoff_t size not set
10:59 yeled@lazy:~/dovecot-0.99.10-test7$
weird? anyway test7 still does not fix these HAVE_MODULES issue.
<snip> creating src/master/Makefile creating src/pop3/Makefile creating src/pop3-login/Makefile creating stamp.h creating dovecot.spec creating config.h
Install prefix ...................... : /usr/local File offsets ........................ : 64bit Building with SSL support ........... : yes (OpenSSL) Building with IPv6 support .......... : yes Building with pop3 server ........... : yes Building with user database modules . : static passwd passwd-file Building with password lookup modules : passwd passwd-file 11:07 yeled@lazy:~/dovecot-0.99.10-test7$ grep MODU config.h /* #undef HAVE_MODULES */
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Thu, 2003-05-29 at 04:09, Charlie Allom wrote:
Thanks, but drac.so will not compile with this anymore.
In file included from drac.c:14: /home/yeled/dovecot-0.99.10-test7/src/lib/lib.h:6: ../../config.h: No such file or directory
That looks again like unconfigured dovecot source tree.
weird? anyway test7 still does not fix these HAVE_MODULES issue.
Right. I messed that up :) Get test8, that should do it.
On Fri, May 30, 2003 at 02:52:59AM +0300, Timo Sirainen wrote:
On Thu, 2003-05-29 at 04:09, Charlie Allom wrote:
Thanks, but drac.so will not compile with this anymore.
In file included from drac.c:14: /home/yeled/dovecot-0.99.10-test7/src/lib/lib.h:6: ../../config.h: No such file or directory
That looks again like unconfigured dovecot source tree.
yeah doesn't it. huh.
weird? anyway test7 still does not fix these HAVE_MODULES issue.
Right. I messed that up :) Get test8, that should do it.
You are so close.
May 30 10:20:46 lazy dovecot: Dovecot starting up May 30 10:20:49 lazy imap-login: Login: pia [203.31.232.2] May 30 10:20:49 lazy imap(pia): dlopen(/usr/local/lib/dovecot/imap/drac.so) failed: /usr/local/lib/dovecot/imap/drac.so: Undefined PLT symbol "dracauth" (symnum = 28)
That look really weird. Remember instead of -ldrac I used -I/usr/pkg/lib/libdrac.a
http://rubberduck.com/~yeled/NetBSD/dovecot.ktruss.3.txt
C.
-- charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Fri, 2003-05-30 at 03:25, Charlie Allom wrote:
dlopen(/usr/local/lib/dovecot/imap/drac.so) failed: /usr/local/lib/dovecot/imap/drac.so: Undefined PLT symbol "dracauth" (symnum = 28)
That look really weird. Remember instead of -ldrac I used -I/usr/pkg/lib/libdrac.a
-I? not -l? rather just give libdrac.a directly without either one.
But I'm not sure if that works. You may need to extract the libdrac.a and give the extracted .o files to gcc. Something like:
mkdir dracobj cd dracobj ar x /usr/pkg/lib/libdrac.a cd .. gcc drac.c ..etc.. dracobj/*.o
On Fri, May 30, 2003 at 04:43:09AM +0300, Timo Sirainen wrote:
On Fri, 2003-05-30 at 03:25, Charlie Allom wrote:
dlopen(/usr/local/lib/dovecot/imap/drac.so) failed: /usr/local/lib/dovecot/imap/drac.so: Undefined PLT symbol "dracauth" (symnum = 28)
That look really weird. Remember instead of -ldrac I used -I/usr/pkg/lib/libdrac.a
-I? not -l? rather just give libdrac.a directly without either one.
But I'm not sure if that works. You may need to extract the libdrac.a and give the extracted .o files to gcc. Something like:
mkdir dracobj cd dracobj ar x /usr/pkg/lib/libdrac.a cd .. gcc drac.c ..etc.. dracobj/*.o
It works! I admire your stamina.
May 30 12:02:15 lazy pop3-login: Login: pia [66.93.191.111]
*** authlog *** May 30 12:02:15 lazy rpcbind: connect from ::1 to getport/addr(900101) May 30 12:02:15 lazy rpcbind: connect from 127.0.0.1 to getport/addr(900101)
12:02 yeled@lazy:~$ db btree /usr/pkg/etc/dracd.db 203.31.232.2 1054261313 66.93.191.111 1054261335
I did exactly what you said above with test9.
Thanks Timo. Is it possible to get it to do this without using 'ar' ? I will work on this being incorporated into NetBSD pkgsrc as soon as I can make it a clean cut.
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Fri, 2003-05-30 at 05:08, Charlie Allom wrote:
It works! I admire your stamina.
Finally :)
Thanks Timo. Is it possible to get it to do this without using 'ar' ?
Well, did you try just giving the /usr/pkg/lib/libdrac.a to gcc? :) I remember there was some problems before with trying to give .a library to libtool, but looks like my gcc handles that just fine at least now.
On Fri, May 30, 2003 at 05:17:54AM +0300, Timo Sirainen wrote:
On Fri, 2003-05-30 at 05:08, Charlie Allom wrote:
It works! I admire your stamina.
Finally :)
Thanks Timo. Is it possible to get it to do this without using 'ar' ?
Well, did you try just giving the /usr/pkg/lib/libdrac.a to gcc? :) I remember there was some problems before with trying to give .a library to libtool, but looks like my gcc handles that just fine at least now.
You're right.
gcc picks it up fine. I will submit this to pkgsrc once you give out the next release .. as I have a feelign it is soon ?
Will you include drac.c ?
C.
charlie@rubberduck.com - Melbourne, Australia http://rubberduck.com/~yeled/ PGP: 0x14AA7941 || finger yeled@lazy.spodder.com
On Fri, 2003-05-30 at 07:11, Charlie Allom wrote:
gcc picks it up fine. I will submit this to pkgsrc once you give out the next release .. as I have a feelign it is soon ?
Depends, it'll come when people stop having problems with it :)
Will you include drac.c ?
No. I'll leave it to patches directory.
- On 2003.05.30, in 1054295941.23632.447.camel@hurina,
- "Timo Sirainen" tss@iki.fi wrote:
Will you include drac.c ?
No. I'll leave it to patches directory.
./configure --enable-drac ?
Shouldn't add any extra weight to the --disable-drac build.
-- -D. dgc@uchicago.edu NSIT University of Chicago When using any driving directions or map, it's a good idea to do a reality check and make sure the road still exists, watch out for construction, and follow all traffic safety precautions.
On Fri, 2003-05-30 at 17:32, David Champion wrote:
Will you include drac.c ? No. I'll leave it to patches directory.
./configure --enable-drac ?
Shouldn't add any extra weight to the --disable-drac build.
It's still extra bloat for most people. That's why I made it a plugin :) I don't think it really matters how it's distributed, and you most likely don't ever have to reinstall it when upgrading Dovecot.
- On 2003.06.04, in 1054745460.8867.20.camel@hurina,
- "Timo Sirainen" tss@iki.fi wrote:
On Fri, 2003-05-30 at 17:32, David Champion wrote:
Will you include drac.c ? No. I'll leave it to patches directory.
./configure --enable-drac ?
Shouldn't add any extra weight to the --disable-drac build.
It's still extra bloat for most people. That's why I made it a plugin :) I don't think it really matters how it's distributed, and you most likely don't ever have to reinstall it when upgrading Dovecot.
Oh, I don't care whether it's a plugin, I'm just looking for a way to add the compilation and installation of the plugin to the same command sequence as the rest of the build, so it can be automated somewhat more instead of having to read the drac.c file and figure out what commands to run based on your acquired knowledge of the build environment for the rest of the package, and type/paste those in manually.
I'm really, honestly, truly talking about a no-added-bloat approach. I'm just asking for configure to add a cc/ld for drac.so to the Makefile, if you specify --enable-drac.
-- -D. dgc@uchicago.edu NSIT University of Chicago When using any driving directions or map, it's a good idea to do a reality check and make sure the road still exists, watch out for construction, and follow all traffic safety precautions.
On Thu, 2003-06-05 at 03:52, David Champion wrote:
I'm really, honestly, truly talking about a no-added-bloat approach. I'm just asking for configure to add a cc/ld for drac.so to the Makefile, if you specify --enable-drac.
Well, for plugins in general I guess it could be good idea to be able to compile them easily. But I don't want to include the actual plugins, or anything specific to one plugin with the main dovecot package. Maybe something like --with-plugins=drac and it could find it from somewhere.. But it's not really important yet. DRAC plugin is special in the case that you don't have to compile it more than once. It uses only few dovecot functions which are unlikely to ever change, so you don't have to recompile it when building a new version of dovecot.
Timo Sirainen wrote:
Looks like BSDs don't have libdl which is why configure's test fails.
Correct. On FreeBSD, many administrators install the linux compatibility package, which results in libdl binaries being available under /usr/compat/linux/lib. I am guessing these should be usable as long as the system administrator has configured the kernel with linux support.
However, when building new software, one generally doesn't try pointing into /usr/compat/linux/* unless it's absolutely necessary. It's probably safest to just steer clear of the dependency.
On Thu, 2003-05-15 at 04:13, Charlie Allom wrote:
Doesn't look too difficult to implement. You'll just have to tell DRAC once in a while to keep the relay open.
Which relay? I assumed by calling drac, drac kept it's own DB with IPs.
Yea, that's what I meant :)
Try if the included patch works. You'll still need to add the needed libraries to Makefile.
Done. But doesn't update the dracdb.
Hmm. Probably because it called it the first time after one minute. Try adding drac_timeout(NULL); at the end of client_create() function?
participants (5)
-
Charlie Allom
-
David Champion
-
Joakim Ryden
-
Mike Brown
-
Timo Sirainen