pike.git / lib / modules / Protocols.pmod / SMTP.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/SMTP.pmod:55:    if(!server)    {    // Lookup MX record here (Using DNS.pmod)    object dns=master()->resolv("Protocols")["DNS"]->client();    server=dns->get_primary_mx(gethostname());    }       if(!port)    port = 25;    -  if(!connect(server, port)) +  if(!server || !connect(server, port))    {    throw(({"Failed to connect to mail server.\n",backtrace()}));    }       if(readreturncode()/100 != 2)    throw(({"Connection refused by SMTP server.\n",backtrace()}));       if(catch(cmd("EHLO "+gethostname())))    cmd("HELO "+gethostname(), "greeting failed.");    }