diff --git a/fetchmail.changes b/fetchmail.changes index cb6a83c..7cb4f1d 100644 --- a/fetchmail.changes +++ b/fetchmail.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 28 13:55:29 UTC 2017 - pmonrealgonzalez@suse.com + + - Allow --syslog option in daemon mode (bsc#1033081). + * By default, the status messages are redirected to the syslog. + ------------------------------------------------------------------- Fri Mar 31 06:17:12 UTC 2017 - meissner@suse.com diff --git a/fetchmail.exec b/fetchmail.exec index 981792d..a9d4964 100644 --- a/fetchmail.exec +++ b/fetchmail.exec @@ -2,20 +2,26 @@ # fetchmail-systemd-exec: sysconfig helper script for systemd die() { - echo "$@" 1>&2 - exit 5 # closest thing among fetchmail's exit codes + echo "$@" 1>&2 + exit 5 # closest thing among fetchmail's exit codes } echo "$FETCHMAIL_POLLING_INTERVAL" | grep -Eq '^[0-9]+$' \ - || die 'invalid $FETCHMAIL_POLLING_INTERVAL setting' + || die 'invalid $FETCHMAIL_POLLING_INTERVAL setting' [ -r "$FETCHMAIL_RC_PATH" ] \ - || die '$FETCHMAIL_RC_PATH does not exist or cannot be read' + || die '$FETCHMAIL_RC_PATH does not exist or cannot be read' OPTS="-d $FETCHMAIL_POLLING_INTERVAL" [ "$FETCHMAIL_FETCHALL" = "yes" ] && OPTS="$OPTS -a" [ "$FETCHMAIL_SILENT" = "yes" ] && OPTS="$OPTS -s" [ "`whoami`" = "fetchmail" -a -z "$FETCHMAILHOME" ] && \ - export FETCHMAILHOME=/var/lib/fetchmail + export FETCHMAILHOME=/var/lib/fetchmail + +if [ "$FETCHMAIL_DEFAULT_LOGFILE" = "syslog" -o "$FETCHMAIL_DEFAULT_LOGFILE" = "" ]; then + OPTS="$OPTS --syslog" +else + OPTS="$OPTS -L $FETCHMAIL_DEFAULT_LOGFILE" +fi exec /usr/bin/fetchmail $OPTS $FETCHMAIL_EXPERT_OPTIONS \ - -f $FETCHMAIL_RC_PATH -L /var/log/fetchmail + -f $FETCHMAIL_RC_PATH diff --git a/sysconfig.fetchmail b/sysconfig.fetchmail index f49809c..b83f942 100644 --- a/sysconfig.fetchmail +++ b/sysconfig.fetchmail @@ -27,6 +27,16 @@ FETCHMAIL_FETCHALL="yes" # FETCHMAIL_SILENT="no" +## Type: string +## Default: "syslog" +## Options: "syslog", "/path/to/file" +# +# This option allows to redirect status messages in daemon mode to the +# specified log file or syslog(3) system if available. If empty, status +# messages are redirected syslog. +# +FETCHMAIL_DEFAULT_LOGFILE="syslog" + ## Type: string ## Default: "" #