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
c9f0c94b
Commit
c9f0c94b
authored
18 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Reject multiple recipients to DSN.
Auto-disable gossip on DB error.
parent
59bf86e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bms.py
+18
-5
18 additions, 5 deletions
bms.py
doc/links.h
+1
-0
1 addition, 0 deletions
doc/links.h
with
19 additions
and
5 deletions
bms.py
+
18
−
5
View file @
c9f0c94b
#!/usr/bin/env python
#!/usr/bin/env python
# A simple milter that has grown quite a bit.
# A simple milter that has grown quite a bit.
# $Log$
# $Log$
# Revision 1.72 2006/11/22 16:31:22 customdesigned
# SRS domains were missing srs_reject check when SES was active.
#
# Revision 1.71 2006/11/22 01:03:28 customdesigned
# Revision 1.71 2006/11/22 01:03:28 customdesigned
# Replace last use of deprecated rfc822 module.
# Replace last use of deprecated rfc822 module.
#
#
...
@@ -807,14 +810,19 @@ class bmsMilter(Milter.Milter):
...
@@ -807,14 +810,19 @@ class bmsMilter(Milter.Milter):
or
domain
in
blacklist
:
or
domain
in
blacklist
:
self
.
blacklist
=
True
self
.
blacklist
=
True
self
.
log
(
"
BLACKLIST
"
,
self
.
canon_from
)
self
.
log
(
"
BLACKLIST
"
,
self
.
canon_from
)
global
gossip
if
gossip
and
domain
and
rc
==
Milter
.
CONTINUE
:
if
gossip
and
domain
and
rc
==
Milter
.
CONTINUE
:
if
self
.
spf
and
self
.
spf
.
result
==
'
pass
'
:
if
self
.
spf
and
self
.
spf
.
result
==
'
pass
'
:
qual
=
'
SPF
'
qual
=
'
SPF
'
else
:
else
:
qual
=
self
.
connectip
qual
=
self
.
connectip
try
:
self
.
umis
=
gossip
.
umis
(
domain
+
qual
,
self
.
id
+
time
.
time
())
self
.
umis
=
gossip
.
umis
(
domain
+
qual
,
self
.
id
+
time
.
time
())
res
,
hdr
,
val
=
gossip_node
.
query
(
self
.
umis
,
domain
,
qual
,
1
)
res
,
hdr
,
val
=
gossip_node
.
query
(
self
.
umis
,
domain
,
qual
,
1
)
self
.
add_header
(
hdr
,
val
)
self
.
add_header
(
hdr
,
val
)
except
:
gossip
=
None
raise
return
rc
return
rc
def
check_spf
(
self
):
def
check_spf
(
self
):
...
@@ -958,8 +966,8 @@ class bmsMilter(Milter.Milter):
...
@@ -958,8 +966,8 @@ class bmsMilter(Milter.Milter):
def
envrcpt
(
self
,
to
,
*
str
):
def
envrcpt
(
self
,
to
,
*
str
):
# mail to MAILER-DAEMON is generally spam that bounced
# mail to MAILER-DAEMON is generally spam that bounced
if
to
.
startswith
(
'
<MAILER-DAEMON@
'
):
if
to
.
startswith
(
'
<MAILER-DAEMON@
'
):
self
.
log
(
'
DISCARD
: RCPT TO:
'
,
to
,
str
)
self
.
log
(
'
REJECT
: RCPT TO:
'
,
to
,
str
)
return
Milter
.
DISCARD
return
Milter
.
REJECT
self
.
log
(
"
rcpt to
"
,
to
,
str
)
self
.
log
(
"
rcpt to
"
,
to
,
str
)
t
=
parse_addr
(
to
)
t
=
parse_addr
(
to
)
newaddr
=
False
newaddr
=
False
...
@@ -1425,6 +1433,11 @@ class bmsMilter(Milter.Milter):
...
@@ -1425,6 +1433,11 @@ class bmsMilter(Milter.Milter):
if
not
self
.
fp
:
if
not
self
.
fp
:
return
Milter
.
ACCEPT
# no message collected - so no eom processing
return
Milter
.
ACCEPT
# no message collected - so no eom processing
if
self
.
is_bounce
and
len
(
self
.
recipients
)
>
1
:
self
.
log
(
"
REJECT: DSN to multiple recipients
"
)
self
.
setreply
(
'
550
'
,
'
5.7.1
'
,
'
DSN to multiple recipients
'
)
return
Milter
.
REJECT
try
:
try
:
# check for delayed bounce
# check for delayed bounce
if
self
.
delayed_failure
:
if
self
.
delayed_failure
:
...
...
This diff is collapsed.
Click to expand it.
doc/links.h
+
1
−
0
View file @
c9f0c94b
...
@@ -16,5 +16,6 @@
...
@@ -16,5 +16,6 @@
<
li
><
a
href
=
"http://www.sendmail.org/"
>
Sendmail
.
Org
</
a
>
<
li
><
a
href
=
"http://www.sendmail.org/"
>
Sendmail
.
Org
</
a
>
<
li
><
a
href
=
"http://www.openspf.org/"
>
SPF
</
a
>
<
li
><
a
href
=
"http://www.openspf.org/"
>
SPF
</
a
>
<
li
><
a
href
=
"pysrs.html"
>
pysrs
</
a
>
<
li
><
a
href
=
"pysrs.html"
>
pysrs
</
a
>
<
li
><
a
href
=
"http://cheeseshop.python.org/pypi/pyspf"
>
pyspf
</
a
>
<
li
><
a
href
=
"http://bmsi.com/python/dspam.html"
>
pydspam
</
a
>
<
li
><
a
href
=
"http://bmsi.com/python/dspam.html"
>
pydspam
</
a
>
<
li
><
a
href
=
"http://bmsi.com/libdspam/dspam.html"
>
libdspam
</
a
>
<
li
><
a
href
=
"http://bmsi.com/libdspam/dspam.html"
>
libdspam
</
a
>
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
register
or
sign in
to comment