X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fdomain.c;h=2e16a20afe7855ec7bc699dbead29bda24163fab;hb=HEAD;hp=c02aa303cae3c64686d573874a0a8b2d10ec18d8;hpb=3018b378044bf8351a2d843864740e6ca244989c;p=citadel.git diff --git a/citadel/domain.c b/citadel/domain.c deleted file mode 100644 index c02aa303c..000000000 --- a/citadel/domain.c +++ /dev/null @@ -1,95 +0,0 @@ -#include -#include -#include -#include -#include -#include "sysdep_decls.h" -#include "domain.h" - -#define SMART_HOST "gatekeeper.wdcs.com" - -/* - * getmx() - * - * Return one or more MX's for a mail destination. - * - * Upon success, it fills 'mxbuf' with one or more MX hosts, separated by - * vertical bar characters, and returns the number of hosts as its return - * value. If no MX's are found, it returns 0. - * - */ -int getmx(char *mxbuf, char *dest) { - char answer[1024]; - int ret; - unsigned char *startptr, *endptr, *ptr; - int expanded_size; - char expanded_buf[1024]; - unsigned short pref, type; - int n; - - - /* If we're configured to send all mail to a smart-host, then our - * job here is really easy. - */ - if (1) { /* FIX */ - strcpy(mxbuf, SMART_HOST); - return(1); - } - - /* No smart-host? Look up the best MX for a site. - */ - ret = res_query( - dest, - C_IN, T_MX, answer, sizeof(answer) ); - - lprintf(9, "res_query() returned %d\n", ret); - - if (ret < 0) { - lprintf(5, "No MX found\n"); - return(0); - } - - /* If we had to truncate, shrink the number to avoid fireworks */ - if (ret > sizeof(answer)) - ret = sizeof(answer); - lprintf(9, "size of answer is %d\n", ret); - - startptr = &answer[0]; /* start and end of buffer */ - endptr = &answer[ret]; - - ptr = startptr + HFIXEDSZ; /* advance past header */ - - while(1) { - memset(expanded_buf, 0, sizeof(expanded_buf)); - ret = dn_expand(startptr, - endptr, - ptr, - expanded_buf, - sizeof(expanded_buf) - ); - if (ret < 0) break; - ptr += ret; - - GETSHORT(type, ptr); - ptr += INT16SZ + INT32SZ; - GETSHORT(n, ptr); - ptr += n; - - lprintf(9, "ret=%d, type=%d\n", ret, type); - } - - - - - - - - - - - - - - /* FIX not done yet */ - return(0); -}