Hi!
This is a patch to allow to set the location of the rcpthosts and
morercpthosts.cdb files from environment variables in the tcpserver
rules.
--- qmail-1.03/rcpthosts.c 1998-06-15 12:53:16.000000000 +0200
+++ current/rcpthosts.c 2006-12-27 09:17:45.805002963 +0100
@@ -14,10 +14,19 @@
int rcpthosts_init()
{
- flagrh = control_readfile(&rh,"control/rcpthosts",0);
+ char *x;
+ x = env_get("RCPTHOSTS");
+ if (x)
+ flagrh = control_readfile(&rh,x,0);
+ else
+ flagrh = control_readfile(&rh,"control/rcpthosts",0);
if (flagrh != 1) return flagrh;
if (!constmap_init(&maprh,rh.s,rh.len,0)) return flagrh = -1;
- fdmrh = open_read("control/morercpthosts.cdb");
+ x = env_get("MORERCPTHOSTS");
+ if (x)
+ fdmrh = open_read(x);
+ else
+ fdmrh = open_read("control/morercpthosts.cdb");
if (fdmrh == -1) if (errno != error_noent) return flagrh = -1;
return 0;
}
We are using it to run servers for different domains on different IP
addresses within the same qmail setup.
If there is a better way to allow specific domains in specific
qmail-smtpd invocations (read: services) then please let me know.
Greetings
--
Robert Sander Senior Manager Information Systems
Epigenomics AG Kleine Praesidentenstr. 1 10178 Berlin, Germany
phone:+49-30-24345-0 fax:+49-30-24345-555
http://www.epigenomics.com robert.sander@epigenomics.com
|