SHA256
1
0
forked from pool/fetchmail

Accepting request 492643 from home:pmonrealgonzalez:branches:server:mail

- Allow --syslog option in daemon mode (bsc#1033081).
   * By default, the status messages are redirected to the syslog.

OBS-URL: https://build.opensuse.org/request/show/492643
OBS-URL: https://build.opensuse.org/package/show/server:mail/fetchmail?expand=0&rev=74
This commit is contained in:
Tomáš Chvátal 2017-05-03 13:36:41 +00:00 committed by Git OBS Bridge
parent d31f7e58cc
commit 32866745b4
3 changed files with 28 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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: ""
#