FreeBSD Ports

mail/py-spf-engine 3.1.0_1

SPF engine for Postfix policy server and milter implemented in Python

Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
16d8d1884f
License
APACHE20, GPLv2+
Categories
mail, python
Package size
93.9 KiB, 387.7 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).

Install

As a binary package — by origin, or by package name:

pkg install mail/py-spf-engine
pkg install py312-spf-engine

From the ports tree:

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

To depend on this port in another port's Makefile:

RUN_DEPENDS=	py312-spf-engine>0:mail/py-spf-engine

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest3.1.0_13.1.0_12.9.3_13.1.03.1.0_1
FreeBSD:14:quarterly3.1.03.1.0n/a3.0.43.1.0
FreeBSD:15:latest3.1.0_13.1.0_1n/a3.1.03.1.0
FreeBSD:15:quarterly3.1.03.1.0n/an/an/a
FreeBSD:16:latest3.1.03.1.0_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 1

Runtime 3

The full lists below include those, and their dependencies in turn.

All build dependencies 15
All run dependencies 37

No port depends on this one.

Configuration

Options name: mail_spf-engine

OptionDefaultDescription
DOCSoffBuild and/or install documentation
USES
python shebangfix
Service scripts
pyspf-milter

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

Files

distinfo 1
FileSizeSHA256
spf-engine-3.1.0.tar.gz628481d4b8cc58142a88b4b1603129eb9307e6256aa0146c88d515a09a58dbfa39169
Master sites 1
  • PYPI

Commit history 2

DateCommitCreditsLog message
16d8d1884f Jochen Neumeister mail/py-spf-engine: Fix crash in pyspf-milter eom()
eom() split the Authentication-Results header at ": " and raised a ValueError when the SPF engine handed it a value without that separator, for example when HELO_reject is No_Check and the sender is empty or when TestOnly is 0. pymilter turned the uncaught exception into a tempfail, so the message was deferred and eventually bounced. Add the header only when the separator is present and log a warning otherwise. The message is delivered without an Authentication-Results header, the envelope-stage reject decisions are not affected. PR: 296277 Reported by: [email protected] Sponsored by: Netzkommune GmbH
a701b180cf Jochen Neumeister mail/py-spf-engine: Take maintainership
Sponsored by: Netzkommune GmbH