Changeset 295 for trunk/src/sh_mail.c


Ignore:
Timestamp:
Oct 31, 2010, 10:36:04 AM (14 years ago)
Author:
katerina
Message:

Support for IPv6 (ticket #222).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_mail.c

    r290 r295  
    6262#include "sh_mail_int.h"
    6363#include "sh_nmail.h"
     64#include "sh_ipvx.h"
    6465
    6566#undef  FIL__
     
    11131114  (void) fflush(connFile);
    11141115
    1115   if (0 != is_numeric(sh.host.name))
     1116  if (0 != sh_ipvx_is_numeric(sh.host.name))
    11161117    {
    11171118      sl_snprintf(error_msg, sizeof(error_msg), "HELO [%s]",
     
    11251126  report_smtp(error_msg);
    11261127
    1127   if (0 != is_numeric(sh.host.name))
     1128  if (0 != sh_ipvx_is_numeric(sh.host.name))
    11281129    fprintf(connFile, _("HELO [%s]%c%c"), sh.host.name, 13, 10);
    11291130  else
     
    11501151    {
    11511152      (void) sl_strlcat (this_address, "@", 256);
    1152       if (0 != is_numeric(sh.host.name))
     1153      if (0 != sh_ipvx_is_numeric(sh.host.name))
    11531154        (void) sl_strlcat (this_address, _("example.com"), 256);
    11541155      else
     
    18661867  mx     * result;
    18671868  dnsrep * retval;
     1869  char   * address = NULL;
    18681870  char     errmsg[128];
    1869   size_t   len;
    18701871
    18711872  SL_ENTER(_("return_mx"));
     
    18841885  else
    18851886    {
     1887      char numeric[SH_IP_BUF];
     1888
    18861889      if (domain != NULL)
    18871890        {
     
    19041907        }
    19051908
    1906       SH_MUTEX_LOCK(mutex_resolv);
    1907 
     1909      retval = NULL;
    19081910      host   = NULL;
    1909       retval = NULL;
    19101911
    19111912      if (domain != NULL)
    1912         host = /*@-unrecog@*/sh_gethostbyname (domain)/*@+unrecog@*/;
    1913 
    1914       if (host)
     1913        address = sh_ipvx_canonical(domain, numeric, sizeof(numeric));
     1914
     1915      if (address)
    19151916        {
    19161917          result       = SH_ALLOC (sizeof (mx));
     
    19191920          retval->count = 1;
    19201921          result->pref  = 0;
    1921           /*@-type@*/
    1922           len = strlen (host->h_name) + 1;
    1923           result->address = SH_ALLOC (len);
    1924           sl_strlcpy (result->address, host->h_name, len);
    1925           /*@+type@*/
    1926         }
    1927       SH_MUTEX_UNLOCK(mutex_resolv);
    1928 
    1929       if (!host)
     1922
     1923          result->address = address;
     1924        }
     1925      else
    19301926        {
    19311927#ifdef FIL__
Note: See TracChangeset for help on using the changeset viewer.