mmv

mailserver bootstrap script
git clone git://git.yotsev.xyz/mmv.git
Log | Files | Refs | README | LICENSE

commit 2b15b30abe2aca8c23447680eec654e341d86750
parent b0949be2aff95c1bc9c46c5834002cbff73e113e
Author: Petar Yotsev <petar@yotsev.xyz>
Date:   Tue, 14 Dec 2021 11:38:42 +0000

Fix bugs

Diffstat:
Mmmv | 20++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/mmv b/mmv @@ -26,16 +26,21 @@ failure() { \ [ -f /etc/mail/maindom ] && firstuse="false" -[ $firstuse = "true" ] && -echo "$domain" > /etc/mail/maindom - -grep -q "$domain" /etc/mail/domains > /dev/null || -echo "$domain" >> /etc/mail/domains +if [ $firstuse = "true" ] then; + echo "$domain" > /etc/mail/maindom && + echo "$domain" >> /etc/mail/domains && + success "Setting up email for the first time" +else + echo "$domain" >> /etc/mail/domains && + success "Adding domain $domain to existing setup" +fi # # install required software # +[ $firstuse = "true" ] && + pkg_add -u && pkg_add -I opensmtpd-extras opensmtpd-filter-rspamd dovecot \ dovecot-pigeonhole rspamd-3.0 redis sieve tor && @@ -53,7 +58,7 @@ replace files/acme-client.conf >> /etc/acme-client.conf && replace files/httpd.conf >> /etc/httpd.conf && rcctl enable httpd && -rcctl restart httpd && +rcctl start httpd && acme-client -v $maildom && @@ -179,7 +184,6 @@ it can be forwarded to an email address written in: /var/vmail/$domain/admin/.forward Please choose a password for the \"admin\" user." && -madduser $domain admin && -rcctl restart smtpd +madduser $domain admin success "Done!"