diff options
Diffstat (limited to 'mail/py-spf-engine/files')
-rw-r--r-- | mail/py-spf-engine/files/patch-setup.py | 16 | ||||
-rw-r--r-- | mail/py-spf-engine/files/patch-spf__engine_milter__spf.py | 10 | ||||
-rw-r--r-- | mail/py-spf-engine/files/pkg-message.in | 76 | ||||
-rw-r--r-- | mail/py-spf-engine/files/pyspf-milter.in | 42 |
4 files changed, 144 insertions, 0 deletions
diff --git a/mail/py-spf-engine/files/patch-setup.py b/mail/py-spf-engine/files/patch-setup.py new file mode 100644 index 000000000000..1dbd9b028133 --- /dev/null +++ b/mail/py-spf-engine/files/patch-setup.py @@ -0,0 +1,16 @@ +--- setup.py.orig 2019-10-27 01:15:11 UTC ++++ setup.py +@@ -25,11 +25,8 @@ setup(name='spf-engine', + include_package_data=True, + data_files=[(os.path.join('share', 'man', 'man1'), + ['policyd-spf.1']), (os.path.join('share', 'man', 'man5'), +- ['policyd-spf.conf.5']), (os.path.join('etc', 'python-policyd-spf'), +- ['policyd-spf.conf']), (os.path.join('share', 'man', 'man5'), +- ['policyd-spf.peruser.5']), (os.path.join('lib', 'systemd', 'system'), +- ['system/pyspf-milter.service']),(os.path.join('etc', 'init.d'), +- ['system/pyspf-milter']) ], ++ ['policyd-spf.conf.5']), (os.path.join('share', 'man', 'man5'), ++ ['policyd-spf.peruser.5'])], + classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: No Input/Output (Daemon)', diff --git a/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py b/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py new file mode 100644 index 000000000000..cd8c2a41aaef --- /dev/null +++ b/mail/py-spf-engine/files/patch-spf__engine_milter__spf.py @@ -0,0 +1,10 @@ +--- spf_engine/milter_spf.py.orig 2020-02-26 02:21:41 UTC ++++ spf_engine/milter_spf.py +@@ -37,7 +37,6 @@ import spf_engine.policydspfsupp as config + from spf_engine.util import drop_privileges + from spf_engine.policydspfsupp import _setExceptHook + from spf_engine.util import write_pid +-from spf_engine.util import own_socketfile + from spf_engine.util import fold + + __version__ = "2.9.2" diff --git a/mail/py-spf-engine/files/pkg-message.in b/mail/py-spf-engine/files/pkg-message.in new file mode 100644 index 000000000000..b80d6b6d4516 --- /dev/null +++ b/mail/py-spf-engine/files/pkg-message.in @@ -0,0 +1,76 @@ +[ +{ type: install + message: <<EOM +# +# Using policyd-spf with Postfix +# + +Policyd-spf must be integrated with Postfix to be effective: + + 1. Add to your postfix master.cf: + + policyd-spf unix - n n - 0 spawn + user=nobody argv=%%PREFIX%%/bin/policyd-spf + + 2. Configure the Postfix policy service in your main.cf so that the + "smtpd_recipient_restrictions" includes a call to the policyd-spf policy + filter. If you already have a "smtpd_recipient_restrictions" line, you can + add the "check_policy_service" command anywhere *after* the line which + reads "reject_unauth_destination" (otherwise you're system can become an + open relay). + + smtpd_recipient_restrictions = + ... + reject_unauth_destination + check_policy_service unix:private/policyd-spf + ... + + policyd-spf_time_limit = 3600 + + 3. Please consult the postfix documentation for more information on these and + other settings you may wish to have in the "smtpd_recipient_restrictions" + configuration. + + 4. Reload postfix. + +# +# Automatically starting pyspf-milter at boot time. +# + +Add 'pyspf_milter_enable="YES"' to /etc/rc.conf. + +# +# Using pyspf-milter with Sendmail +# + +Following is an example configuration line to include in your sendmail.mc. + +INPUT_MAIL_FILTER(`pyspf-milter', `S=local:/var/run/pyspf-milter/pyspf-milter.sock')dnl + +# +# Using pyspf-milter with Postfix +# + +Integration of pyspf-milter into Postfix is like any milter (See Postfix's +README_FILES/MILTER_README). But care is required to segregate outbound mail +from inbound mail to be checked. Here is example using milter macros to keep +the mail streams segregated. + +%%PREFIX%%/etc/postfix/main.cf: + +smtpd_milters = unix:/var/run/pyspf-milter/pyspf-milter.sock + +%%PREFIX%%/etc/postfix/master.cf: + +smtp inet n - - - - smtpd + ... + -o milter_macro_daemon_name=VERIFYING + ... + +%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf: + +MacroList daemon_name|VERIFYING + +EOM +} +] diff --git a/mail/py-spf-engine/files/pyspf-milter.in b/mail/py-spf-engine/files/pyspf-milter.in new file mode 100644 index 000000000000..a46dff0a7068 --- /dev/null +++ b/mail/py-spf-engine/files/pyspf-milter.in @@ -0,0 +1,42 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: pyspf_milter +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable pyspf_milter: +# +# pyspf_milter_enable (bool) Set to 'YES' to enable. +# Default: NO +# pyspf_milter_conffile (path) Location of configuration file. +# Default: %%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf + +. /etc/rc.subr + +name=pyspf_milter +rcvar=pyspf_milter_enable + +load_rc_config $name + +: ${pyspf_milter_enable:=NO} +: ${pyspf_milter_conffile:=%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf} + +command=/usr/sbin/daemon +command_interpreter=%%PYTHON_CMD%% +procname=%%PREFIX%%/bin/pyspf-milter +command_args="-c -f ${procname} ${pyspf_milter_conffile}" +pidfile=%%PYSPF_MILTER_RUNDIR%%/pyspf-milter.pid +required_dirs=%%PYSPF_MILTER_RUNDIR%% +required_files=${pyspf_milter_conffile} +start_precmd=pyspf_milter_cleanup +stop_postcmd=pyspf_milter_cleanup + +pyspf_milter_cleanup () +{ + rm -f ${pidfile} +} + +run_rc_command "$1" |