Hi All,
According to *http://tinyurl.com/6g9ze,
###############################
*
If a message that has as target domain of '*sub1.sub2.domain.net*'
arrives at the XMail server, '*AND*' XMail does not have a real domain
'*sub1.sub2.domain.net*' inside its domain list, XMail decides if this
domain gets a custom domain processing by trying to lookup:
sub1.sub2.domain.net.tab
..sub2.domain.net.tab
..domain.net.tab
..net.tab
..tab
###############################
*
*Now this works very well when XMail is sending a mail, checkout this
code in SMAILUtils.cpp:
int USmlGetDomainMsgCustomFile(SPLF_HANDLE hFSpool, QUEUE_HANDLE hQueue,
QMSG_HANDLE hMessage, char const *pszDestDomain,
char *pszCustFilePath)
{
<snip>
..
..
..
</snip>
///////////////////////////////////////////////////////////////////////////////
// Check if this is a custom domain
///////////////////////////////////////////////////////////////////////////////
char szCustDomainFile[SYS_MAX_PATH] = "";
if (USmlGetDomainCustomFile(pszDestDomain, szCustDomainFile) < 0)
return (ErrGetErrorCode());
RLCK_HANDLE hResLock = RLckLockSH(szCustDomainFile);
<snip>
..
..
..
</snip>
}
*However it works differently when XMail is receiving a mail for
delivery, that is if the destination domain is a custom domain:*
Checkout this code in SMTPSvr.cpp:
static int SMTPHandleCmd_RCPT(const char *pszCommand, BSOCK_HANDLE
hBSock, SMTPSession & SMTPS)
{
<snip>
..
..
..
</snip>
///////////////////////////////////////////////////////////////////////////////
// Check FORWARD PATH
///////////////////////////////////////////////////////////////////////////////
char *pszRealRcpt = NULL;
char *pszSMTPError = NULL;
if (SMTPCheckForwardPath(ppszFwdDomains, SMTPS, pszRealRcpt,
pszSMTPError) < 0) {
ErrorPush();
StrFreeStrings(ppszFwdDomains);
SMTPSendError(hBSock, SMTPS, "%s", pszSMTPError);
SysFree(pszSMTPError);
return (ErrorPop());
}
StrFreeStrings(ppszFwdDomains);
<snip>
..
..
..
</snip>
}
In above SMTPCheckForwardPath calls *USmlDomainCustomFileName* which is
_very similar_ to *USmlGetDomainCustomFile* in above, Checkout the diff
of two functions:
1c1
< int USmlDomainCustomFileName(char const *pszDestDomain, char
*pszCustFilePath)
---
> int USmlGetDomainCustomFile(char const *pszDestDomain, char
*pszCustFilePath)
12c12
< // Build file name
---
> // Lookup custom files
18c18,21
< SysSNPrintf(pszCustFilePath, SYS_MAX_PATH - 1, "%s%s.tab",
szCustomDir, szDestDomain);
---
> for (char const *pszSubDom = szDestDomain; pszSubDom != NULL;
> pszSubDom = strchr(pszSubDom + 1, '.')) {
> SysSNPrintf(pszCustFilePath, SYS_MAX_PATH - 1, "%s%s.tab",
szCustomDir,
> pszSubDom);
20c23,24
< return (0);
---
> if (SysExistFile(pszCustFilePath))
> return (0);
22c26,31
< }
---
> }
>
> SysSNPrintf(pszCustFilePath, SYS_MAX_PATH - 1, "%s.tab",
szCustomDir);
>
> if (SysExistFile(pszCustFilePath))
> return (0);
23a33,36
> ErrSetErrorCode(ERR_NOT_A_CUSTOM_DOMAIN);
> return (ERR_NOT_A_CUSTOM_DOMAIN);
>
> }
Any clue why Custom Domain is different with respect to sending (SMAIL)/
receiving (SMTP) file ?
Thanks
-VK
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]