/
Portfile
88 lines (66 loc) · 2.85 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup golang 1.0
go.setup github.com/foxcpp/maddy 0.7.1 v
github.tarball_from archive
revision 0
homepage https://maddy.email
description Composable all-in-one mail server
long_description \
Maddy Mail Server implements all functionality required to run a e-mail \
server. It can send messages via SMTP (works as MTA), accept messages via \
SMTP (works as MX) and store messages while providing access to them via \
IMAP. In addition to that it implements auxiliary protocols that are \
mandatory to keep email reasonably secure (DKIM, SPF, DMARC, DANE, \
MTA-STS). It replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC and \
more with one daemon with uniform configuration and minimal maintenance \
cost.
categories mail
installs_libs no
license GPL-3
maintainers {gmail.com:herby.gillot @herbygillot} \
openmaintainer
checksums rmd160 859f1a140575c19ae3f25c67e482a0234e4ddbb9 \
sha256 541288477afb040a04a5cf17a1c3e3b7a81b287dc3a81c844b2d6ad66688c29e \
size 410871
depends_build-append \
port:scdoc
patchfiles patch-build.sh.diff
post-patch {
reinplace "s|/etc/maddy|${prefix}/etc/maddy|g" ${worksrcpath}/maddy.conf
}
set maddy_logfile ${prefix}/var/log/${name}.log
# Allow Go to fetch dependencies at build time
go.offline_build no
build.cmd ./build.sh
build.pre_args --prefix ${prefix} \
--destdir ${destroot}
build.args build
destroot.keepdirs ${destroot}${prefix}/var/lib/maddy \
${destroot}${prefix}/var/run/maddy \
${destroot}${prefix}/libexec/maddy
if {"darwin" eq ${os.platform} && ${os.major} > 8} {
set svcuser _${name}
} else {
set svcuser ${name}
}
add_users ${svcuser} group=${svcuser} realname=Maddy\ Email\ Server
startupitem.create yes
startupitem.executable \
maddy run
startupitem.logfile ${maddy_logfile}
startupitem.user ${svcuser}
destroot {
system -W ${worksrcpath} \
"${build.env} ./build.sh --prefix ${prefix} --destdir ${destroot} install"
xinstall -d -o ${svcuser} -m 0700 ${destroot}${prefix}/var/lib/maddy
xinstall -d -o ${svcuser} -m 0700 ${destroot}${prefix}/var/run/maddy
xinstall -d ${destroot}${prefix}/libexec/maddy
touch ${destroot}${maddy_logfile}
file attributes \
${destroot}${maddy_logfile} -owner ${svcuser} -group ${svcuser}
}
notes-append "
Before loading the maddy service, adjust configuration in ${prefix}/etc/maddy,
as well as generating certificates and other necessary prerequisites.
"