File tree Expand file tree Collapse file tree 5 files changed +32
-12
lines changed Expand file tree Collapse file tree 5 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,23 @@ install() {
146146 # Attempt to install systemd units only for Linux.
147147 # Check is done using GOOS instead of uname -s to account for possible
148148 # package cross-compilation.
149- if [ " $( go env GOOS) " = " linux" ]; then
150- command install -m 0755 -d " ${destdir} /${prefix} /lib/systemd/system/"
151- command install -m 0644 " ${builddir} " /systemd/* .service " ${destdir} /${prefix} /lib/systemd/system/"
152- fi
149+ # Though go command might be unavailable if build.sh is run
150+ # with sudo and go installation is user-specific, so fallback
151+ # to using uname -s in the end.
152+ set +e
153+ if command -v go > /dev/null 2> /dev/null; then
154+ set -e
155+ if [ " $( go env GOOS) " = " linux" ]; then
156+ command install -m 0755 -d " ${destdir} /${prefix} /lib/systemd/system/"
157+ command install -m 0644 " ${builddir} " /systemd/* .service " ${destdir} /${prefix} /lib/systemd/system/"
158+ fi
159+ else
160+ set -e
161+ if [ " $( uname -s) " = " Linux" ]; then
162+ command install -m 0755 -d " ${destdir} /${prefix} /lib/systemd/system/"
163+ command install -m 0644 " ${builddir} " /systemd/* .service " ${destdir} /${prefix} /lib/systemd/system/"
164+ fi
165+ fi
153166
154167 if [ -e " ${builddir} " /man ]; then
155168 command install -m 0755 -d " ${destdir} /${prefix} /share/man/man1/"
Original file line number Diff line number Diff line change @@ -54,8 +54,9 @@ KillSignal=SIGTERM
5454AmbientCapabilities =CAP_NET_BIND_SERVICE
5555CapabilityBoundingSet =CAP_NET_BIND_SERVICE
5656
57- # Force all files created by maddy to be only readable by it.
58- UMask =0027
57+ # Force all files created by maddy to be only readable by it
58+ # and maddy group.
59+ UMask =0007
5960
6061# Bump FD limitations. Even idle mail server can have a lot of FDs open (think
6162# of idle IMAP connections, especially ones abandoned on the other end and
Original file line number Diff line number Diff line change @@ -50,8 +50,9 @@ KillSignal=SIGTERM
5050AmbientCapabilities =CAP_NET_BIND_SERVICE
5151CapabilityBoundingSet =CAP_NET_BIND_SERVICE
5252
53- # Force all files created by maddy to be only readable by it.
54- UMask =0027
53+ # Force all files created by maddy to be only readable by it and
54+ # maddy group.
55+ UMask =0007
5556
5657# Bump FD limitations. Even idle mail server can have a lot of FDs open (think
5758# of idle IMAP connections, especially ones abandoned on the other end and
Original file line number Diff line number Diff line change @@ -34,17 +34,19 @@ $ git clone https://github.com/foxcpp/maddy.git
3434$ cd maddy
3535```
3636
37- 3 . Select the appropriate version to build:
37+ 2 . Select the appropriate version to build:
3838```
3939$ git checkout v0.7.0 # a specific release
4040$ git checkout master # next bugfix release
4141$ git checkout dev # next feature release
4242```
4343
44- 2 . Build & install it
44+ 3 . Build & install it
4545```
4646$ ./build.sh
47- # ./build.sh install
47+ $ sudo ./build.sh install
4848```
4949
50- 3 . Have fun!
50+ 4 . Finish setup as described in [ Setting up] ( ../setting-up ) (starting from System configuration).
51+
52+
Original file line number Diff line number Diff line change @@ -246,6 +246,9 @@ storage account:
246246$ maddy imap-acct create postmaster@example.org
247247```
248248
249+ Note: to run `maddy` CLI commands, your user should be in the `maddy`
250+ group. Alternatively, just use `sudo -u maddy`.
251+
249252That is it. Now you have your first e-mail address. when authenticating using
250253your e-mail client, do not forget the username is "postmaster@example.org", not
251254just "postmaster".
You can’t perform that action at this time.
0 commit comments