Ejemplo n.º 1
0
static int init(void)
{
  const char* tmp;

  if ((tmp = getprotoenv("LOCALHOST")) == 0) tmp = UNKNOWN;
  str_copys(&domain_name, tmp);

  if ((tmp = getenv("SMTPGREETING")) != 0)
    str_copys(&str_welcome, tmp);
  else {
    str_copy(&str_welcome, &domain_name);
    str_cats(&str_welcome, " mailfront");
  }
  str_cats(&str_welcome, " ESMTP");

  if ((tmp = getenv("MAXNOTIMPL")) != 0)
    maxnotimpl = strtoul(tmp, 0, 10);

  if (!str_cats(&init_capabilities, "8BITMIME\nENHANCEDSTATUSCODES\nPIPELINING")) {
    respond(&resp_oom);
    return 1;
  }

  return 0;
}
Ejemplo n.º 2
0
static const response* sq_init(void)
{
  linkproto = getprotoenv(0);
  local_ip = getprotoenv("LOCALIP");
  remote_ip = getprotoenv("REMOTEIP");
  local_host = getprotoenv("LOCALHOST");
  remote_host = getprotoenv("REMOTEHOST");
  remote_port = getprotoenv("REMOTEPORT");
  local_port = getprotoenv("LOCALPORT");

  if(!local_ip) local_ip = "0.0.0.0";
  if(!remote_port) remote_port = "??";

  atexit(dosqlog);

  return 0;
}