Box 24

 Home   Infos   Tipps   Webmail   Humor   Polizei   Gästebuch   Downloads   Chat   Suchen   Feedback   Links 

 

 Anmelden/Login   Neuanmeldung/New User   Java Telnet Applet   Telnet   
 

SMTPFilter Hook

(since 5.6.450.3)

Wildcat! SMTP now supports the ability to pass incoming mail to a wcBASIC hook called SMTPFilter.wcx. Click here for an example smtpfilter wcbasic program.

Update

(since 5.6.450.7)

WcSMTP will now look for the SmtpFilterHookLoader.wcx before looking for SmtpFilter.wcx.

The purpose to is support a multi-hook layer system. If you are currently using SFHOOK.ZIP and you renamed SmtpFilterHookLoader.wcx to SMTPFILTER.WCX, you should rename it back or delete it and unzip the original smtpfilterhookloader.wcx from SFHOOK.ZIP

The SmtpFilterHookLoader.wcx program is designed to run each program listed in the data\smtpfilter-hooklist.txt file one at a time.

Examples

Simple SMTPFilter.wcc

////////////////////////////////////////////////////////////////////
// file : smtpfilter.wcc
// date : 08/23/2002
//
// smtpfilter.wcc is an optional hook for wcSMTP mail filtering.
// Wildcat! v5.6.450.3 is required.
//
// If smptfilter.wcx exist and the registry value EnableReceiverBin
// is enabled, then this wcx will be called after the email is received
// and before the final response is sent. The filter can determine
// the final message handling by setting the GlobalResult value.
//
////////////////////////////////////////////////////////////////////

#include <htmlutil.wch>
#include <cmdline.wch>

// read name/value data passed by wcSMTP.EXE when the message
// is received.

dim args as string = paramstr(1)
dim userid as integer = GetParamInt(args,"uid") // user id, if authenticated
dim fname as string = GetParamStr(args,"psf") // message file name
dim rpath as string = GetParamStr(args,"rsp") // router prespool path
dim ip as string = GetParamStr(args,"ip") // client ip address
dim helo as string = GetParamStr(args,"cdn") // client domain name
dim host as string = GetParamStr(args,"hdn") // host domain name
dim from as string = GetParamStr(args,"from") // sender address
dim rcpt as string = GetParamStr(args,"rcpt") // recipient address

WriteLogEntry("smtpfilter.log","---------------------------------------")
WriteLogEntry("smtpfilter.log","uid : "+str(userid))
WriteLogEntry("smtpfilter.log","file : "+fname)
WriteLogEntry("smtpfilter.log","rpath : "+rpath)
WriteLogEntry("smtpfilter.log","ip : "+ip)
WriteLogEntry("smtpfilter.log","helo : "+helo)
WriteLogEntry("smtpfilter.log","host : "+host)
WriteLogEntry("smtpfilter.log","from : "+from)
WriteLogEntry("smtpfilter.log","rcpt : "+rcpt)

// Set GlobalResult to finalize the handling of the message file

// GlobalResult Comment
// ------------ -------
// TRUE (-1) pass, message moved to the router prespool for delivery
// FALSE (0) fail, 451 response is issued, message discarded
// 1 same as TRUE (-1)
// 2 pass, message stays in receiver bin
// 3 pass, however, message was moved/deleted by filter

//GlobalResult = 2 // hold message in receiver bin
GlobalResult = TRUE // continue with mail delivery

WriteLogEntry("smtpfilter.log","result: "+str(GlobalResult))

© 2002/2003 Hector Santos, http://www.santronics.com