Example #1
0
void enumeration(list_t *list, int port)
{
  char *ip;		/* PROG: ip address with open port */

  /*
   * traverse through list and gather the banner for each host
   */

  while(list->list_size > 0) {
    ip = NULL;
    list_remove((void **)&ip, list);
    get_banner(ip, port);
  }
}
Example #2
0
bool smtp_client::send_envelope(const mail_message& message)
{
	if (open() == false)
		return false;
	if (get_banner() == false)
		return false;
	if (greet() == false)
		return false;

	const char* user = message.get_auth_user();
	const char* pass = message.get_auth_pass();
	if (user && pass && auth_login(user, pass) == false)
		return false;

	const rfc822_addr* from = message.get_from();
	if (from == NULL)
	{
		logger_error("from null");
		return false;
	}
	if (mail_from(from->addr) == false)
		return false;
	return to_recipients(message.get_recipients());
}