BSD Ports

mail/py-spf-engine 3.0.4 DragonFly

SPF engine for Postfix policy server and milter implemented in Python

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
License
APACHE20, GPLv2+
Categories
mail, python
Package size
89.5 KiB, 405.5 KiB installed

Description

This project provides the SPF (Sender Policy Framework) back-end for both pypolicyd-spf (for which it was originally developed) and an future SPF milter using pymilter. The goal is to provide a common back-end for common features for support SPF integration with Postfix and Sendmail using both the Postfix policy service and the Sendmail milter protocol (also available with Postfix).

In the other systems

SystemPortVersion
DragonFlymail/py-spf-engine3.0.4
FreeBSDmail/py-spf-engine3.1.0_1
HardenedBSDmail/py-spf-engine3.1.0
GhostBSDmail/py-spf-engine3.1.0

Install

Binary package:

pkg install py311-spf-engine

From DPorts:

cd /usr/dports/mail/py-spf-engine && make install clean

Dependencies

Run dependencies 4

No port depends on this one.

Configuration

No options to configure.

Service scripts
none

Message after installing

#
# 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=/usr/local/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.

/usr/local/etc/postfix/main.cf:

smtpd_milters = unix:/var/run/pyspf-milter/pyspf-milter.sock

/usr/local/etc/postfix/master.cf:

smtp       inet  n       -       -       -       -       smtpd
    ...
        -o milter_macro_daemon_name=VERIFYING
    ...

/usr/local/etc/python-policyd-spf/policyd-spf.conf:

MacroList               daemon_name|VERIFYING

===>   NOTICE:

The py311-spf-engine port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing