Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
f28cab2d
Commit
f28cab2d
authored
Apr 18, 2013
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Doc updates
parent
76424c7c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/mainpage.py
+14
-11
14 additions, 11 deletions
doc/mainpage.py
doc/milter.py
+24
-6
24 additions, 6 deletions
doc/milter.py
with
38 additions
and
17 deletions
doc/mainpage.py
+
14
−
11
View file @
f28cab2d
...
...
@@ -7,30 +7,32 @@
# events include the initial connection from a MTA, the envelope sender and
# recipients, the top level mail headers, and the message body. There are
# options to mangle all of these components of the message as it passes through
# the milter.
# the
%
milter.
#
# At the next level, the <code>Milter</code> module (note the case difference)
# provides a Python friendly object oriented wrapper for the low level API. To
# use the Milter module, an application registers a 'factory' to create an
# object for each connection from a MTA to sendmail. These connection objects
# must provide methods corresponding to the libmilter callback
event
s.
# must provide methods corresponding to the libmilter
event
callbacks.
#
# Each
event
method returns a code to tell sendmail whether to proceed with
# Each
callback
method returns a code to tell sendmail whether to proceed with
# processing the message. This is a big advantage of milters over other mail
# filtering systems. Unwanted mail can be stopped in its tracks at the
# earliest possible point.
# earliest possible point. The callback return codes are
# milter.CONTINUE, milter.REJECT, milter.DISCARD, milter.ACCEPT,
# milter.TEMPFAIL, milter.SKIP, milter.NOREPLY.
#
# The
<code>
Milter.Base
</code>
class provides default implementations for
# The Milter.Base class provides default implementations for
# event methods that do nothing, and also provides wrappers for the libmilter
# methods to mutate the message. It automatically negotiates with MTA
# which protocol steps need to be processed by the milter, based on
# which protocol steps need to be processed by the
%
milter, based on
# which callback methods are overridden.
#
# The
<code>
Milter.Milter
</code>
class provides an alternate default
# implementation that logs the main milter
event
s, but otherwise does
nothing.
# It is provided for compatibility.
# The Milter.Milter class provides an alternate default
# implementation that logs the main milter
callback
s, but otherwise does
#
nothing.
It is provided for compatibility.
#
# The
<code>mime</code>
module provides a wrapper for the Python email package
# The
mime
module provides a wrapper for the Python email package
# that fixes some bugs, and simplifies modifying selected parts of a MIME
# message.
#
...
...
@@ -50,4 +52,5 @@
# You may find the
# <a href="http://docs.python.org/release/2.6.6/library/multiprocessing.html">
# multiprocessing</a> module useful. It can be a drop-in
# replacement for threading as illustrated in milter-template.
# replacement for threading as illustrated in
# <a href="milter-template_8py-example.html">milter-template.py</a>.
This diff is collapsed.
Click to expand it.
doc/milter.py
+
24
−
6
View file @
f28cab2d
...
...
@@ -3,7 +3,10 @@
## @package milter
#
# A thin wrapper around libmilter.
# A thin wrapper around libmilter. Most users will not import
# milter directly, but will instead import Milter and subclass
# Milter.Base. This module gives you ultimate low level control
# from python.
#
## Continue processing the current connection, message, or recipient.
...
...
@@ -169,6 +172,16 @@ def set_exception_policy(code): pass
# xxfi_data</a> callback, called when the DATA
# SMTP command is received.
def
register
(
name
,
negotiate
=
None
,
unknown
=
None
,
data
=
None
):
pass
## Attempt to create the socket used to communicate with the MTA.
# milter.opensocket() attempts to create the socket specified previously by a
# call to milter.setconn() which will be the interface between MTAs and the
# %milter. This allows the calling application to ensure that the socket can be
# created. If this is not called, milter.main() will do so implicitly.
# Calls <a href="https://www.milter.org/developers/api/smfi_opensocket">
# smfi_opensocket</a>. While not documented for libmilter, my experiments
# indicate that you must call register() before calling opensocket().
# @param rmsock Try to remove an existing unix domain socket if true.
def
opensocket
(
rmsock
):
pass
## Transfer control to libmilter.
...
...
@@ -199,12 +212,17 @@ def setbacklog(n): pass
# unix, inet, or inet6 socket. By default, a unix domain socket
# is used. It must not exist,
# and sendmail will throw warnings if, eg, the file is under a
# group or world writable directory.
# group or world writable directory. milter.setconn() will not fail with
# an invalid socket - this will be detected only when calling milter.main()
# or milter.opensocket().
# @param s the socket address in proto:address format
# <pre>
# setconn('unix:/var/run/pythonfilter')
# setconn('inet:8800') # listen on ANY interface
# setconn('inet:7871@@publichost') # listen on a specific interface
# setconn('inet6:8020')
# milter.setconn('unix:/var/run/pythonfilter') # a named pipe
# milter.setconn('local:/var/run/pythonfilter') # a named pipe
# milter.setconn('inet:8800') # listen on ANY interface
# milter.setconn('inet:7871@@publichost') # listen on a specific interface
# milter.setconn('inet6:8020')
# milter.setconn('inet6:8020@[2001:db8:1234::1]') # listen on specific IP
# </pre>
def
setconn
(
s
):
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment