Thanks to GitHub for offering the host.
erisemail

eRisemail 电子邮件系统


<< 参考文档

反垃圾邮件引擎

09 May 2018; erisesoft; erisesoft@gmail.com


Brief

  • eRisemail system offers a feature with which user can extend or append the Anti-spam engines.
  • Engine is based on C or C++, as the dynamic librarys, a .so file, on Linux.

How to use

  1. Implement the features which you desire based on the framework codes(the code is in antispam directory).
  2. Compile to generate the engine - a .so file.
  3. For the security consideration, please stop the eRisemail service.
  4. Append a record of engine to eRisemail Filter List, /etc/erisemail/mfilter.xml
  5. Start the eRisemail service

Description of Filter List /etc/erisemail/mfilter.xml

  • This XML file storages all eRisemail Filter engines
  • All the engines that are listed will be invoked in any new MTA session (SMTP session) .
  • The invoked order follows the order listed in the XML file. libso refers to the path of the engine.
  • action means how to handle the spammail:
    • TAG will only toggle this mail as a spam, but still recieves and storages the mail.
    • DROP will discard spam mail directly .
  • param means the paramter for the filter

Interface of Development Framework

void* mfilter_init(const char* param)
  • Brief
    • Initiate the mfilter, invoked by MTA in a new session beginning
  • Parameter
    • Parameter for this filter
  • Return:
    • Return a filter’s handler
void mfilter_emaildomain(void* filter, const char* domain, unsigned int len)
  • Brief
    • Get the local email domain name
  • Parameter
    • The handler of the exist filter
  • Return
    • None
void mfilter_clientip(void* filter, const char* ip, unsigned int len)
  • Brief
    • Get the client site’s IP in a MTA session
  • Parameter
    • The handler of the exist filter
    • A pointer of the buffer which storage the ip * The length of buffer
  • Return
    • None
void mfilter_clientdomain(void * filter, const char* domain, unsigned int len)
  • Brief
    • Get the client site’s domai nname in a MTA session
  • Parameter
    • The handler of the exist filter
    • A pointer of the buffer which storage the domain name
    • The length of buffer
  • Return
    • None
void mfilter_mailfrom(void * filter, const char* from, unsigned int len)
  • Brief
    • Get the address of “MAIL FROM”
  • Parameter
    • The handler of the exist filter
    • A pointer of the buffer which storage the address of “MAIL FROM”
    • The length of buffer
  • Return
    • None
void mfilter_rcptto(void * filter, const char* to, unsigned int len)
  • Brief
    • Get the address of “RCPT TO”
  • Parameter
    • The handler of the exist filter
    • A pointer of the buffer which storage the address of “RCPT TO”
    • The length of buffer
  • Return
    • None
void mfilter_data(void * filter, const char* data, unsigned int len)
  • Brief
    • Get each line of mail body
  • Parameter
    • The handler of the exist filter
    • A pointer of the buffer which storage the mail body
    • The length of buffer
  • Return
    • None
void mfilter_eml(void * filter, const char* emlpath, unsigned int len)
  • Brief:
    • check the eml file
  • Parameter:
    • The handler of the exist filter
    • A zero teminated string to the eml file path
    • The length of path string
  • Return:
    • None
void mfilter_result(void * filter, int* isspam)
  • Brief
    • Get the result of filter
  • Parameter
    • The handler of the exist filter
    • The flag whether the mail is a spam mail. -1 is a general mail, other value is spam mail
  • Return
    • None
void mfilter_exit(void * filter)
  • Brief
    • Destory the filter
  • Parameter
    • The handler of the exist filter
  • Return
    • None

© 2019 erisesoft & uplusware