freedombone-app-mailpile 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # mailpile app
  12. #
  13. # License
  14. # =======
  15. #
  16. # Copyright (C) 2016 Bob Mottram <bob@freedombone.net>
  17. #
  18. # This program is free software: you can redistribute it and/or modify
  19. # it under the terms of the GNU Affero General Public License as published by
  20. # the Free Software Foundation, either version 3 of the License, or
  21. # (at your option) any later version.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU Affero General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU Affero General Public License
  29. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. VARIANTS="full full-vim mailbox"
  31. IN_DEFAULT_INSTALL=0
  32. SHOW_ON_ABOUT=1
  33. MAILPILE_DOMAIN_NAME=
  34. MAILPILE_CODE=
  35. MAILPILE_ONION_PORT=8103
  36. MAILPILE_REPO="https://github.com/mailpile/Mailpile"
  37. MAILPILE_COMMIT='88ae8e5831dddc628c827c44224166dbdbed91f1'
  38. MAILPILE_PORT=33411
  39. mailpile_variables=(MAILPILE_REPO
  40. MAILPILE_DOMAIN_NAME
  41. MAILPILE_CODE
  42. ONION_ONLY
  43. DDNS_PROVIDER
  44. DEFAULT_DOMAIN_NAME
  45. MY_USERNAME)
  46. function logging_on_mailpile {
  47. echo -n ''
  48. }
  49. function logging_off_mailpile {
  50. echo -n ''
  51. }
  52. function remove_user_mailpile {
  53. remove_username="$1"
  54. ${PROJECT_NAME}-pass -u $remove_username --rmapp mailpile
  55. }
  56. function add_user_mailpile {
  57. ${PROJECT_NAME}-pass -u $1 -a mailpile -p "$2"
  58. }
  59. function install_interactive_mailpile {
  60. if [ ! $ONION_ONLY ]; then
  61. ONION_ONLY='no'
  62. fi
  63. if [[ $ONION_ONLY != "no" ]]; then
  64. MAILPILE_DOMAIN_NAME='mailpile.local'
  65. write_config_param "MAILPILE_DOMAIN_NAME" "$MAILPILE_DOMAIN_NAME"
  66. else
  67. function_check interactive_site_details
  68. interactive_site_details "mailpile" "MAILPILE_DOMAIN_NAME" "MAILPILE_CODE"
  69. fi
  70. APP_INSTALLED=1
  71. }
  72. function change_password_mailpile {
  73. echo -n ''
  74. #${PROJECT_NAME}-pass -u $1 -a mailpile -p "$2"
  75. }
  76. function reconfigure_mailpile {
  77. echo -n ''
  78. }
  79. function upgrade_mailpile {
  80. read_config_param "MAILPILE_DOMAIN_NAME"
  81. CURR_COMMIT=$MAILPILE_COMMIT
  82. if grep -q "mailpile commit" $COMPLETION_FILE; then
  83. CURR_COMMIT=$(get_completion_param "mailpile commit")
  84. fi
  85. if [[ "$CURR_COMMIT" == "$MAILPILE_COMMIT" ]]; then
  86. return
  87. fi
  88. function_check set_repo_commit
  89. set_repo_commit /var/www/$MAILPILE_DOMAIN_NAME/mail "mailpile commit" "$MAILPILE_COMMIT" $MAILPILE_REPO
  90. cd /var/www/$MAILPILE_DOMAIN_NAME/mail
  91. pip install -r requirements.txt
  92. chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail
  93. }
  94. function backup_local_mailpile {
  95. if [ ! -f /etc/systemd/system/mailpile.service ]; then
  96. return
  97. fi
  98. MAILPILE_DOMAIN_NAME='mailpile.local'
  99. if grep -q "mailpile domain" $COMPLETION_FILE; then
  100. MAILPILE_DOMAIN_NAME=$(get_completion_param "mailpile domain")
  101. fi
  102. source_directory=/var/www/${MAILPILE_DOMAIN_NAME}/mail/.local
  103. if [ -d $source_directory ]; then
  104. systemctl stop mailpile
  105. function_check backup_directory_to_usb
  106. backup_directory_to_usb $source_directory mailpile
  107. systemctl start mailpile
  108. fi
  109. }
  110. function restore_local_mailpile {
  111. if [ ! -f /etc/systemd/system/mailpile.service ]; then
  112. return
  113. fi
  114. MAILPILE_DOMAIN_NAME='mailpile.local'
  115. if grep -q "mailpile domain" $COMPLETION_FILE; then
  116. MAILPILE_DOMAIN_NAME=$(get_completion_param "mailpile domain")
  117. fi
  118. if [ $MAILPILE_DOMAIN_NAME ]; then
  119. systemctl stop mailpile
  120. temp_restore_dir=/root/tempmailpile
  121. restore_directory_from_usb $temp_restore_dir mailpile
  122. if [ -d /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local ]; then
  123. mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous
  124. fi
  125. temp_source_dir=$(find ${temp_restore_dir} -name ".local")
  126. cp -r ${temp_source_dir} /var/www/${MAILPILE_DOMAIN_NAME}/mail/
  127. if [ ! "$?" = "0" ]; then
  128. if [ -d mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous ]; then
  129. if [ -d /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous ]; then
  130. rm -rf /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous
  131. fi
  132. mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local
  133. fi
  134. backup_unmount_drive
  135. exit 3685
  136. fi
  137. rm -rf ${temp_restore_dir}
  138. chown -R mailpile: /var/www/$MAILPILE_DOMAIN_NAME/mail/
  139. if [ -d /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME} ]; then
  140. ln -s /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME}/privkey.pem /etc/ssl/private/${MAILPILE_DOMAIN_NAME}.key
  141. ln -s /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME}/fullchain.pem /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem
  142. fi
  143. systemctl start mailpile
  144. fi
  145. }
  146. function backup_remote_mailpile {
  147. if [ ! -f /etc/systemd/system/mailpile.service ]; then
  148. return
  149. fi
  150. MAILPILE_DOMAIN_NAME='mailpile.local'
  151. if grep -q "mailpile domain" $COMPLETION_FILE; then
  152. MAILPILE_DOMAIN_NAME=$(get_completion_param "mailpile domain")
  153. fi
  154. source_directory=/var/www/${MAILPILE_DOMAIN_NAME}/mail/.local
  155. if [ -d $source_directory ]; then
  156. systemctl stop mailpile
  157. function_check backup_directory_to_usb
  158. backup_directory_to_friend $source_directory mailpile
  159. systemctl start mailpile
  160. fi
  161. }
  162. function restore_remote_mailpile {
  163. if [ ! -f /etc/systemd/system/mailpile.service ]; then
  164. return
  165. fi
  166. MAILPILE_DOMAIN_NAME='mailpile.local'
  167. if grep -q "mailpile domain" $COMPLETION_FILE; then
  168. MAILPILE_DOMAIN_NAME=$(get_completion_param "mailpile domain")
  169. fi
  170. if [ $MAILPILE_DOMAIN_NAME ]; then
  171. systemctl stop mailpile
  172. temp_restore_dir=/root/tempmailpile
  173. restore_directory_from_friend $temp_restore_dir mailpile
  174. if [ -d /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local ]; then
  175. mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous
  176. fi
  177. temp_source_dir=$(find ${temp_restore_dir} -name ".local")
  178. cp -r ${temp_source_dir} /var/www/${MAILPILE_DOMAIN_NAME}/mail/
  179. if [ ! "$?" = "0" ]; then
  180. if [ -d mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous ]; then
  181. mv /var/www/${MAILPILE_DOMAIN_NAME}/mail/.previous /var/www/${MAILPILE_DOMAIN_NAME}/mail/.local
  182. fi
  183. backup_unmount_drive
  184. exit 36732
  185. fi
  186. rm -rf ${temp_restore_dir}
  187. chown -R mailpile: /var/www/$MAILPILE_DOMAIN_NAME/mail/
  188. if [ -d /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME} ]; then
  189. ln -s /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME}/privkey.pem /etc/ssl/private/${MAILPILE_DOMAIN_NAME}.key
  190. ln -s /etc/letsencrypt/live/${MAILPILE_DOMAIN_NAME}/fullchain.pem /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem
  191. fi
  192. systemctl start mailpile
  193. fi
  194. }
  195. function remove_mailpile {
  196. if [ ${#MAILPILE_DOMAIN_NAME} -eq 0 ]; then
  197. return
  198. fi
  199. systemctl stop mailpile
  200. systemctl disable mailpile
  201. rm /etc/systemd/system/mailpile.service
  202. systemctl daemon-reload
  203. read_config_param "MAILPILE_DOMAIN_NAME"
  204. nginx_dissite $MAILPILE_DOMAIN_NAME
  205. remove_certs ${MAILPILE_DOMAIN_NAME}
  206. if [ -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME ]; then
  207. rm -f /etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME
  208. fi
  209. if [ -d /var/www/$MAILPILE_DOMAIN_NAME ]; then
  210. rm -rf /var/www/$MAILPILE_DOMAIN_NAME
  211. fi
  212. function_check remove_ddns_domain
  213. remove_ddns_domain $MAILPILE_DOMAIN_NAME
  214. groupdel -f mailpile
  215. userdel -r mailpile
  216. remove_config_param MAILPILE_DOMAIN_NAME
  217. remove_config_param MAILPILE_CODE
  218. function_check remove_onion_service
  219. remove_onion_service mailpile ${MAILPILE_ONION_PORT}
  220. remove_completion_param "install_mailpile"
  221. enable_email_encryption_at_rest
  222. sed -i '/Mailpile/d' $COMPLETION_FILE
  223. sed -i '/mailpile/d' $COMPLETION_FILE
  224. }
  225. function install_mailpile {
  226. if [ ! $ONION_ONLY ]; then
  227. ONION_ONLY='no'
  228. fi
  229. if [ ! $MAILPILE_DOMAIN_NAME ]; then
  230. echo $'The mailpile domain name was not specified'
  231. exit 63824
  232. fi
  233. apt-get -yq install python-pip python-lxml python-dev libjpeg-dev
  234. if [ ! -d /var/www/$MAILPILE_DOMAIN_NAME ]; then
  235. mkdir /var/www/$MAILPILE_DOMAIN_NAME
  236. fi
  237. cd /var/www/$MAILPILE_DOMAIN_NAME
  238. if [ -d /var/www/$MAILPILE_DOMAIN_NAME/mail ]; then
  239. rm -rf /var/www/$MAILPILE_DOMAIN_NAME/mail
  240. fi
  241. if [ -d /repos/mailpile ]; then
  242. mkdir mail
  243. cp -r -p /repos/mailpile/. mail
  244. cd mail
  245. git pull
  246. else
  247. git_clone $MAILPILE_REPO mail
  248. fi
  249. cd mail
  250. git checkout $MAILPILE_COMMIT -b $MAILPILE_COMMIT
  251. set_completion_param "mailpile commit" "$MAILPILE_COMMIT"
  252. if [ ! -f requirements-dev.txt ]; then
  253. echo $'No python requirements file found'
  254. exit 62382
  255. fi
  256. pip install -r requirements.txt
  257. adduser --system --home=/var/www/$MAILPILE_DOMAIN_NAME/mail/ --group mailpile
  258. adduser mailpile debian-tor
  259. adduser mailpile www-data
  260. adduser mailpile mail
  261. adduser mailpile $MY_USERNAME
  262. if [[ $ONION_ONLY == 'no' ]]; then
  263. chgrp -R ssl-cert /etc/letsencrypt
  264. chmod -R g=rX /etc/letsencrypt
  265. usermod -a -G ssl-cert mailpile
  266. fi
  267. chown -R mailpile: /var/www/$MAILPILE_DOMAIN_NAME/mail/
  268. # create folders and tags
  269. su -c "cd /var/www/$MAILPILE_DOMAIN_NAME/mail && ./mp --setup" - mailpile
  270. MAILPILE_ONION_HOSTNAME=$(add_onion_service mailpile 80 ${MAILPILE_ONION_PORT})
  271. echo '[Unit]' > /etc/systemd/system/mailpile.service
  272. echo 'Description=Mailpile Email Client' >> /etc/systemd/system/mailpile.service
  273. echo 'After=syslog.target network.target nginx.target' >> /etc/systemd/system/mailpile.service
  274. echo '' >> /etc/systemd/system/mailpile.service
  275. echo '[Service]' >> /etc/systemd/system/mailpile.service
  276. echo 'User=mailpile' >> /etc/systemd/system/mailpile.service
  277. echo 'Group=mailpile' >> /etc/systemd/system/mailpile.service
  278. echo "WorkingDirectory=/var/www/$MAILPILE_DOMAIN_NAME/mail" >> /etc/systemd/system/mailpile.service
  279. echo "ExecStart=/var/www/$MAILPILE_DOMAIN_NAME/mail/mp --www=0.0.0.0:${MAILPILE_PORT} --wait" >> /etc/systemd/system/mailpile.service
  280. echo 'Restart=always' >> /etc/systemd/system/mailpile.service
  281. echo 'RestartSec=10' >> /etc/systemd/system/mailpile.service
  282. echo '' >> /etc/systemd/system/mailpile.service
  283. echo '[Install]' >> /etc/systemd/system/mailpile.service
  284. echo 'WantedBy=multi-user.target' >> /etc/systemd/system/mailpile.service
  285. chmod +x /etc/systemd/system/mailpile.service
  286. mailpile_nginx_site=/etc/nginx/sites-available/$MAILPILE_DOMAIN_NAME
  287. if [[ $ONION_ONLY == "no" ]]; then
  288. function_check nginx_http_redirect
  289. nginx_http_redirect $MAILPILE_DOMAIN_NAME
  290. echo 'server {' >> $mailpile_nginx_site
  291. echo ' listen 443 ssl;' >> $mailpile_nginx_site
  292. echo ' listen [::]:443 ssl;' >> $mailpile_nginx_site
  293. echo " server_name $MAILPILE_DOMAIN_NAME;" >> $mailpile_nginx_site
  294. echo '' >> $mailpile_nginx_site
  295. echo ' # Security' >> $mailpile_nginx_site
  296. function_check nginx_ssl
  297. nginx_ssl $MAILPILE_DOMAIN_NAME
  298. function_check nginx_disable_sniffing
  299. nginx_disable_sniffing $MAILPILE_DOMAIN_NAME
  300. echo ' add_header Strict-Transport-Security max-age=15768000;' >> $mailpile_nginx_site
  301. echo '' >> $mailpile_nginx_site
  302. echo ' # Logs' >> $mailpile_nginx_site
  303. echo ' access_log /dev/null;' >> $mailpile_nginx_site
  304. echo ' error_log /dev/null;' >> $mailpile_nginx_site
  305. echo '' >> $mailpile_nginx_site
  306. echo ' # Root' >> $mailpile_nginx_site
  307. echo " root /var/www/$MAILPILE_DOMAIN_NAME/mail;" >> $mailpile_nginx_site
  308. echo '' >> $mailpile_nginx_site
  309. echo ' location / {' >> $mailpile_nginx_site
  310. function_check nginx_limits
  311. nginx_limits $MAILPILE_DOMAIN_NAME '15m'
  312. echo ' rewrite /(.*) /$1 break;' >> $mailpile_nginx_site
  313. echo ' proxy_set_header X-Real-IP $remote_addr;' >> $mailpile_nginx_site
  314. echo ' proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> $mailpile_nginx_site
  315. echo ' proxy_set_header Host $http_host;' >> $mailpile_nginx_site
  316. echo ' proxy_set_header X-NginX-Proxy true;' >> $mailpile_nginx_site
  317. echo " proxy_pass http://localhost:${MAILPILE_PORT};" >> $mailpile_nginx_site
  318. echo ' proxy_redirect off;' >> $mailpile_nginx_site
  319. echo ' }' >> $mailpile_nginx_site
  320. echo '' >> $mailpile_nginx_site
  321. nginx_keybase ${MAILPILE_DOMAIN_NAME}
  322. echo '}' >> $mailpile_nginx_site
  323. echo '' >> $mailpile_nginx_site
  324. else
  325. echo -n '' > $mailpile_nginx_site
  326. fi
  327. echo 'server {' >> $mailpile_nginx_site
  328. echo " listen 127.0.0.1:$MAILPILE_ONION_PORT default_server;" >> $mailpile_nginx_site
  329. echo " server_name $MAILPILE_ONION_HOSTNAME;" >> $mailpile_nginx_site
  330. echo '' >> $mailpile_nginx_site
  331. function_check nginx_disable_sniffing
  332. nginx_disable_sniffing $MAILPILE_DOMAIN_NAME
  333. echo '' >> $mailpile_nginx_site
  334. echo ' # Logs' >> $mailpile_nginx_site
  335. echo ' access_log /dev/null;' >> $mailpile_nginx_site
  336. echo ' error_log /dev/null;' >> $mailpile_nginx_site
  337. echo '' >> $mailpile_nginx_site
  338. echo ' # Root' >> $mailpile_nginx_site
  339. echo " root /var/www/$MAILPILE_DOMAIN_NAME/mail;" >> $mailpile_nginx_site
  340. echo '' >> $mailpile_nginx_site
  341. echo ' location / {' >> $mailpile_nginx_site
  342. function_check nginx_limits
  343. nginx_limits $MAILPILE_DOMAIN_NAME '15m'
  344. echo ' rewrite /(.*) /$1 break;' >> $mailpile_nginx_site
  345. echo ' proxy_set_header X-Real-IP $remote_addr;' >> $mailpile_nginx_site
  346. echo ' proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> $mailpile_nginx_site
  347. echo ' proxy_set_header Host $http_host;' >> $mailpile_nginx_site
  348. echo ' proxy_set_header X-NginX-Proxy true;' >> $mailpile_nginx_site
  349. echo " proxy_pass http://localhost:${MAILPILE_PORT};" >> $mailpile_nginx_site
  350. echo ' proxy_redirect off;' >> $mailpile_nginx_site
  351. echo ' }' >> $mailpile_nginx_site
  352. echo '' >> $mailpile_nginx_site
  353. nginx_keybase ${MAILPILE_DOMAIN_NAME}
  354. echo '}' >> $mailpile_nginx_site
  355. function_check create_site_certificate
  356. if [ ! -f /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem ]; then
  357. create_site_certificate $MAILPILE_DOMAIN_NAME 'yes'
  358. fi
  359. if [ -f /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.crt ]; then
  360. mv /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.crt /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem
  361. fi
  362. if [ -f /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem ]; then
  363. chown root:root /etc/ssl/certs/${MAILPILE_DOMAIN_NAME}.pem
  364. sed -i "s|.crt|.pem|g" /etc/nginx/sites-available/${MAILPILE_DOMAIN_NAME}
  365. fi
  366. if [ -f /etc/ssl/private/${MAILPILE_DOMAIN_NAME}.key ]; then
  367. chown root:root /etc/ssl/private/${MAILPILE_DOMAIN_NAME}.key
  368. fi
  369. function_check nginx_ensite
  370. nginx_ensite $MAILPILE_DOMAIN_NAME
  371. ${PROJECT_NAME}-pass -u $MY_USERNAME -a mailpile -p "*"
  372. function_check add_ddns_domain
  373. add_ddns_domain $MAILPILE_DOMAIN_NAME
  374. disable_email_encryption_at_rest
  375. # if strict https is enforced then buttons don't work. This is probably a security bug
  376. sed -i "/Content-Security-Policy/d" $mailpile_nginx_site
  377. # link to the administrator's keyring
  378. if [ -d /var/www/$MAILPILE_DOMAIN_NAME/mail/.gnupg ]; then
  379. mv /var/www/$MAILPILE_DOMAIN_NAME/mail/.gnupg /var/www/$MAILPILE_DOMAIN_NAME/mail/.gnupg_orig
  380. fi
  381. cp -r /home/$MY_USERNAME/.gnupg /var/www/$MAILPILE_DOMAIN_NAME/mail/
  382. chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail/.gnupg
  383. chmod +x /var/www/$MAILPILE_DOMAIN_NAME/mail/.gnupg
  384. pip install jinja2==2.9.6
  385. pip install pgpdump==1.5
  386. # turn off ssl in dovecot
  387. sed -i 's|#ssl =.*|ssl = no|g' /etc/dovecot/conf.d/10-ssl.conf
  388. sed -i 's|ssl =.*|ssl = no|g' /etc/dovecot/conf.d/10-ssl.conf
  389. # set ssl certs, just in case we want to use them later
  390. sed -i "s|#ssl_cert =.*|ssl_cert = </etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.crt|g" /etc/dovecot/conf.d/10-ssl.conf
  391. sed -i "s|ssl_cert =.*|ssl_cert = </etc/ssl/certs/${DEFAULT_DOMAIN_NAME}.crt|g" /etc/dovecot/conf.d/10-ssl.conf
  392. sed -i "s|#ssl_key =.*|ssl_key = </etc/ssl/private/${DEFAULT_DOMAIN_NAME}.key|g" /etc/dovecot/conf.d/10-ssl.conf
  393. sed -i "s|ssl_key =.*|ssl_key = </etc/ssl/private/${DEFAULT_DOMAIN_NAME}.key|g" /etc/dovecot/conf.d/10-ssl.conf
  394. systemctl restart dovecot
  395. systemctl enable mailpile
  396. systemctl daemon-reload
  397. systemctl start mailpile
  398. systemctl restart nginx
  399. set_completion_param "mailpile domain" "$MAILPILE_DOMAIN_NAME"
  400. APP_INSTALLED=1
  401. }
  402. # NOTE: deliberately no exit 0