pthread_mutex_t ActiveQItemsLock;
HashList *ActiveQItems = NULL;
HashList *QItemHandlers = NULL;
+const unsigned short DefaultMXPort = 25;
int max_sessions_for_outbound_smtp = 500; /* how many sessions might be active till we stop adding more smtp jobs */
int ndelay_count = 50; /* every n queued messages we will sleep... */
int delay_msec = 5000; /* this many seconds. */
{
char mxbuf[SIZ];
ParsedURL **Url = &MyQItem->URL;
- nRelays = get_hosts(mxbuf, "smarthost");
+ nRelays = get_hosts(mxbuf, "fallbackhost");
if (nRelays > 0) {
StrBuf *All;
StrBuf *One;
!IsEmptyStr(Pos)))
{
StrBufExtract_NextToken(One, All, &Pos, '|');
- if (!ParseURL(Url, One, 25)) {
+ if (!ParseURL(Url, One, DefaultMXPort)) {
SMTPC_syslog(LOG_DEBUG,
"Failed to parse: %s\n",
ChrPtr(One));
}
else {
- ///if (!Url->IsIP)) // todo dupe me fork ipv6
- Url = &(*Url)->Next;
+ (*Url)->IsRelay = 1;
+ MyQItem->HaveRelay = 1;
}
}
FreeStrBuf(&All);
FreeStrBuf(&One);
}
-
- Url = &MyQItem->FallBackHost;
- nRelays = get_hosts(mxbuf, "fallbackhost");
+ nRelays = get_hosts(mxbuf, "smarthost");
if (nRelays > 0) {
StrBuf *All;
StrBuf *One;
!IsEmptyStr(Pos)))
{
StrBufExtract_NextToken(One, All, &Pos, '|');
- if (!ParseURL(Url, One, 25)) {
+ if (!ParseURL(Url, One, DefaultMXPort)) {
SMTPC_syslog(LOG_DEBUG,
"Failed to parse: %s\n",
ChrPtr(One));
}
- else
- Url = &(*Url)->Next;
+ else {
+ ///if (!Url->IsIP)) // todo dupe me fork ipv6
+ (*Url)->IsRelay = 1;
+ MyQItem->HaveRelay = 1;
+ }
}
FreeStrBuf(&All);
FreeStrBuf(&One);
}
+
}
It = GetNewHashPos(MyQItem->MailQEntries, 0);
CtdlRegisterEVCleanupHook(smtp_evq_cleanup);
CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
- CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
+ CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER, PRIO_SEND + 10);
}
/* return our Subversion id for the Log */