# Sample MeTA1 configuration file for Grecs testsuite.

hostname = "host.example.org";

smtps {
  greeting = "220 example.org ESMTP Tossudament alcats\r\n";
  log_level = 12;
  log { facility=mail; ident="smtps"; }
  flags = { 8bitmime,
            access };
  CDB_gid = 2262;
  wait_for_server = 4;
  listen_socket { type=inet; port = 25; }
  start_action = pass;
  pass_fd_socket = smtps/smtpsfd;
  user = meta1s;
  path = "/usr/local/libexec/smtps";
  arguments = "smtps -f /etc/meta1/meta1.conf";
  policy_milter {
    socket {
      type = inet;
      address = 127.0.0.1;
      port = 3333;
    };
    timeout = 1800s; 
    flags = { accept_but_reconnect };
  };
  io_timeout = 300s;
  module_timeout = 1000s;
  auth {
    flags = { noanonymous };
  }  
}

smtps MSA {
       log_level = 11;
       log { facility=mail; ident="MSA"; }
       CDB_gid = 2262;
       listen_socket { type=inet; port = 587; }
       start_action = pass;
       pass_fd_socket = smtps/msafd;
       user = meta1s;
       path = "/usr/local/libexec/smtps";
       arguments = "smtps -I 1 -N MSA -f /etc/meta1/meta1.conf";
}

smtpc {
  log_level = 12;
  log { facility=mail; ident="smtpc"; }
  flags = { read_QUIT_reply,
            separate_final_dot_and_QUIT,
            talk_to_myself };
  LMTP_socket="lmtpsock";
  wait_for_server = 4;
  start_action = wait;
  user = meta1c;
  path = "/usr/local/libexec/smtpc";
  arguments = "smtpc -f /etc/meta1/meta1.conf";
}

# must be previous to last in the list: started after smar
qmgr {
  log_level = 12;
  log { facility=mail; ident="qmgr"; }
  wait_for_server = 4;
  wait_for_client = 3;
  start_action = wait;
  user = meta1q;
  restart_dependencies = { smtps, MSA, smtpc };
  path = "/usr/local/libexec/qmgr";
  arguments = "qmgr -f /etc/meta1/meta1.conf";
  control_socket = "qmgr/sock";
}


# must be last in the list: started first
smar {
  DNS { nameservers={ 10.11.0.1, 10.12.0.1 };
        flags = use_connect; }
  log_level = 12;
  log { facility=mail; ident="smar"; }
  nameserver = 10.11.0.1;
  start_action = wait;
  user = meta1m;
  restart_dependencies = { smtps, MSA, qmgr };
  path = "/usr/local/libexec/smar";
  arguments = "smar -f /etc/meta1/meta1.conf";

  map mtdb {
        type = hash;
        file = "mt.db";
  }
  mailertable {
        name = mtdb;
        flags = { full_address, domain };
  }
  
  map password { type = passwd; }
  map userdb {
	type = socket;
	path = "/var/spool/meta1/smap/userdb";
	mapname = userdb;
	min_connections = 10;
	max_connections = 1024;
        timeout = 5;
  }
  map locusr {
	type = sequence;
	maps = { password, userdb };
  }
	
  local_user_map {
       name = "locusr";
       flags = { localpart, local_domains };
  }

  map lum { 
	type = socket;
	path = "/var/spool/meta1/smap/userdb";
	mapname = alias; 
	min_connections = 10;
	max_connections = 1024;
	timeout = 6;
  }
  map stdal { file = "aliases.db"; type = hash; }
  map ali { type = sequence; maps = { lum,stdal }; }
  aliases {
	name = ali;
	flags =	{ localpart, local_domains };
  }

  map acc { type = socket; address = 127.0.0.1; port = 1025; mapname = access; }
  access_map {
      name = acc;
  }
}
