Milter.Milter Class Reference

A logging but otherwise do nothing Milter base class. More...

Inheritance diagram for Milter.Milter:
Milter.Base

List of all members.

Public Member Functions

def log
 Provide simple logging to sys.stdout.
def connect
 Called for each connection to the MTA.
def hello
 Called when the SMTP client says HELO.
def envfrom
def envrcpt
 Called when the SMTP client says RCPT TO.
def header
 Called for each header field in the message body.
def eoh
 Called at the blank line that terminates the header fields.
def eom
 Called at the end of the message body.
def abort
 Called when the connection is abnormally terminated.
def close
 Called when the connection is closed.

Detailed Description

A logging but otherwise do nothing Milter base class.

This is included for compatibility with previous versions of pymilter. The logging callbacks are marked @noreply.


Member Function Documentation

def Milter.Milter.abort (   self  ) 

Called when the connection is abnormally terminated.

The close callback is still called also.

Reimplemented from Milter.Base.

def Milter.Milter.close (   self  ) 

Called when the connection is closed.

Reimplemented from Milter.Base.

def Milter.Milter.connect (   self,
  hostname,
  family,
  hostaddr 
)

Called for each connection to the MTA.

Called by the xxfi_connect callback. The hostname provided by the local MTA is either the PTR name or the IP in the form "[1.2.3.4]" if no PTR is available. The format of hostaddr depends on the socket family:

socket.AF_INET
A tuple of (IP as string in dotted quad form, integer port)
socket.AF_INET6
A tuple of (IP as a string in standard representation, integer port, integer flow info, integer scope id)
socket.AF_UNIX
A string with the socketname

To vary behavior based on what port the client connected to, for example skipping blacklist checks for port 587 (which must be authenticated), use getsymval('{daemon_port}') . The {daemon_port} macro must be enabled in sendmail.cf

 O Milter.macros.connect=j, _, {daemon_name}, {daemon_port}, {if_name}, {if_addr}
 

or sendmail.mc

 define(`confMILTER_MACROS_CONNECT', ``j, _, {daemon_name}, {daemon_port}, {if_name}, {if_addr}'')dnl
 
Parameters:
hostname the PTR name or bracketed IP of the SMTP client
family socket.AF_INET, socket.AF_INET6, or socket.AF_UNIX
hostaddr a tuple or string with peer IP or socketname

Reimplemented from Milter.Base.

def Milter.Milter.envfrom (   self,
  f,
  str 
)
Called to begin each message.
f -> string		message sender
str -> tuple	additional ESMTP parameters

Reimplemented from Milter.Base.

def Milter.Milter.envrcpt (   self,
  to,
  str 
)

Called when the SMTP client says RCPT TO.

Called by the xxfi_envrcpt callback. Returning REJECT rejects the current recipient, not the entire message. The recipient is the "envelope" recipient as defined by RFC 5321. For recipients defined in RFC 5322, for example To: or Cc:, see the header callback .

Reimplemented from Milter.Base.

def Milter.Milter.eoh (   self  ) 

Called at the blank line that terminates the header fields.

Reimplemented from Milter.Base.

def Milter.Milter.eom (   self  ) 

Called at the end of the message body.

Most of the message manipulation actions can only take place from the eom callback.

Reimplemented from Milter.Base.

def Milter.Milter.header (   self,
  field,
  value 
)

Called for each header field in the message body.

Reimplemented from Milter.Base.

def Milter.Milter.hello (   self,
  hostname 
)

Called when the SMTP client says HELO.

Returning REJECT prevents progress until a valid HELO is provided; this almost always results in terminating the connection.

Reimplemented from Milter.Base.


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

Generated on 11 Jul 2015 for pymilter by  doxygen 1.6.1