milter.milterContext Class Reference

Hold context for a milter connection. More...

List of all members.

Public Member Functions

def getsymval
 Calls smfi_getsymval.
def setreply
 Calls smfi_setreply or smfi_setmlreply.
def addheader
 Calls smfi_addheader.
def chgheader
 Calls smfi_chgheader.
def addrcpt
 Calls smfi_addrcpt.
def delrcpt
 Calls smfi_delrcpt.
def replacebody
 Calls smfi_replacebody.
def setpriv
 Attach a Python object to this connection context.
def getpriv
 Return the Python object attached to this connection context.
def quarantine
 Calls smfi_quarantine.
def progress
 Calls smfi_progress.
def chgfrom
 Calls smfi_chgfrom.
def setsymlist
 Tell the MTA which macro values we are interested in for a given stage.

Detailed Description

Hold context for a milter connection.

Each connection to sendmail creates a new SMFICTX struct within libmilter. The milter module in turn creates a milterContext tied to the SMFICTX struct via smfi_setpriv to hold a PyThreadState and a user defined Python object for the connection.

Most application interaction with libmilter takes places via the milterContext object for the connection. It is passed to callback functions as the first parameter.

The Milter module creates a python class for each connection, and converts function callbacks to instance method invocations.


Member Function Documentation

def milter.milterContext.addheader (   self,
  name,
  value,
  idx = -1 
)
def milter.milterContext.addrcpt (   self,
  rcpt,
  params = None 
)

Calls smfi_addrcpt.

def milter.milterContext.chgfrom (   self,
  sender,
  param = None 
)

Calls smfi_chgfrom.

def milter.milterContext.chgheader (   self,
  name,
  idx,
  value 
)
def milter.milterContext.delrcpt (   self,
  rcpt 
)

Calls smfi_delrcpt.

def milter.milterContext.getpriv (   self  ) 

Return the Python object attached to this connection context.

def milter.milterContext.getsymval (   self,
  sym 
)
def milter.milterContext.progress (   self  ) 

Calls smfi_progress.

def milter.milterContext.quarantine (   self,
  reason 
)
def milter.milterContext.replacebody (   self,
  data 
)
def milter.milterContext.setpriv (   self,
  priv 
)

Attach a Python object to this connection context.

Returns:
the old value or None
def milter.milterContext.setreply (   self,
  rcode,
  xcode,
  msg 
)

Calls smfi_setreply or smfi_setmlreply.

Parameters:
rcode SMTP response code
xcode extended SMTP response code
msg one or more message lines. If the MTA does not support multiline messages, only the first is used.
def milter.milterContext.setsymlist (   self,
  stage,
  macrolist 
)

Tell the MTA which macro values we are interested in for a given stage.

Of interest only when you need to squeeze a few more bytes of bandwidth. It may only be called from the negotiate callback. The protocol stages are M_CONNECT, M_HELO, M_ENVFROM, M_ENVRCPT, M_DATA, M_EOM, M_EOH. Calls smfi_setsymlist.

Parameters:
stage protocol stage in which the macro list should be used
macrolist a space separated list of macro names

The documentation for this class was generated from the following file:

Generated on 11 Jul 2015 for pymilter by  doxygen 1.6.1