Exemplo n.º 1
0
eNextState get_one_mx_host_ip(AsyncIO *IO)
{
	SmtpOutMsg * Msg = IO->Data;
	/*
	 * here we start with the lookup of one host. it might be...
	 * - the relay host *sigh*
	 * - the direct hostname if there was no mx record
	 * - one of the mx'es
	 */
	SetSMTPState(IO, (Msg->pCurrRelay->IPv6)?eSTMPalookup:eSTMPaaaalookup);

	EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);

	EVS_syslog(LOG_DEBUG,
		  "looking up %s-Record %s : %d ...\n",
		  (Msg->pCurrRelay->IPv6)? "aaaa": "a",
		  Msg->pCurrRelay->Host,
		  Msg->pCurrRelay->Port);

	if (!QueueQuery((Msg->pCurrRelay->IPv6)? ns_t_aaaa : ns_t_a,
			Msg->pCurrRelay->Host,
			&Msg->IO,
			&Msg->HostLookup,
			get_one_mx_host_ip_done))
	{
		Msg->MyQEntry->Status = 5;
		StrBufPrintf(Msg->MyQEntry->StatusMessage,
			     "No MX hosts found for <%s>", Msg->node);
		Msg->IO.NextState = eTerminateConnection;
		return IO->NextState;
	}
	IO->NextState = eReadDNSReply;
	return IO->NextState;
}
Exemplo n.º 2
0
eNextState resolve_mx_records(AsyncIO *IO)
{
	SmtpOutMsg * Msg = IO->Data;

	SetSMTPState(IO, eSTMPmxlookup);

	EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
	/* start resolving MX records here. */
	if (!QueueQuery(ns_t_mx,
			Msg->node,
			&Msg->IO,
			&Msg->MxLookup,
			smtp_resolve_mx_record_done))
	{
		Msg->MyQEntry->Status = 5;
		StrBufPrintf(Msg->MyQEntry->StatusMessage,
			     "No MX hosts found for <%s>", Msg->node);
		return IO->NextState;
	}
	Msg->IO.NextState = eReadDNSReply;
	return IO->NextState;
}
Exemplo n.º 3
0
eNextState pop3_get_one_host_ip(AsyncIO *IO)
{
	pop3aggr *cpptr = IO->Data;

	cpptr->IOStart = IO->Now;

	EVP3CCS_syslog(LOG_DEBUG, "POP3: %s\n", __FUNCTION__);

	EVP3CCS_syslog(LOG_DEBUG, 
		       "POP3 client[%ld]: looking up %s-Record %s : %d ...\n",
		       cpptr->n,
		       (cpptr->IO.ConnectMe->IPv6)? "aaaa": "a",
		       cpptr->IO.ConnectMe->Host,
		       cpptr->IO.ConnectMe->Port);

	QueueQuery((cpptr->IO.ConnectMe->IPv6)? ns_t_aaaa : ns_t_a,
		   cpptr->IO.ConnectMe->Host,
		   &cpptr->IO,
		   &cpptr->HostLookup,
		   pop3_get_one_host_ip_done);
	IO->NextState = eReadDNSReply;
	return IO->NextState;
}
Exemplo n.º 4
0
void Database::QueueQuery( const char* query, int callback, int flags, int callbackref )
{
	Query* newquery = new Query( query, callback, flags, callbackref );

	QueueQuery( newquery );
}