domain.c (42575) | domain.c (43730) |
---|---|
1/* 2 * Copyright (c) 1998 Sendmail, Inc. All rights reserved. 3 * Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved. 4 * Copyright (c) 1988, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * By using this file, you agree to the terms and conditions set 8 * forth in the LICENSE file which can be found at the top level of 9 * the sendmail distribution. 10 * 11 */ 12 13#include "sendmail.h" 14 15#ifndef lint 16#if NAMED_BIND | 1/* 2 * Copyright (c) 1998 Sendmail, Inc. All rights reserved. 3 * Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved. 4 * Copyright (c) 1988, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * By using this file, you agree to the terms and conditions set 8 * forth in the LICENSE file which can be found at the top level of 9 * the sendmail distribution. 10 * 11 */ 12 13#include "sendmail.h" 14 15#ifndef lint 16#if NAMED_BIND |
17static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (with name server)"; | 17static char sccsid[] = "@(#)domain.c 8.81 (Berkeley) 1/21/1999 (with name server)"; |
18#else | 18#else |
19static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (without name server)"; | 19static char sccsid[] = "@(#)domain.c 8.81 (Berkeley) 1/21/1999 (without name server)"; |
20#endif 21#endif /* not lint */ 22 23#if NAMED_BIND 24 25#include <errno.h> 26#include <resolv.h> 27#include <arpa/inet.h> --- 413 unchanged lines hidden (view full) --- 441char * 442bestmx_map_lookup(map, name, av, statp) 443 MAP *map; 444 char *name; 445 char **av; 446 int *statp; 447{ 448 int nmx; | 20#endif 21#endif /* not lint */ 22 23#if NAMED_BIND 24 25#include <errno.h> 26#include <resolv.h> 27#include <arpa/inet.h> --- 413 unchanged lines hidden (view full) --- 441char * 442bestmx_map_lookup(map, name, av, statp) 443 MAP *map; 444 char *name; 445 char **av; 446 int *statp; 447{ 448 int nmx; |
449 auto int rcode; | |
450 int saveopts = _res.options; 451 int i, len = 0; 452 char *p; 453 char *mxhosts[MAXMXHOSTS + 1]; 454 char buf[PSBUFSIZE / 2]; 455 456 _res.options &= ~(RES_DNSRCH|RES_DEFNAMES); | 449 int saveopts = _res.options; 450 int i, len = 0; 451 char *p; 452 char *mxhosts[MAXMXHOSTS + 1]; 453 char buf[PSBUFSIZE / 2]; 454 455 _res.options &= ~(RES_DNSRCH|RES_DEFNAMES); |
457 nmx = getmxrr(name, mxhosts, FALSE, &rcode); | 456 nmx = getmxrr(name, mxhosts, FALSE, statp); |
458 _res.options = saveopts; 459 if (nmx <= 0) 460 return NULL; 461 if (bitset(MF_MATCHONLY, map->map_mflags)) 462 return map_rewrite(map, name, strlen(name), NULL); 463 if ((map->map_coldelim == '\0') || (nmx == 1)) 464 return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av); 465 --- 448 unchanged lines hidden --- | 457 _res.options = saveopts; 458 if (nmx <= 0) 459 return NULL; 460 if (bitset(MF_MATCHONLY, map->map_mflags)) 461 return map_rewrite(map, name, strlen(name), NULL); 462 if ((map->map_coldelim == '\0') || (nmx == 1)) 463 return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av); 464 --- 448 unchanged lines hidden --- |