Index: mail/Makefile =================================================================== --- mail/Makefile +++ mail/Makefile @@ -615,6 +615,7 @@ SUBDIR += sigrot SUBDIR += simscan SUBDIR += slapd-cyrus + SUBDIR += slimta SUBDIR += sma SUBDIR += smfsav SUBDIR += smfsav-devel Index: mail/slimta/Makefile =================================================================== --- /dev/null +++ mail/slimta/Makefile @@ -0,0 +1,36 @@ +# $FreeBSD$ + +PORTNAME= slimta +PORTVERSION= 0.7.8 +CATEGORIES= mail +MASTER_SITES= CHEESESHOP + +MAINTAINER= nc@FreeBSD.org +COMMENT= Configurable MTA based on the python-slimta libraries + +LICENSE= MIT + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}python-slimta>0:mail/py-python-slimta@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} + +USES= python:3.6+ +USE_PYTHON= autoplist concurrent distutils +USE_RC_SUBR= ${PORTNAME} +REINPLACE_ARGS= -i '' + +NO_ARCH= yes + +post-patch: +.for file in setup main state + @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/${PORTNAME}/app/${file}.py +.endfor + +post-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/${PORTNAME} +.for file in logging ${PORTNAME} + @${CP} ${WRKSRC}/${PORTNAME}/app/etc/${file}.yaml.sample ${STAGEDIR}${PREFIX}/etc/${PORTNAME} + @${CP} ${WRKSRC}/${PORTNAME}/app/etc/${file}.yaml.sample ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/${file}.yaml +.endfor + +.include Index: mail/slimta/distinfo =================================================================== --- /dev/null +++ mail/slimta/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1609989855 +SHA256 (slimta-0.7.8.tar.gz) = 506ee680f6accd14d48f85faf1ff8a64f53b64be19555077cdff54ba38a70501 +SIZE (slimta-0.7.8.tar.gz) = 17095 Index: mail/slimta/files/patch-slimta_app_main.py =================================================================== --- /dev/null +++ mail/slimta/files/patch-slimta_app_main.py @@ -0,0 +1,11 @@ +--- slimta/app/main.py.orig 2021-01-11 18:43:19 UTC ++++ slimta/app/main.py +@@ -44,7 +44,7 @@ def parse_args(): + default_process_name = os.path.basename(sys.argv[0]) + group = argparser.add_argument_group('config options') + group.add_argument('-c', '--config', metavar='FILE', default=None, +- help='Specifies a configuration file to read. If not given, the default locations ($HOME/.slimta/slimta.yaml, /etc/slimta/slimta.yaml) are checked.') ++ help='Specifies a configuration file to read. If not given, the default locations ($HOME/.slimta/slimta.yaml, %%PREFIX%%/etc/slimta/slimta.yaml) are checked.') + group.add_argument('-n', '--process-name', metavar='NAME', default=default_process_name, + help='Use the process sub-section NAME for configuration. (default: %(default)s)') + group.add_argument('--no-edge', action='store_true', Index: mail/slimta/files/patch-slimta_app_setup.py =================================================================== --- /dev/null +++ mail/slimta/files/patch-slimta_app_setup.py @@ -0,0 +1,11 @@ +--- slimta/app/setup.py.orig 2021-01-11 18:41:23 UTC ++++ slimta/app/setup.py +@@ -55,7 +55,7 @@ def _try_config_copy(etc_dir, conf_file, force): + + def _setup_configs(args): + etc_dir = args.etc_dir +- default_etc_dir = '/etc/slimta' ++ default_etc_dir = '%%PREFIX%%/etc/slimta' + if os.getuid() != 0: + default_etc_dir = '~/.slimta/' + if etc_dir is None: Index: mail/slimta/files/patch-slimta_app_state.py =================================================================== --- /dev/null +++ mail/slimta/files/patch-slimta_app_state.py @@ -0,0 +1,11 @@ +--- slimta/app/state.py.orig 2021-01-11 18:40:47 UTC ++++ slimta/app/state.py +@@ -48,7 +48,7 @@ except ImportError as exc: + class SlimtaState(object): + + _global_config_files = [os.path.expanduser('~/.slimta/slimta.yaml'), +- '/etc/slimta/slimta.yaml'] ++ '%%PREFIX%%/etc/slimta/slimta.yaml'] + + def __init__(self, args): + self.program = args.process_name Index: mail/slimta/files/slimta.in =================================================================== --- /dev/null +++ mail/slimta/files/slimta.in @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: slimta +# REQUIRE: DAEMON FILESYSTEMS NETWORKING +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable slimta. +# +# slimta_enable="YES" + +. /etc/rc.subr + +name="slimta" +rcvar="slimta_enable" + +load_rc_config $name + +: ${slimta_enable:="NO"} +: ${slimta_conf:="%%PREFIX%%/etc/slimta/slimta.yaml"} + +procname="%%PREFIX%%/bin/slimta" +pidfile=/var/run/${name}.pid +command="/usr/sbin/daemon" +command_args="-p $pidfile $procname -c $slimta_conf" +start_cmd="slimta_start" + +slimta_start() +{ + check_startmsgs && echo "Starting ${name}." + $command $command_args +} + +run_rc_command "$1" Index: mail/slimta/pkg-descr =================================================================== --- /dev/null +++ mail/slimta/pkg-descr @@ -0,0 +1,5 @@ +The slimta project is a traditional application built on top of the +python-slimta library. It allows a more "out-of-the-box" MTA that offers +all the useful, built-in features needed for a normal mail system setup. + +WWW: https://www.slimta.org/ Index: mail/slimta/pkg-plist =================================================================== --- /dev/null +++ mail/slimta/pkg-plist @@ -0,0 +1,4 @@ +etc/slimta/logging.yaml +etc/slimta/logging.yaml.sample +etc/slimta/slimta.yaml +etc/slimta/slimta.yaml.sample