New port: mail/slimta: Configurable MTA based on the python-slimta libraries
Reviewed by: 0mp (mentor) Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D28052
This commit is contained in:
parent
a86faff664
commit
a1ee3198c4
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=561772
8 changed files with 109 additions and 0 deletions
|
@ -615,6 +615,7 @@
|
|||
SUBDIR += sigrot
|
||||
SUBDIR += simscan
|
||||
SUBDIR += slapd-cyrus
|
||||
SUBDIR += slimta
|
||||
SUBDIR += sma
|
||||
SUBDIR += smfsav
|
||||
SUBDIR += smfsav-devel
|
||||
|
|
38
mail/slimta/Makefile
Normal file
38
mail/slimta/Makefile
Normal file
|
@ -0,0 +1,38 @@
|
|||
# $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
|
||||
SUB_LIST= PYTHON_CMD=${PYTHON_CMD}
|
||||
|
||||
PLIST_FILES= "@sample etc/slimta/logging.yaml.sample" \
|
||||
"@sample etc/slimta/slimta.yaml.sample"
|
||||
|
||||
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}
|
||||
.endfor
|
||||
|
||||
.include <bsd.port.mk>
|
3
mail/slimta/distinfo
Normal file
3
mail/slimta/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
|||
TIMESTAMP = 1609989855
|
||||
SHA256 (slimta-0.7.8.tar.gz) = 506ee680f6accd14d48f85faf1ff8a64f53b64be19555077cdff54ba38a70501
|
||||
SIZE (slimta-0.7.8.tar.gz) = 17095
|
11
mail/slimta/files/patch-slimta_app_main.py
Normal file
11
mail/slimta/files/patch-slimta_app_main.py
Normal file
|
@ -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',
|
11
mail/slimta/files/patch-slimta_app_setup.py
Normal file
11
mail/slimta/files/patch-slimta_app_setup.py
Normal file
|
@ -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:
|
11
mail/slimta/files/patch-slimta_app_state.py
Normal file
11
mail/slimta/files/patch-slimta_app_state.py
Normal file
|
@ -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
|
29
mail/slimta/files/slimta.in
Normal file
29
mail/slimta/files/slimta.in
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/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_interpreter="%%PYTHON_CMD%%"
|
||||
command="/usr/sbin/daemon"
|
||||
command_args="-p $pidfile $procname -c $slimta_conf"
|
||||
|
||||
run_rc_command "$1"
|
5
mail/slimta/pkg-descr
Normal file
5
mail/slimta/pkg-descr
Normal file
|
@ -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/
|
Loading…
Reference in a new issue