There is no difference integrating to qmail or qmail-ldap. In fact it's the
layer before the qmail-queue. My solution is simply to replace the qmail-queue
binary with the code :
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
char *spamd_host = "spamd.superonline.com";
int main()
{
int pfds[2];
int childpid;
if ( pipe(pfds) == -1 ) {
perror("Failed to create pipe; quitting\n");
exit(1);
}
if ( ( childpid=fork() ) == -1 ) {
perror("Failed to fork; quitting\n");
exit(2);
}
if ( childpid == 0 ) {
close(1); /* close normal stdout */
dup(pfds[1]); /* make stdout same as pfds[1] */
close(pfds[0]); /* we don't need this */
execlp("/usr/bin/spamc", "/usr/bin/spamc", "-d",spamd_host, NULL);
} else {
close(0); /* close normal stdin */
dup(pfds[0]); /* make stdin same as pfds[0] */
close(pfds[1]); /* we don't need this */
execlp("/mail/qmail/bin/qmail-queue.orig",
"/mail/qmail/bin/qmail-queue.orig", NULL);
}
}
where qmail-queue.orig is the original qmail-queue binary...
Derya
Istanbul
Bu e-posta mesaji ve ekleri sadece gonderildigi kisi veya kuruma ozeldir. Eger
dogru kisiye ulasmadigini dusunuyorsaniz, bu mesajin yonlendirilmesi,
kopyalanmasi veya herhangi bir sekilde kullanilmasi yasaktir.Mesaj iceriginde
bulunan fikir ve yorumlar, SUPERONLINE'a degil sadece gondericiye aittir. Bu
mesaj bilinen tum viruslere karsi test edilmistir.
This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you are not the intended recipient you are hereby notified that any
dissemination, copying or use of the information is prohibited. The opinions
expressed in this message belong to sender alone. There is no implied
endorsement by SUPERONLINE.This e-mail has been scanned for all known computer
viruses.