pymilter
1.0.5
|
Hold context for a milter connection. More...
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... | |
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.
def milter.milterContext.setpriv | ( | self, | |
priv | |||
) |
Attach a Python object to this connection context.
def milter.milterContext.setreply | ( | self, | |
rcode, | |||
xcode, | |||
* | msg | ||
) |
Calls smfi_setreply or smfi_setmlreply.
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.
stage | protocol stage in which the macro list should be used |
macrolist | a space separated list of macro names |
Referenced by Milter.Base.negotiate().