Greetings,
I've heard a couple of people ask about logging for MAPS rejections, and I
found that I wanted such a feature myself - so I grabbed a copy of the 1.15
source and added it. Making these changes adds a new log file in the \log
directory, log name begins with "maps" (the name is formatted like the
rest, with a date in the file name). The format of the log file is:
"Connecting IP" "Date/Time" "blocking maps domain"
I have no objection if this code were to find it's way into the
distribution set for XMail...:)
Tracy
----- ----- -----
For posterity sake, here are the modifications I made - all to SMTPSvr.cpp:
(beware word wrap of e-mail clients)
In the constant declarations sections, find:
#define SMTP_LOG_FILE "smtp"
After this line, add:
#define SMTP_MAPS_FILE "maps"
In the function declarations section, find the line:
static int SMTPLogSession(SMTPSession & SMTPS, char const *pszSender,
char const *pszRecipient, char const
*pszStatus,
unsigned long ulMsgSize);
After this line, add:
static int SMTPLogMaps(SMTPSession & SMTPS, char const *pszMapsName);
In the SMTPInitSession function, find the following line (in the section
commented as "Custom maps checking"):
if (SMTPCheckMapsList(SMTPS.PeerInfo, pszMapsList, szMapName,
sizeof(szMapName) - 1,
iMapCode) < 0)
{
After this line, add:
SMTPLogMaps(SMTPS.PeerInfo, szMapName);
In a convenient place (I placed it just following the SMTPLogSession
function), add the following:
static int SMTPLogMaps(SMTPSession & SMTPS, char const *pszMapsName)
{
char szTime[256] = "";
MscGetTimeNbrString(szTime, sizeof(szTime) - 1);
RLCK_HANDLE hResLock = RLckLockEX(SVR_LOGS_DIR SYS_SLASH_STR
SMTP_MAPS_FILE);
if (hResLock == INVALID_RLCK_HANDLE)
return (ErrGetErrorCode());
char szIP[128] = "???.???.???.???";
MscFileLog(SMTP_MAPS_FILE, "\"%s\""
"\t\"%s\""
"\t\"%s\""
"\n", SysInetNToA(SMTPS.PeerInfo, szIP), szTime, pszMapsName);
RLckUnlockEX(hResLock);
return (0);
}
-
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]