Main Page | Compound List | File List | Compound Members | File Members

MailHeader.h

00001 
00002 #ifndef MAILHEADER_H
00003 #define MAILHEADER_H
00004 
00005 /*
00006   This email filter was written by Ian Kaplan, Bear Products
00007   International.  It is copyrighted by Ian Kaplan, 2004,
00008   www.bearcave.com.
00009 
00010   You have permission to use this software without restriction on two
00011   conditions:
00012 
00013     1. You must preserve this copyright notice in this software and
00014        any software derived from it.
00015 
00016     2. You accept any risk entailed in using this software.  By
00017        using this software, you acknowledge that you have a
00018        sophisticated background in software engineering and 
00019        understand the way this software functions.  You further
00020        acknowledge that using this software may result in the
00021        irretrievable loss of important e-email and you alone
00022        are responsible for this loss.
00023 
00024   If either of these conditions are unacceptable, you may not use any
00025   part of this software.
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

Generated on Sat Mar 27 13:07:38 2004 for Mail Filter by doxygen 1.3.3