diff -Nur --exclude=configure --exclude=Makefile.in --exclude=aclocal.m4 --exclude=config.h.in nullmailer-1.00RC7/configure.in nullmailer-1.00RC7-zeroconf/configure.in
--- nullmailer-1.00RC7/configure.in	Fri Dec 27 15:23:57 2002
+++ nullmailer-1.00RC7-zeroconf/configure.in	Mon Jan 12 19:51:04 2004
@@ -22,6 +22,10 @@
 AC_CHECK_LIB(xnet, socket)
 AC_CHECK_LIB(inet, socket)
 AC_CHECK_LIB(socket, socket)
+AC_CHECK_LIB(pthread, pthread_mutexattr_init)
+AC_CHECK_LIB(salt, sw_salt_init)
+AC_CHECK_LIB(corby, sw_corby_orb_init)
+AC_CHECK_LIB(rendezvous,sw_rendezvous_browse_services)
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
@@ -29,7 +33,7 @@
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 dnl AC_CHECK_HEADERS(fcntl.h shadow.h crypt.h)
-AC_CHECK_HEADERS(sys/time.h unistd.h)
+AC_CHECK_HEADERS(sys/time.h unistd.h rendezvous/rendezvous.h rendezvous/text_record.h salt/verrno.h salt/log.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl AC_TYPE_UID_T
diff -Nur --exclude=configure --exclude=Makefile.in --exclude=aclocal.m4 --exclude=config.h.in nullmailer-1.00RC7/src/send.cc nullmailer-1.00RC7-zeroconf/src/send.cc
--- nullmailer-1.00RC7/src/send.cc	Fri Jan  3 21:58:31 2003
+++ nullmailer-1.00RC7-zeroconf/src/send.cc	Mon Jan 12 23:44:06 2004
@@ -39,11 +39,18 @@
 #include "itoa.h"
 #include "list.h"
 
+#include <rendezvous/rendezvous.h>
+#include <rendezvous/text_record.h>
+#include <salt/verrno.h>
+#include <salt/log.h>
+
 typedef list<mystring> slist;
 
 #define fail(MSG) do { ferr << MSG << endl; return false; } while(0)
 #define fail_sys(MSG) do{ ferr << MSG << strerror(errno) << endl; return false; }while(0)
 
+static int fds[2];
+
 struct remote
 {
   static const mystring default_proto;
@@ -52,11 +59,24 @@
   mystring proto;
   slist options;
   remote(const slist& list);
+  remote(const char * ip, const char * port);
   ~remote();
 };
 
 const mystring remote::default_proto = "smtp";
 
+/*
+ * this constructor is only here for constructing remote
+ * objects out of retrieved rendezvous configuration
+ */
+remote::remote(const char * ip, const char * port) {
+  host = mystring(ip);
+  proto = default_proto;
+  mystring portoption = "--port=";
+  portoption += mystring(port);
+  options.append(portoption);
+}
+
 remote::remote(const slist& lst)
 {
   slist::const_iter iter = lst;
@@ -98,20 +118,139 @@
 static rlist remotes;
 static int pausetime = 60;
 
+static void do_alarm(int sig) {
+  exit(1);
+}
+
+static sw_result my_resolver(sw_rendezvous_resolve_handler handler,
+                             sw_rendezvous rendezvous,
+                             sw_rendezvous_resolve_id id,
+                             sw_const_string name,
+                             sw_const_string type,
+                             sw_const_string domain,
+                             sw_ipv4_address address,
+                             sw_port port,
+                             sw_const_string text_record_string,
+                             sw_octets text_record,
+                             sw_ulong text_record_len,
+                             sw_opaque extra) {
+  char name_buf[16];
+  char int_buf[32];
+  char buf[64];
+  char len;
+  sw_rendezvous_stop_resolve(rendezvous, id);
+  sw_ipv4_address_name(address,buf,64);
+  strcat(buf,":");
+  strcat(buf,itoa(port));
+  len = strlen(buf);
+  write(fds[1],&len,sizeof(len));
+  write(fds[1],buf,len);
+  close(fds[1]);
+  exit(0);
+  return SW_OKAY;
+}
+
+static sw_result my_browser(sw_rendezvous_browse_handler handler,
+                            sw_rendezvous rendezvous,
+                            sw_rendezvous_browse_id id,
+                            sw_rendezvous_browse_status status,
+                            sw_const_string name,
+                            sw_const_string type,
+                            sw_const_string domain,
+                            sw_opaque extra) {
+  sw_rendezvous_resolve_id rid;
+
+  switch (status) {
+    case SW_RENDEZVOUS_BROWSE_ADD_SERVICE:
+      if (sw_rendezvous_resolve(rendezvous,name,type,domain,NULL,my_resolver,NULL,&rid)!=SW_OKAY) {
+        /* resolve failed */
+      }
+      break;
+      /* ignore other status codes */
+  }
+  return SW_OKAY;
+}
+
 bool load_remotes()
 {
   slist rtmp;
-  if(!config_readlist("remotes", rtmp) ||
-     rtmp.count() == 0)
-    return false;
-  remotes.empty();
-  for(slist::const_iter r(rtmp); r; r++) {
-    if((*r)[0] == '#')
-      continue;
-    slist parts;
-    if(!ws_split(*r, parts))
-      continue;
-    remotes.append(remote(parts));
+  if (getenv("USE_RENDEZVOUS")) {
+    remotes.empty();
+    sw_rendezvous session;
+    if (sw_rendezvous_init(&session)!=SW_OKAY) {
+      /* rendezvous initialization failed */
+      fout << "rendezvous initialization failed." << endl;
+      return false;
+    }
+    sw_rendezvous_browse_id id;
+    if (sw_rendezvous_browse_services(session,"_smtp._tcp.",NULL,NULL,my_browser,NULL,&id)!=SW_OKAY) {
+      fout << "rendezvous service browsing failed." << endl;
+      return false;
+    }
+    int rc;
+    if (pipe(fds)!=0) {
+      fout << "unable to create pipe." << endl;
+      return false;
+    }
+    rc = fork();
+    switch (rc) {
+    case -1: 
+      fout << "fork failed." << endl;
+      return false;
+    case 0:
+      /* child */
+      close(fds[0]); /* we only write to the pipe */
+      signal(SIGALRM,do_alarm);
+      alarm(5); /* set timeout to 5 seconds */
+      sw_rendezvous_run(session);
+      break;
+    default:
+      /* parent */
+      close(fds[1]); /* we only read from the pipe */
+      char len;
+      int x;
+      x = read(fds[0],&len,sizeof(len));
+      if (-1==x) {
+        /* fout << "read from pipe failed." << endl; */
+        return false;
+      }
+      {
+        char buf[len+1];
+        x = read(fds[0],buf,len);
+        if (-1==x) {
+           /* fout << "read from pipe failed." << endl; */
+           return false;
+        }
+        if (len!=x) {
+          /* fout << "error: read length doesn't fit announced length." << endl; */
+          return false;
+        }
+        buf[len] = 0;
+        char * x = strrchr(buf,':');
+        char * y = x+1;
+	if (x) {
+          *x = 0;
+          remotes.append(remote(buf,y));
+	} else {
+	  /* something went wrong, let's better not attach anything */
+	}
+      }
+    }
+    while (waitpid(0,NULL,WNOHANG)>0); /* let all childen die */
+    sw_rendezvous_fina(session);
+  } else {
+    if(!config_readlist("remotes", rtmp) ||
+       rtmp.count() == 0)
+      return false;
+    remotes.empty();
+    for(slist::const_iter r(rtmp); r; r++) {
+      if((*r)[0] == '#')
+        continue;
+      slist parts;
+      if(!ws_split(*r, parts))
+        continue;
+      remotes.append(remote(parts));
+    }
   }
   return remotes.count() > 0;
 }
