Skip to content

Commit

Permalink
added sendmail and mail configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Sep 6, 2017
1 parent abe0ee7 commit 4d01fd8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion etc/nextcloudpi-config.d/nc-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ EOF
# Default trusted domain ( only from nextcloudpi-config )
test -f /usr/local/bin/nextcloud-domain.sh && bash /usr/local/bin/nextcloud-domain.sh

# more
# email
sudo -u www-data php occ config:system:set mail_smtpmode --value="php"
sudo -u www-data php occ config:system:set mail_smtpauthtype --value="LOGIN"
sudo -u www-data php occ config:system:set mail_from_address --value="admin"
sudo -u www-data php occ config:system:set mail_domain --value="ownyourbits.com"

# other
sudo -u www-data php occ config:system:set overwriteprotocol --value=https
}

Expand Down
3 changes: 2 additions & 1 deletion nextcloudpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ EOF
chmod a+x /usr/local/bin/ncp-update
/usr/local/bin/ncp-update

# External requirements for Apps
# Optional packets for Nextcloud and Apps
$APTINSTALL -o "Dpkg::Options::=--force-confold" php-smbclient
$APTINSTALL postfix
}

configure() { :; }
Expand Down
13 changes: 13 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ inotifywait --monitor --event create --event delete --format '%f %e' /media/ | \
done
EOF
chmod +x /usr/local/etc/nc-automount-links-mon

# install and configure email if not present
type sendmail &>/dev/null || {
echo "Installing and configuring email"
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postfix
OCC=/var/www/nextcloud/occ
sudo -u www-data php $OCC config:system:set mail_smtpmode --value="php"
sudo -u www-data php $OCC config:system:set mail_smtpauthtype --value="LOGIN"
sudo -u www-data php $OCC config:system:set mail_from_address --value="admin"
sudo -u www-data php $OCC config:system:set mail_domain --value="ownyourbits.com"
}

# restart PHP to get updates in the ncp-web
# FIXME: php doesn't come up if run from ncp-web
#(
Expand Down

0 comments on commit 4d01fd8

Please sign in to comment.