OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/docker/prod/cron

31 lines
848 B

9 years ago
#!/bin/bash
set -e
IMAP_SSL=${IMAP_SSL:="true"}
IMAP_PORT=${IMAP_PORT:="993"}
IMAP_ENABLED="${IMAP_ENABLED:="true"}"
IMAP_CHECK_INTERVAL="${IMAP_CHECK_INTERVAL:=600}"
while true; do
if [ "$IMAP_ENABLED" = "true" ]; then
echo "[cron] Checking for new emails from IMAP"
bundle exec rake redmine:email:receive_imap \
host="${IMAP_HOST}" \
username="${IMAP_USERNAME}" \
password="${IMAP_PASSWORD}" \
ssl=${IMAP_SSL} \
port=${IMAP_PORT} \
unknown_user="${IMAP_UNKNOWN_USER}" \
no_permission_check="${IMAP_NO_PERMISSION_CHECK}" \
move_on_success="${IMAP_MOVE_ON_SUCCESS}" \
move_on_failure="${IMAP_MOVE_ON_FAILURE}" \
9 years ago
allow_override="${IMAP_ALLOW_OVERRIDE}" || true
else
echo "[cron] IMAP email checking is disabled"
fi
echo "[cron] Rescheduling in ${IMAP_CHECK_INTERVAL}s"
sleep ${IMAP_CHECK_INTERVAL}s
done