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
10f4f261
Commit
10f4f261
authored
Nov 29, 2007
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Packaging tweaks.
parent
69369c3b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
TODO
+5
-0
5 additions, 0 deletions
TODO
bms.py
+5
-2
5 additions, 2 deletions
bms.py
milter.cfg
+6
-0
6 additions, 0 deletions
milter.cfg
milter.rc
+1
-1
1 addition, 1 deletion
milter.rc
pymilter.spec
+32
-26
32 additions, 26 deletions
pymilter.spec
with
49 additions
and
29 deletions
TODO
+
5
−
0
View file @
10f4f261
Support CBV to local domains and cache results so that invalid users
can be rejected without maintaining valid user lists.
Now that we blacklist IPs for too many bad rcpts, delay SPF until RCPT TO.
Convert DSN to REJECT unless sender gets SPF pass or best guess pass. Make
Convert DSN to REJECT unless sender gets SPF pass or best guess pass. Make
configurable by SPF result with NOTSPAM policy (reject or deliver without DSN).
configurable by SPF result with NOTSPAM policy (reject or deliver without DSN).
Maybe policy should be NODSN - still verify sender with CBV.
Maybe policy should be NODSN - still verify sender with CBV.
...
...
...
...
This diff is collapsed.
Click to expand it.
bms.py
+
5
−
2
View file @
10f4f261
#!/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.116 2007/11/01 20:09:14 customdesigned
# Support temperror policy in access.
#
# Revision 1.115 2007/10/10 18:23:54 customdesigned
# Revision 1.115 2007/10/10 18:23:54 customdesigned
# Send quarantine DSN to SPF pass (official or guessed) only.
# Send quarantine DSN to SPF pass (official or guessed) only.
# Reject blacklisted email too big for dspam.
# Reject blacklisted email too big for dspam.
...
@@ -740,9 +743,9 @@ class bmsMilter(Milter.Milter):
...
@@ -740,9 +743,9 @@ class bmsMilter(Milter.Milter):
self
.
user
=
self
.
getsymval
(
'
{auth_authen}
'
)
self
.
user
=
self
.
getsymval
(
'
{auth_authen}
'
)
if
self
.
user
:
if
self
.
user
:
# Very simple SMTP AUTH policy by defaul:
# Very simple SMTP AUTH policy by defaul
t
:
# any successful authentication is considered INTERNAL
# any successful authentication is considered INTERNAL
#
FIXME: configure allowed MAIL FROM by user
#
Detailed authorization policy is configured in the access file below.
self
.
internal_connection
=
True
self
.
internal_connection
=
True
self
.
log
(
self
.
log
(
"
SMTP AUTH:
"
,
self
.
user
,
self
.
getsymval
(
'
{auth_type}
'
),
"
SMTP AUTH:
"
,
self
.
user
,
self
.
getsymval
(
'
{auth_type}
'
),
...
...
...
...
This diff is collapsed.
Click to expand it.
milter.cfg
+
6
−
0
View file @
10f4f261
[milter]
[milter]
datadir
=
/var/log/milter
# the socket used to communicate with sendmail. Must match sendmail.cf
# the socket used to communicate with sendmail. Must match sendmail.cf
socket
=
/var/run/milter/pythonsock
socket
=
/var/run/milter/pythonsock
# where to save original copies of defanged and failed messages
# where to save original copies of defanged and failed messages
...
@@ -186,6 +187,11 @@ blind = 1
...
@@ -186,6 +187,11 @@ blind = 1
# Map email addresses and aliases to dspam users
# Map email addresses and aliases to dspam users
;dspam_users=david,goliath,spam,falsepositive
;dspam_users=david,goliath,spam,falsepositive
# List dspam users which train on all delivered messages, as opposed to
# "train on error" which trains only when a spam or falsepositive is reported.
# Training mode will build the dictionary faster, but requires close attention
# so as not to miss any spam or false positives.
;dspam_train=goliath
;david=david@foocorp.com,david.yelnetz@foocorp.com,david@bar.foocorp.com
;david=david@foocorp.com,david.yelnetz@foocorp.com,david@bar.foocorp.com
;goliath=giant@foocorp.com,goliath.philistine@foocorp.com
;goliath=giant@foocorp.com,goliath.philistine@foocorp.com
# address to forward spam to. milter will process these and not deliver
# address to forward spam to. milter will process these and not deliver
...
...
...
...
This diff is collapsed.
Click to expand it.
milter.rc
+
1
−
1
View file @
10f4f261
...
@@ -46,7 +46,7 @@ start() {
...
@@ -46,7 +46,7 @@ start() {
stop
()
{
stop
()
{
# Stop daemons.
# Stop daemons.
echo
-n
"Shutting down
$prog
: "
echo
-n
"Shutting down
$prog
: "
killproc milter
killproc
-d
5
milter
RETVAL
=
$?
RETVAL
=
$?
echo
echo
[
$RETVAL
-eq
0
]
&&
rm
-f
/var/lock/subsys/milter
[
$RETVAL
-eq
0
]
&&
rm
-f
/var/lock/subsys/milter
...
...
...
...
This diff is collapsed.
Click to expand it.
pymilter.spec
+
32
−
26
View file @
10f4f261
# This spec file contains 2 noarch packages in addition to the pymilter
# module. To compile all three on 32-bit Intel, use:
# rpmbuild -ba --target=i386,noarch pymilter.spec
%define version 0.8.9
%define version 0.8.9
%define release
1
%define release
2
# what version of RH are we building for?
# what version of RH are we building for?
%define redhat7 0
%define redhat7 0
...
@@ -29,10 +33,6 @@
...
@@ -29,10 +33,6 @@
%define libdir /usr/lib/pymilter
%define libdir /usr/lib/pymilter
%endif
%endif
# This spec file contains 2 noarch packages in addition to the pymilter
# module. To compile all three, use:
# rpmbuild -ba --target=i386,noarch pymilter.spec
%ifarch noarch
%ifarch noarch
Name: milter
Name: milter
Group: Applications/System
Group: Applications/System
...
@@ -112,16 +112,7 @@ find /var/log/milter/save -mtime +7 | xargs $R rm
...
@@ -112,16 +112,7 @@ find /var/log/milter/save -mtime +7 | xargs $R rm
EOF
EOF
chmod a+x $RPM_BUILD_ROOT/etc/cron.daily/milter
chmod a+x $RPM_BUILD_ROOT/etc/cron.daily/milter
%ifos aix4.1
%ifnos aix4.1
cat >$RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
#!/bin/sh
cd /var/log/milter
# uncomment to enable sgmlop if installed
#export PYTHONPATH=/usr/local/lib/python2.1/site-packages
exec /usr/local/bin/python bms.py >>milter.log 2>&1
EOF
%else # not aix4.1
cp start.sh $RPM_BUILD_ROOT%{libdir}
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
cp %{sysvinit} $RPM_BUILD_ROOT/etc/rc.d/init.d/milter
cp %{sysvinit} $RPM_BUILD_ROOT/etc/rc.d/init.d/milter
cp spfmilter.rc $RPM_BUILD_ROOT/etc/rc.d/init.d/spfmilter
cp spfmilter.rc $RPM_BUILD_ROOT/etc/rc.d/init.d/spfmilter
...
@@ -141,18 +132,8 @@ python="%{python}"
...
@@ -141,18 +132,8 @@ python="%{python}"
w
w
q
q
EOF
EOF
ed $RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
/^python=/
c
python="%{python}"
.
w
q
EOF
%endif # aix4.1
%endif # aix4.1
chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
mkdir -p $RPM_BUILD_ROOT/var/run/milter
mkdir -p $RPM_BUILD_ROOT/usr/share/sendmail-cf/hack
mkdir -p $RPM_BUILD_ROOT/usr/share/sendmail-cf/hack
cp -p rhsbl.m4 $RPM_BUILD_ROOT/usr/share/sendmail-cf/hack
cp -p rhsbl.m4 $RPM_BUILD_ROOT/usr/share/sendmail-cf/hack
...
@@ -185,7 +166,6 @@ fi
...
@@ -185,7 +166,6 @@ fi
%files
%files
%defattr(-,root,root)
%defattr(-,root,root)
%config %{libdir}/start.sh
/etc/logrotate.d/milter
/etc/logrotate.d/milter
/etc/cron.daily/milter
/etc/cron.daily/milter
%{libdir}/bms.py?
%{libdir}/bms.py?
...
@@ -254,13 +234,39 @@ env CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$LDFLAGS" %{python} setup.py build
...
@@ -254,13 +234,39 @@ env CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$LDFLAGS" %{python} setup.py build
%install
%install
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
%{python} setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%{python} setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
mkdir -p $RPM_BUILD_ROOT/var/run/milter
mkdir -p $RPM_BUILD_ROOT%{libdir}
%ifos aix4.1
cat >$RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
#!/bin/sh
cd /var/log/milter
# uncomment to enable sgmlop if installed
#export PYTHONPATH=/usr/local/lib/python2.1/site-packages
exec /usr/local/bin/python bms.py >>milter.log 2>&1
EOF
%else # not aix4.1
cp start.sh $RPM_BUILD_ROOT%{libdir}
ed $RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
/^python=/
c
python="%{python}"
.
w
q
EOF
%endif
chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
%if !%{redhat7}
%if !%{redhat7}
grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
%endif
%endif
# start.sh is used by spfmilter and milter, and could be used by
# other milters running on redhat
%files -f INSTALLED_FILES
%files -f INSTALLED_FILES
%defattr(-,root,root)
%defattr(-,root,root)
%doc README HOWTO ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%doc README HOWTO ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%config %{libdir}/start.sh
%dir /var/run/milter
%endif # noarch
%endif # noarch
...
...
...
...
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