pymilter  1.0.5
Public Member Functions | List of all members
milter.milterContext Class Reference

Hold context for a milter connection. More...

Inheritance diagram for milter.milterContext:

Public Member Functions

def getsymval (self, sym)
 Calls smfi_getsymval.
 
def setreply (self, rcode, xcode, *msg)
 Calls smfi_setreply or smfi_setmlreply. More...
 
def addheader (self, name, value, idx=-1)
 Calls smfi_addheader.
 
def chgheader (self, name, idx, value)
 Calls smfi_chgheader.
 
def addrcpt (self, rcpt, params=None)
 Calls smfi_addrcpt.
 
def delrcpt (self, rcpt)
 Calls smfi_delrcpt.
 
def replacebody (self, data)
 Calls smfi_replacebody.
 
def setpriv (self, priv)
 Attach a Python object to this connection context. More...
 
def getpriv (self)
 Return the Python object attached to this connection context.
 
def quarantine (self, reason)
 Calls smfi_quarantine.
 
def progress (self)
 Calls smfi_progress.
 
def chgfrom (self, sender, param=None)
 Calls smfi_chgfrom.
 
def setsymlist (self, stage, macrolist)
 Tell the MTA which macro values we are interested in for a given stage. More...
 

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

◆ setpriv()

def milter.milterContext.setpriv (   self,
  priv 
)

Attach a Python object to this connection context.

Returns
the old value or None

◆ setreply()

def milter.milterContext.setreply (   self,
  rcode,
  xcode,
msg 
)

Calls smfi_setreply or smfi_setmlreply.

Parameters
rcodeSMTP response code
xcodeextended SMTP response code
msgone or more message lines. If the MTA does not support multiline messages, only the first is used.

◆ setsymlist()

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
stageprotocol stage in which the macro list should be used
macrolista space separated list of macro names

Referenced by Milter.Base.negotiate().


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