spf-engine


Namespf-engine JSON
Version 3.1.0 PyPI version JSON
download
home_pageNone
SummarySPF (Sender Policy Framework) processing engine for Postfix policy server and Milter implemented in Python.
upload_time2024-07-07 05:29:42
maintainerNone
docs_urlNone
authorNone
requires_python>=3.3
licenseNone
keywords postfix sendmail milter spf email
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            SPF Engine - provides:
Python Postfix Policy for SPF (python-policy-spf) 3.1.0
Python based policy daemon for Postfix SPF checking
pyspf-milter Milter for SPF checking for Sendmail and other milter users

Tumgreyspf source
 Copyright © 2004-2005, Sean Reifschneider, tummy.com, ltd.
 <jafo@tummy.com>
python-policyd-spf changes
 Copyright © 2007-2024 Scott Kitterman <scott@kitterman.com>
<https://launchpad.net/pypolicyd-spf>
Documentation inputs:
 Copyright © 2004-2005, Sean Reifschneider, tummy.com, ltd.
 <jafo@tummy.com>
 2003-2004 Meng Weng Wong <mengwong@pobox.com> from postfix-policyd-spf-perl
 Copyright © 2007-2018 Scott Kitterman <scott@kitterman.com>

Dual Apache 2.0/GPL 2 licensed:
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=================

This is an external policy checker for the postfix mail server.  It will use
pyspf to check SPF records to determine if email should be rejected or
deferred by your server.

It requires Python3 (python3.3+) - as of version 2.0.0, python2 is no longer
supported, the pyspf (python-spf) library version 2.0.9 or higher, and authres.  

As of version 3.0.0, it uses flit to build/install.  It requires at least flit
3.8.0.

Nothing is configured by default, so this will not interact with Postfix until
it has been set up.

See man 1 policyd-spf for information on setting up and using this as a
Postfix policy server.

See man 5 policyd-spf.conf for configuration file information.

The following applies only to using this package via the Milter interface.

The milter is relatively new and less well tested/mature.  If used with
pymilter version 1.0.5 or later, it will work for messages where the local
part of the Mail From is not valid UTF-8, but the "l" macro will not work,
which is expected, per RFC 8616 "l" macros only work for ASCII localparts. It
now supports RFC 8616, Email Authentication for Internationalized Mail.

This package includes a default configuration file and man pages. 

[sudo] pip install pyspf_milter

Using pip will cause required packages to be installed via easy_install if they
have not been previously installed.  Because pymilter is a compiled Python
extension, the system will need appropriate development packages and
an C compiler.  Alternately, install it from dsitribution/OS packages and then
pip install pyspf_milter.

Both a systemd unit file and a sysv init file are provided.  Both make
assumptions about defaults being used, e.g. if a non-standard pidfile name is
used, they will need to be updated.  The sysv init file uses start-stop-deamon
from Debian.  It is not portable to systems without that available.

The pyspf-milter drops priviledges after setup to the user/group specified in
UserID.  During initial setup, this system user needs to be manually created.
As an example, using the default dkimpy-user on Debian, the command would be:

[sudo] adduser --system --no-create-home --quiet --disabled-password \
               --disabled-login --shell /bin/false --group \
               --home /run/pyspf-milter pyspf-milter

Since /var/run or /run is sometimes on a tempfs, if the PID file directory is
missing, the milter will create it on startup.

To start pyspf-milter with systemd for the first time, you will need to take
the following steps:

[sudo] systemctl daemon-reload
[sudo] systemctl enable pyspf-milter
[sudo] systemctl start pyspf-milter
[sudo] systemctl status pyspf-milter (to verify it started correctly)

As with all milters, pyspf-milter needs to be integrated with your MTA of
choice (Sendmail or Postfix).

For Sendmail:

Configuration is very similar to opendkim, but needs some adjustment for
dkimpy-milter. Here's an example configuration line to include in your
sendmail.mc:

INPUT_MAIL_FILTER(`pyspf-milter', `S=local:/run/pyspf-milter/pyspf-milter.sock')dnl

Changing the sendmail.mc file requires a Make (to compile it into sendmail.cf)
and a restart of sendmail.  Note that S= needs to match the value of Socket in
the configuration file.

Milter support should be present by default in most versions of sendmail
these days, but if not included in your Sendmail build, see:
http://www.elandsys.com/resources/sendmail/milter.html

For Postfix:

Integration of pyspf-milter into Postfix is like any milter (See Postfix's
README_FILES/MILTER_README).  Here's an example master.cf excerpt:

smtp       inet  n       -       -       -      -       smtpd
    ...
    -o smtpd_milters=inet:localhost:8893
    ...

These need to match the Socket value for pyspf-milter.

Care is required to segregate outbound mail from inbound mail to be checked.
verified.  There are many possible ways.  As of version 3.1.0, SPF checks are
automatically skipped for connections authenticated with SMTP Auth (since
these are, by definition, local).  Here is another example using milter
macros to keep the mail streams segregated:

Postfix main.cf:

smtpd_milters=inet:localhost:8893

Postfix master.cf:

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


In the pyspf-milter configuration file:

...
MacroList		daemon_name|VERIFYING
...


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "spf-engine",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.3",
    "maintainer_email": null,
    "keywords": "Postfix, Sendmail, milter, spf, email",
    "author": null,
    "author_email": "Scott Kitterman <scott@kitterman.com>",
    "download_url": "https://files.pythonhosted.org/packages/35/01/8dfc7d89c8542ecbb9a74fb021739e378c707555f929bb696a94bda6ae89/spf-engine-3.1.0.tar.gz",
    "platform": null,
    "description": "SPF Engine - provides:\nPython Postfix Policy for SPF (python-policy-spf) 3.1.0\nPython based policy daemon for Postfix SPF checking\npyspf-milter Milter for SPF checking for Sendmail and other milter users\n\nTumgreyspf source\n Copyright \u00a9 2004-2005, Sean Reifschneider, tummy.com, ltd.\n <jafo@tummy.com>\npython-policyd-spf changes\n Copyright \u00a9 2007-2024 Scott Kitterman <scott@kitterman.com>\n<https://launchpad.net/pypolicyd-spf>\nDocumentation inputs:\n Copyright \u00a9 2004-2005, Sean Reifschneider, tummy.com, ltd.\n <jafo@tummy.com>\n 2003-2004 Meng Weng Wong <mengwong@pobox.com> from postfix-policyd-spf-perl\n Copyright \u00a9 2007-2018 Scott Kitterman <scott@kitterman.com>\n\nDual Apache 2.0/GPL 2 licensed:\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n\n   This program is free software; you can redistribute it and/or modify\n   it under the terms of the GNU General Public License as published by\n   the Free Software Foundation; version 2.\n\n   This program is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n   GNU General Public License for more details.\n\n   You should have received a copy of the GNU General Public License along\n   with this program; if not, write to the Free Software Foundation, Inc.,\n   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n=================\n\nThis is an external policy checker for the postfix mail server.  It will use\npyspf to check SPF records to determine if email should be rejected or\ndeferred by your server.\n\nIt requires Python3 (python3.3+) - as of version 2.0.0, python2 is no longer\nsupported, the pyspf (python-spf) library version 2.0.9 or higher, and authres.  \n\nAs of version 3.0.0, it uses flit to build/install.  It requires at least flit\n3.8.0.\n\nNothing is configured by default, so this will not interact with Postfix until\nit has been set up.\n\nSee man 1 policyd-spf for information on setting up and using this as a\nPostfix policy server.\n\nSee man 5 policyd-spf.conf for configuration file information.\n\nThe following applies only to using this package via the Milter interface.\n\nThe milter is relatively new and less well tested/mature.  If used with\npymilter version 1.0.5 or later, it will work for messages where the local\npart of the Mail From is not valid UTF-8, but the \"l\" macro will not work,\nwhich is expected, per RFC 8616 \"l\" macros only work for ASCII localparts. It\nnow supports RFC 8616, Email Authentication for Internationalized Mail.\n\nThis package includes a default configuration file and man pages. \n\n[sudo] pip install pyspf_milter\n\nUsing pip will cause required packages to be installed via easy_install if they\nhave not been previously installed.  Because pymilter is a compiled Python\nextension, the system will need appropriate development packages and\nan C compiler.  Alternately, install it from dsitribution/OS packages and then\npip install pyspf_milter.\n\nBoth a systemd unit file and a sysv init file are provided.  Both make\nassumptions about defaults being used, e.g. if a non-standard pidfile name is\nused, they will need to be updated.  The sysv init file uses start-stop-deamon\nfrom Debian.  It is not portable to systems without that available.\n\nThe pyspf-milter drops priviledges after setup to the user/group specified in\nUserID.  During initial setup, this system user needs to be manually created.\nAs an example, using the default dkimpy-user on Debian, the command would be:\n\n[sudo] adduser --system --no-create-home --quiet --disabled-password \\\n               --disabled-login --shell /bin/false --group \\\n               --home /run/pyspf-milter pyspf-milter\n\nSince /var/run or /run is sometimes on a tempfs, if the PID file directory is\nmissing, the milter will create it on startup.\n\nTo start pyspf-milter with systemd for the first time, you will need to take\nthe following steps:\n\n[sudo] systemctl daemon-reload\n[sudo] systemctl enable pyspf-milter\n[sudo] systemctl start pyspf-milter\n[sudo] systemctl status pyspf-milter (to verify it started correctly)\n\nAs with all milters, pyspf-milter needs to be integrated with your MTA of\nchoice (Sendmail or Postfix).\n\nFor Sendmail:\n\nConfiguration is very similar to opendkim, but needs some adjustment for\ndkimpy-milter. Here's an example configuration line to include in your\nsendmail.mc:\n\nINPUT_MAIL_FILTER(`pyspf-milter', `S=local:/run/pyspf-milter/pyspf-milter.sock')dnl\n\nChanging the sendmail.mc file requires a Make (to compile it into sendmail.cf)\nand a restart of sendmail.  Note that S= needs to match the value of Socket in\nthe configuration file.\n\nMilter support should be present by default in most versions of sendmail\nthese days, but if not included in your Sendmail build, see:\nhttp://www.elandsys.com/resources/sendmail/milter.html\n\nFor Postfix:\n\nIntegration of pyspf-milter into Postfix is like any milter (See Postfix's\nREADME_FILES/MILTER_README).  Here's an example master.cf excerpt:\n\nsmtp       inet  n       -       -       -      -       smtpd\n    ...\n    -o smtpd_milters=inet:localhost:8893\n    ...\n\nThese need to match the Socket value for pyspf-milter.\n\nCare is required to segregate outbound mail from inbound mail to be checked.\nverified.  There are many possible ways.  As of version 3.1.0, SPF checks are\nautomatically skipped for connections authenticated with SMTP Auth (since\nthese are, by definition, local).  Here is another example using milter\nmacros to keep the mail streams segregated:\n\nPostfix main.cf:\n\nsmtpd_milters=inet:localhost:8893\n\nPostfix master.cf:\n\nsmtp       inet  n       -       -       -       -       smtpd\n    ...\n    -o milter_macro_daemon_name=VERIFYING\n    ...\n\n\nIn the pyspf-milter configuration file:\n\n...\nMacroList\t\tdaemon_name|VERIFYING\n...\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "SPF (Sender Policy Framework) processing engine for Postfix policy server and Milter implemented in Python.",
    "version": "3.1.0",
    "project_urls": {
        "Home": "https://launchpad.net/spf-engine"
    },
    "split_keywords": [
        "postfix",
        " sendmail",
        " milter",
        " spf",
        " email"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "312604616d94856fc84940c0f77e63c0ec00399cb25ed60e420273aca9e31089",
                "md5": "dcf3cc39c66819f94861097d923ae0cd",
                "sha256": "e3a06f1ab14e6ccdbfd6775184f20e09acb4c1eb738c7f9c4d52b7335bedbbbc"
            },
            "downloads": -1,
            "filename": "spf_engine-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dcf3cc39c66819f94861097d923ae0cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.3",
            "size": 67074,
            "upload_time": "2024-07-07T05:29:40",
            "upload_time_iso_8601": "2024-07-07T05:29:40.868403Z",
            "url": "https://files.pythonhosted.org/packages/31/26/04616d94856fc84940c0f77e63c0ec00399cb25ed60e420273aca9e31089/spf_engine-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "35018dfc7d89c8542ecbb9a74fb021739e378c707555f929bb696a94bda6ae89",
                "md5": "1704f1869df135a754315b09612eeebc",
                "sha256": "1d4b8cc58142a88b4b1603129eb9307e6256aa0146c88d515a09a58dbfa39169"
            },
            "downloads": -1,
            "filename": "spf-engine-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1704f1869df135a754315b09612eeebc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.3",
            "size": 62848,
            "upload_time": "2024-07-07T05:29:42",
            "upload_time_iso_8601": "2024-07-07T05:29:42.613089Z",
            "url": "https://files.pythonhosted.org/packages/35/01/8dfc7d89c8542ecbb9a74fb021739e378c707555f929bb696a94bda6ae89/spf-engine-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-07 05:29:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "spf-engine"
}
        
Elapsed time: 3.62411s