00001
00002 #ifndef MAILHEADER_H
00003 #define MAILHEADER_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <stdio.h>
00030
00031 #include "HeaderInfo.h"
00032 #include "MailFilter.h"
00033
00057 class MailHeader
00058 {
00059 private:
00060 Logger log;
00061 SpamParameters &mParams;
00062 HeaderInfo &mHeadInfo;
00063 bool foundValidAddress;
00064
00065 char boundaryStr[128];
00066 char pushBackBuf[1024];
00067 char *pPushBack;
00068
00069 private:
00070 void saveBoundary(const char *pBound);
00071 void fillInSections(FILE *fp);
00072 MailFilter::classification checkReceived(const char *buf, FILE *fp, size_t line);
00073 MailFilter::classification checkSubject(const char *buf, FILE *fp);
00074 MailFilter::classification checkFrom(const char *buf );
00075 bool addrContinues(const char *buf);
00076 MailFilter::classification checkDomainAddrs(const char *domainName,
00077 const char *pBuf);
00078 MailFilter::classification checkAddressSection(const char *buf, FILE *fp);
00079
00080 public:
00081 MailHeader(SpamParameters &p, HeaderInfo &headInfo);
00082 MailFilter::classification parseContentType(FILE* fp,
00083 char *buf );
00084 const char *getBoundaryStr();
00085 MailFilter::classification checkHeader(FILE *fp);
00086 };
00087
00088 inline
00089 const char *
00090 MailHeader::getBoundaryStr()
00091 {
00092 return boundaryStr;
00093 }
00094
00095 #endif