X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fdomain.c;h=304cf0ef846d9fc63ba9f863e05adf3c03bc20dd;hb=4eb74b26380dfde31c86c685f0589e0c653aebf0;hp=da1c9bf9544020d10f4d0314435b31f55bc8222b;hpb=1e656d277fe91b7c4f5d73eab4a0dd0b7a173145;p=citadel.git diff --git a/citadel/domain.c b/citadel/domain.c index da1c9bf95..304cf0ef8 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -3,6 +3,22 @@ * * DNS lookup for SMTP sender * + * + * Copyright (c) 1987-2009 by the citadel.org team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -102,9 +118,6 @@ int getmx(char *mxbuf, char *dest) { u_char bytes[1024]; HEADER header; } answer; -#else - char buf[SIZ]; - FILE *fp; #endif int ret; @@ -125,24 +138,7 @@ int getmx(char *mxbuf, char *dest) { /* * No smart-host? Look up the best MX for a site. - */ - -#ifndef HAVE_RESOLV_H - - /* - * On systems with b0rken or non-standard resolver libraries, learn - * the MX records by calling "nslookup" from the command line. - * - * Someday. - * - */ - - return(0); - -#else /* HAVE_RESOLV_H */ - - /* - * Make a call to the standard resolver library. + * Make a call to the resolver library. */ ret = res_query( @@ -167,7 +163,7 @@ int getmx(char *mxbuf, char *dest) { for (qdcount = ntohs(answer.header.qdcount); qdcount--; ptr += ret + QFIXEDSZ) { if ((ret = dn_skipname(ptr, endptr)) < 0) { - lprintf(CTDL_DEBUG, "dn_skipname error\n"); + CtdlLogPrintf(CTDL_DEBUG, "dn_skipname error\n"); return(0); } } @@ -216,7 +212,6 @@ int getmx(char *mxbuf, char *dest) { } } } -#endif /* HAVE_RESOLV_H */ /* Sort the MX records by preference */ if (num_mxrecs > 1) {