[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.94.dfsg.2-1-432-g37eccf9

Michael Tautschnig mt at debian.org
Mon Mar 23 15:12:13 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8e57c5c041958ff0ec2713ee5cea16c4c2a4c83e
Author: Michael Tautschnig <mt at debian.org>
Date:   Mon Mar 23 16:00:25 2009 +0100

    Started preparations for clamav-milter configuration
    
    - rules: make sure that all options are handled in postinst
    - clamav-milter.config.in, clamav-milter.templates: debconf support
    - clamav-milter.postinst.in: Should handle debconf'ed setup, but that part is
      not done yet
    
    Signed-off-by: Michael Tautschnig <mt at debian.org>

diff --git a/debian/clamav-milter.config.in b/debian/clamav-milter.config.in
new file mode 100644
index 0000000..469b2ae
--- /dev/null
+++ b/debian/clamav-milter.config.in
@@ -0,0 +1,512 @@
+#!/bin/sh -e
+
+# Source debconf library
+. /usr/share/debconf/confmodule
+
+# This conf script is capable of backing up
+db_version 2.0
+db_capb backup
+
+#COMMON-FUNCTIONS#
+
+CLAMAVMILTERCONF='/etc/clamav/clamav-milter.conf'
+
+slurp_config "$CLAMAVMILTERCONF"
+
+# Store conf file values as debconf answers - make sure user changes made 
+# outside of debconf are preserved
+if [ -n "$MilterSocket" ]; then
+  db_set clamav-milter/MilterSocket "$MilterSocket" || true
+fi
+if [ "$FixStaleSocket" = "true" ]; then
+  db_set clamav-milter/FixStaleSocket true || true
+fi
+if [ -n "$User" ]; then
+  db_set clamav-milter/User "$User" || true
+  if ! [ "$User" = 'root' ]; then
+    AddGroups=`groups "$User" | awk -F ':' '{print $2}' | sed -e s/"$User"//`
+  fi
+  if [ -n "$AddGroups" ]; then
+    db_set clamav-milter/AddGroups "$AddGroups" || true
+  fi
+fi
+if [ "$AllowSupplementaryGroups" = "true" ]; then
+  db_set clamav-milter/AllowSupplementaryGroups true || true
+fi
+if [ -n "$ReadTimeout" ]; then
+  db_set clamav-milter/ReadTimeout "$ReadTimeout" || true
+fi
+if [ "$Foreground" = "true" ]; then
+  db_set clamav-milter/Foreground true || true
+fi
+if [ -n "$Chroot" ]; then
+  db_set clamav-milter/Chroot "$Chroot" || true
+fi
+if [ -n "$PidFile" ]; then
+  db_set clamav-milter/PidFile "$PidFile" || true
+fi
+if [ -n "$TemporaryDirectory" ]; then
+  db_set clamav-milter/TemporaryDirectory "$TemporaryDirectory" || true
+fi
+if [ -n "$ClamdSocket" ]; then
+  db_set clamav-milter/ClamdSocket "$ClamdSocket" || true
+fi
+if [ -n "$LocalNet" ]; then
+  db_set clamav-milter/LocalNet "$LocalNet" || true
+fi
+if [ -n "$Whitelist" ]; then
+  db_set clamav-milter/Whitelist "$Whitelist" || true
+fi
+if [ -n "$OnClean" ]; then
+  db_set clamav-milter/OnClean "$OnClean" || true
+fi
+if [ -n "$OnInfected" ]; then
+  db_set clamav-milter/OnInfected "$OnInfected" || true
+fi
+if [ -n "$OnFail" ]; then
+  db_set clamav-milter/OnFail "$OnFail" || true
+fi
+if [ -n "$RejectMsg" ]; then
+  db_set clamav-milter/RejectMsg "$RejectMsg" || true
+fi
+if [ "$AddHeader" = "true" ]; then
+  db_set clamav-milter/AddHeader true || true
+fi
+if [ -n "$LogFile" ]; then
+  db_set clamav-milter/LogFile "$LogFile" || true
+fi
+if [ "$LogFileUnlock" = "true" ]; then
+  db_set clamav-milter/LogFileUnlock true || true
+fi
+if [ -n "$LogFileMaxSize" ]; then
+  LogFileMaxSize="`echo $LogFileMaxSize | sed -e s/M//`"
+  db_set clamav-milter/LogFileMaxSize "$LogFileMaxSize" || true
+fi
+if [ "$LogTime" = "true" ]; then
+  db_set clamav-milter/LogTime true || true
+fi
+if [ "$LogSyslog" = "true" ]; then
+  db_set clamav-milter/LogSyslog true || true
+fi
+if [ -n "$LogFacility" ]; then
+  db_set clamav-milter/LogFacility "$LogFacility" || true
+fi
+if [ "$LogVerbose" = "true" ]; then
+  db_set clamav-milter/LogVerbose true || true
+fi
+if [ -n "$MaxFileSize" ]; then
+  MaxFileSize="`echo $MaxFileSize | sed -e s/M//`"
+  db_set clamav-milter/MaxFileSize "$MaxFileSize" || true
+fi
+
+# Functions
+
+isdigit ()
+{
+  case $1 in
+    [[:digit:]]*)
+    ISDIGIT=1
+    ;;
+    *)
+    ISDIGIT=0
+    ;;
+  esac
+}
+
+inputdigit ()
+{
+  ISDIGIT=0
+  while [ "$ISDIGIT" = '0' ]; do
+    db_input "$1" "$2" || true
+    if ! db_go; then
+      return 30
+    fi
+    db_get $2 || true
+    isdigit $RET
+    if [ "$ISDIGIT" = '0' ]; then
+      db_input critical clamav-milter/numinfo || true
+      db_go
+    fi
+  done
+  return 0
+}
+
+# States
+
+StateDebconf()
+{
+  db_input medium clamav-milter/debconf || true
+  if ! db_go; then
+    STATE="End"
+  else
+    db_get clamav-milter/debconf || true
+    if [ "$RET" = "false" ]; then
+      STATE="End"
+    else
+      STATE="MilterSocket"
+    fi
+  fi
+}
+
+StateMilterSocket()
+{
+  db_input low clamav-milter/MilterSocket || true
+  if db_go; then
+    STATE="FixStaleSocket"
+  else
+    STATE="Debconf"
+  fi
+}
+
+StateFixStaleSocket()
+{
+  db_input low clamav-milter/FixStaleSocket || true
+  if db_go; then
+    STATE="User"
+  else
+    STATE="MilterSocket"
+  fi
+}
+
+StateUser()
+{
+  db_input medium clamav-milter/User || true
+  if db_go; then
+    db_metaget clamav-milter/User value
+    if [ "$RET" = "" ]; then
+      db_set clamav-milter/User "clamav" || true
+    fi
+    STATE="AllowSupplementaryGroups"
+  else
+    STATE="FixStaleSocket"
+  fi
+}
+
+StateAllowSupplementaryGroups()
+{
+  db_input low clamav-milter/AllowSupplementaryGroups || true
+  if db_go; then
+    STATE="ReadTimeout"
+  else
+    STATE="User"
+  fi
+}
+
+StateReadTimeout()
+{
+  if inputdigit low clamav-milter/ReadTimeout ; then
+    STATE="Foreground"
+  else
+    STATE="AllowSupplementaryGroups"
+  fi
+}
+
+StateForeground()
+{
+  db_input low clamav-milter/Foreground || true
+  if db_go; then
+    STATE="Chroot"
+  else
+    STATE="ReadTimeout"
+  fi
+}
+
+StateChroot()
+{
+  db_input low clamav-milter/Chroot || true
+  if db_go; then
+    STATE="PidFile"
+  else
+    STATE="Foreground"
+  fi
+}
+
+StatePidFile()
+{
+  db_input low clamav-milter/PidFile || true
+  if db_go; then
+    STATE="TemporaryDirectory"
+  else
+    STATE="Chroot"
+  fi
+}
+
+StateTemporaryDirectory()
+{
+  db_input low clamav-milter/TemporaryDirectory || true
+  if db_go; then
+    STATE="ClamdSocket"
+  else
+    STATE="PidFile"
+  fi
+}
+
+StateClamdSocket()
+{
+  db_input low clamav-milter/ClamdSocket || true
+  if db_go; then
+    STATE="LocalNet"
+  else
+    STATE="TemporaryDirectory"
+  fi
+}
+
+StateLocalNet()
+{
+  db_input low clamav-milter/LocalNet || true
+  if db_go; then
+    STATE="Whitelist"
+  else
+    STATE="ClamdSocket"
+  fi
+}
+
+StateWhitelist()
+{
+  db_input low clamav-milter/Whitelist || true
+  if db_go; then
+    STATE="OnClean"
+  else
+    STATE="LocalNet"
+  fi
+}
+
+StateOnClean()
+{
+  db_input low clamav-milter/OnClean || true
+  if db_go; then
+    STATE="OnInfected"
+  else
+    STATE="Whitelist"
+  fi
+}
+
+StateOnInfected()
+{
+  db_input low clamav-milter/OnInfected || true
+  if db_go; then
+    STATE="OnFail"
+  else
+    STATE="OnClean"
+  fi
+}
+
+StateOnFail()
+{
+  db_input low clamav-milter/OnFail || true
+  if db_go; then
+    STATE="RejectMsg"
+  else
+    STATE="OnInfected"
+  fi
+}
+
+StateRejectMsg()
+{
+  db_input low clamav-milter/RejectMsg || true
+  if db_go; then
+    STATE="AddHeader"
+  else
+    STATE="OnFail"
+  fi
+}
+
+StateAddHeader()
+{
+  db_input low clamav-milter/AddHeader || true
+  if db_go; then
+    STATE="LogFile"
+  else
+    STATE="RejectMsg"
+  fi
+}
+
+StateLogFile()
+{
+  db_input low clamav-milter/LogFile || true
+  if db_go; then
+    db_metaget clamav-milter/LogFile value
+    if [ "$RET" = "" ]; then
+      db_set clamav-milter/LogFile "/var/log/clamav/clamav-milter.log" || true
+      STATE="LogFileUnlock"
+    elif [ "$RET" = 'none' ]; then
+      db_set clamav-milter/LogFile "" || true
+      STATE="LogSyslog"
+    else
+      STATE="LogFileUnlock"
+    fi
+  else
+    STATE="AddHeader"
+  fi
+}
+
+StateLogFileUnlock()
+{
+  db_input low clamav-milter/LogFileUnlock || true
+  if db_go; then
+    STATE="LogFileMaxSize"
+  else
+    STATE="LogFile"
+  fi
+}
+
+StateLogFileMaxSize()
+{
+  if inputdigit low clamav-milter/LogFileMaxSize ; then
+    STATE="LogTime"
+  else
+    STATE="LogFileUnlock"
+  fi
+}
+
+StateLogTime()
+{
+  db_input low clamav-milter/LogTime || true
+  if db_go; then
+    STATE="LogSyslog"
+  else
+    STATE="LogFileMaxSize"
+  fi
+}
+
+StateLogSyslog()
+{
+  db_input low clamav-milter/LogSyslog || true
+  if db_go; then
+    STATE="LogFacility"
+  else
+    STATE="LogTime"
+  fi
+}
+
+StateLogFacility()
+{
+  db_input low clamav-milter/LogFacility || true
+  if db_go; then
+    STATE="LogVerbose"
+  else
+    STATE="LogSyslog"
+  fi
+}
+
+StateLogVerbose()
+{
+  db_input low clamav-milter/LogVerbose || true
+  if db_go; then
+    STATE="MaxFileSize"
+  else
+    STATE="LogFacility"
+  fi
+}
+
+StateMaxFileSize()
+{
+  if inputdigit low clamav-milter/MaxFileSize ; then
+    STATE="End"
+  else
+    STATE="LogVerbose"
+  fi
+}
+
+
+# To many options to configure at configure
+if [ "$1" = "reconfigure" ]; then
+  STATE="Init"
+elif [ -n "$2" ]; then
+  if [ -z "$User" ]; then
+    STATE="User"
+  fi
+else
+  STATE="End"
+fi
+
+[ -z "$STATE" ] && STATE='End'
+
+# This is the statemachine that controls execution. All the 'real' work is 
+# performed by subfunctions above. 
+
+while [ "$STATE" != "End" ]; do
+  case "$STATE" in
+    "Init")
+    StateDebconf
+    ;;
+    "MilterSocket")
+    StateMilterSocket
+    ;;
+    "FixStaleSocket")
+    StateFixStaleSocket
+    ;;
+    "User")
+    StateUser
+    ;;
+    "AllowSupplementaryGroups")
+    StateAllowSupplementaryGroups
+    ;;
+    "ReadTimeout")
+    StateReadTimeout
+    ;;
+    "Foreground")
+    StateForeground
+    ;;
+    "Chroot")
+    StateChroot
+    ;;
+    "PidFile")
+    StatePidFile
+    ;;
+    "TemporaryDirectory")
+    StateTemporaryDirectory
+    ;;
+    "ClamdSocket")
+    StateClamdSocket
+    ;;
+    "LocalNet")
+    StateLocalNet
+    ;;
+    "Whitelist")
+    StateWhitelist
+    ;;
+    "OnClean")
+    StateOnClean
+    ;;
+    "OnInfected")
+    StateOnInfected
+    ;;
+    "OnFail")
+    StateOnFail
+    ;;
+    "RejectMsg")
+    StateRejectMsg
+    ;;
+    "AddHeader")
+    StateAddHeader
+    ;;
+    "LogFile")
+    StateLogFile
+    ;;
+    "LogFileUnlock")
+    StateLogFileUnlock
+    ;;
+    "LogFileMaxSize")
+    StateLogFileMaxSize
+    ;;
+    "LogTime")
+    StateLogTime
+    ;;
+    "LogSyslog")
+    StateLogSyslog
+    ;;
+    "LogFacility")
+    StateLogFacility
+    ;;
+    "LogVerbose")
+    StateLogVerbose
+    ;;
+    "MaxFileSize")
+    StateMaxFileSize
+    ;;
+  esac
+done
+db_stop || true
+exit 0
+
diff --git a/debian/clamav-daemon.postinst.in b/debian/clamav-milter.postinst.in
similarity index 77%
copy from debian/clamav-daemon.postinst.in
copy to debian/clamav-milter.postinst.in
index 26c98f9..ba958a4 100644
--- a/debian/clamav-daemon.postinst.in
+++ b/debian/clamav-milter.postinst.in
@@ -30,11 +30,11 @@ case "$1" in
 
   UCFVER=`check_ucf`
 
-  CLAMAVCONF=/etc/clamav/clamd.conf
-  DEBROTATEFILE=/var/lib/clamav/clamdrotate.debconf
-  CLAMAVROTATEFILE=/etc/logrotate.d/clamav-daemon
+  CLAMAVMILTERCONF=/etc/clamav/clamav-milter.conf
+  DEBROTATEFILE=/var/lib/clamav/clamav-milter.rotate.debconf
+  CLAMAVROTATEFILE=/etc/logrotate.d/clamav-milter
   
-  slurp_config "$CLAMAVCONF"
+  slurp_config "$CLAMAVMILTERCONF"
 
   if [ -n "$LogFile" ]; then
     if echo "$LogFile" | grep -q '^/dev/'; then
@@ -51,25 +51,25 @@ case "$1" in
       echo "     delaycompress" >> $DEBROTATEFILE
       echo "     create 640  $User adm" >> $DEBROTATEFILE
       echo "     postrotate" >> $DEBROTATEFILE
-      echo "     /etc/init.d/clamav-daemon reload-log > /dev/null" >> $DEBROTATEFILE
+      echo "     /etc/init.d/clamav-milter reload-log > /dev/null" >> $DEBROTATEFILE
       echo "     endscript" >> $DEBROTATEFILE
       echo "     }" >> $DEBROTATEFILE
       touch "$LogFile"
       chown "$User":adm "$LogFile"
       chmod 0640 "$LogFile"
       ucf_cleanup "$CLAMAVROTATEFILE"
-      ucf_upgrade_check "$CLAMAVROTATEFILE" "$DEBROTATEFILE" /var/lib/ucf/cache/:etc:logrotate.d:clamav-daemon
+      ucf_upgrade_check "$CLAMAVROTATEFILE" "$DEBROTATEFILE" /var/lib/ucf/cache/:etc:logrotate.d:clamav-milter
       rm -f $DEBROTATEFILE
     else
       if [ -e "$CLAMAVROTATEFILE" ]; then
-        echo "Disabling old logrotate script for clamav-daemon"
+        echo "Disabling old logrotate script for clamav-milter"
         mv "$CLAMAVROTATEFILE" "$CLAMAVROTATEFILE".dpkg-old
         ucf -p "$CLAMAVROTATEFILE"
       fi
     fi
   else
     if [ -e "$CLAMAVROTATEFILE" ]; then
-      echo "Disabling old logrotate script for clamav-daemon"
+      echo "Disabling old logrotate script for clamav-milter"
       mv "$CLAMAVROTATEFILE" "$CLAMAVROTATEFILE".dpkg-old
       ucf -p "$CLAMAVROTATEFILE"
     fi
@@ -89,14 +89,4 @@ esac
 
 #DEBHELPER#
 
-rm -f /var/run/clamav-daemon-being-upgraded
-if [ -e "/var/run/clamav-daemon-being-upgraded.milter-restart" ] ; then
-  if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-    invoke-rc.d clamav-milter start
-  else
-    /etc/init.d/clamav-milter start
-  fi
-  rm /var/run/clamav-daemon-being-upgraded.milter-restart
-fi
-
 exit 0
diff --git a/debian/clamav-milter.templates b/debian/clamav-milter.templates
new file mode 100644
index 0000000..27d7032
--- /dev/null
+++ b/debian/clamav-milter.templates
@@ -0,0 +1,217 @@
+Template: clamav-milter/debconf
+Type: boolean
+Default: true
+_Description: Handle the configuration file automatically?
+ Some options must be configured for clamav-milter.
+ .
+ The ClamAV suite won't work if it isn't configured. If you do not
+ configure it automatically, you'll have to configure
+ /etc/clamav/clamav-milter.conf manually or run 'dpkg-reconfigure clamav-milter'
+ later. In any case, manual changes in /etc/clamav/clamav-milter.conf will
+ be respected.
+
+Template: clamav-milter/MilterSocket
+Type: string
+Default: /var/run/clamav/milter.ctl
+_Description: Define the interface through which we communicate with sendmail
+ This option is mandatory! Possible formats are:
+ [[unix|local]:]/path/to/file - to specify a unix domain socket
+ inet:port@[hostname|ip-address] - to specify an ipv4 socket
+ inet6:port@[hostname|ip-address] - to specify an ipv6 socket
+
+Template: clamav-milter/FixStaleSocket
+Type: boolean
+Default: true
+_Description: Remove stale socket after unclean shutdown.
+
+Template: clamav-milter/User
+Type: string
+Default: clamav
+_Description: User to run clamav-milter as:
+ It is recommended to run the ClamAV programs as a non-privileged user.
+ This will work with most MTAs with a little tweaking, but if you want to
+ use clamd for filesystem scans, running as root is probably unavoidable.
+ Please see README.Debian in the clamav-base package for details.
+
+Template: clamav-milter/AddGroups
+Type: string
+_Description: Groups for clamav-milter (space-separated):
+ Please enter any extra groups for clamd.
+ .
+ By default, clamd runs as a non-privileged user. If you need clamav-milter to
+ be able to access files owned by another user (e.g., in combination with
+ an MTA), then you will need to add clamav to the group for that piece of
+ software. Please see README.Debian in the clamav-base package for details.
+
+Template: clamav-milter/AllowSupplementaryGroups
+Type: boolean
+Default: false
+_Description: Initialize supplementary group access.
+
+Template: clamav-milter/ReadTimeout
+Type: string
+Default: 120
+_Description: Waiting for data from clamd will timeout after this time (seconds).
+ Value of 0 disables the timeout.
+
+Template: clamav-milter/Foreground
+Type: boolean
+Default: false
+_Description: Don't fork into background.
+
+Template: clamav-milter/Chroot
+Type: string
+_Description: Chroot to the specified directory.
+ Chrooting is performed just after reading the config file and before dropping
+ privileges. An empty values means don't chroot.
+
+Template: clamav-milter/PidFile
+Type: string
+Default: /var/run/clamav/clamav-milter.pid
+_Description: PID file
+ This option allows you to save a process identifier of the listening daemon
+ (main thread).
+
+Template: clamav-milter/TemporaryDirectory
+Type: string
+Default: /tmp
+_Description: Optional path to the global temporary directory.
+  Default: system specific (usually /tmp or /var/tmp).
+
+Template: clamav-milter/ClamdSocket
+Type: string
+Default: unix:/var/run/clamav/clamd.ctl
+_Description: Define the clamd socket to connect to for scanning.
+ This option is mandatory! Syntax:
+ unix:path
+ tcp:host:port
+ The first syntax specifies a local unix socket (needs an bsolute path) e.g.:
+     unix:/var/run/clamd/clamd.socket
+ The second syntax specifies a tcp local or remote tcp socket: the host can be a
+ hostname or an ip address; the ":port" field is only required for IPv6
+ addresses, otherwise it defaults to 3310
+     tcp:192.168.0.1
+ .
+ This option can be repeated several times (separated by whitespace) with
+ different sockets or even with the same socket: clamd servers will be selected
+ in a round-robin fashion.
+
+Template: clamav-milter/LocalNet
+Type: string
+_Description: Exclusions - IP ranges
+ Messages originating from these hosts/networks will not be scanned.  This
+ option takes a host(name)/mask pair in CIRD notation and can be repeated
+ several times. If "/mask" is omitted, a host is assumed.  To specify a locally
+ orignated, non-smtp, email use the keyword "local".
+ .
+ If unset,  everything regardless of the origin is scanned.
+
+Template: clamav-milter/Whitelist
+Type: string
+_Description: Exclusions - Regular expressions
+ This option specifies a file which contains a list of POSIX regular
+ expressions. Addresses (sent to or from - see below) matching these regexes
+ will not be scanned.  Optionally each line can start with the string "From:" or
+ "To:" (note: no whitespace after the colon) indicating if it is, respectively,
+ the sender or recipient that is to be whitelisted.  If the field is missing,
+ "To:" is assumed.
+ Lines in this file starting with #, : or ! are ignored.
+
+Template: clamav-milter/OnClean
+Type: select
+Choices: Accept, Reject, Defer, Blackhole, Quarantine
+Default: Accept
+_Description: Action to be performed on clean messages (mostly useful for testing)
+ The following group of options controls the delievery process under
+ different circumstances.
+ The following actions are available:
+ - Accept
+   The message is accepted for delievery
+ - Reject
+   Immediately refuse delievery (a 5xx error is returned to the peer)
+ - Defer
+   Return a temporary failure message (4xx) to the peer
+ - Blackhole (not available for OnFail)
+   Like accept but the message is sent to oblivion
+ - Quarantine (not available for OnFail)
+   Like accept but message is quarantined instead of being delivered
+   In sendmail the quarantine queue can be examined via mailq -qQ
+   For Postfix this causes the message to be accepted but placed on hold
+
+Template: clamav-milter/OnInfected
+Type: select
+Choices: Accept, Reject, Defer, Blackhole, Quarantine
+Default: Quarantine
+_Description: Action to be performed on infected messages
+
+Template: clamav-milter/OnFail
+Type: select
+Choices: Accept, Reject, Defer, Blackhole, Quarantine
+Default: Defer
+_Description: Action to be performed on error conditions
+ This includes failure to allocate data structures, no scanners available,
+ network timeouts, unknown scanner replies and the like)
+
+Template: clamav-milter/RejectMsg
+Type: string
+_Description: This option allows to set a specific rejection reason for infected messages
+ It is therefore only useful together with "OnInfected Reject".
+ The string "%v", if present, will be replaced with the virus name.
+
+Template: clamav-milter/AddHeader
+Type: boolean
+Default: false
+_Description: Add headers to processed messages
+ If this option is set to Yes, an "X-Virus-Scanned" and an "X-Virus-Status"
+ headers will be attached to each processed message, possibly replacing existing
+ headers. 
+
+Template: clamav-milter/LogFile
+Type: string
+Default: none
+_Description: Set to a proper path to enable logging.
+ LogFile must be writable for the user running daemon.
+ A full path is required.
+ .
+ Logging via syslog is configured independently of this entry.
+
+Template: clamav-milter/LogFileUnlock
+Type: boolean
+Default: false
+_Description: By default the log file is locked for writing.
+ The lock protects against running clamav-milter multiple times.  This option
+ disables log file locking.
+
+Template: clamav-milter/LogFileMaxSize
+Type: string
+Default: 1M
+_Description: Maximum size of the log file (unit Mb).
+ Value of 0 disables the limit.
+
+Template: clamav-milter/LogTime
+Type: boolean
+Default: false
+_Description: Log time with each message.
+
+Template: clamav-milter/LogSyslog
+Type: boolean
+Default: false
+_Description: Use system logger (can work together with LogFile).
+
+Template: clamav-milter/LogFacility
+Type: string
+Default: LOG_LOCAL6
+_Description: Specify the type of syslog messages.
+ Please refer to 'man syslog' for facility names.
+
+Template: clamav-milter/LogVerbose
+Type: boolean
+Default: false
+_Description: Enable verbose logging.
+
+Template: clamav-milter/MaxFileSize
+Type: string
+Default: 25M
+_Description: Messages larger than this value won't be scanned (unit Mb).
+ Make sure this value is lower than StreamMaxLength in clamd.conf
+
diff --git a/debian/rules b/debian/rules
index a71b3d4..265fa3f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,6 +49,12 @@ config.status: configure
 	    exit 1; \
 	  fi;\
 	done;
+	egrep '^#[[:alpha:]]' etc/clamav-milter.conf | sed -e 's/^#//' | awk '{print $$1}' | while read opt; do \
+	  if ! grep -q "$${opt}" debian/clamav-milter.postinst.in ; then \
+	    echo "Unhandled option (clamav-milter.conf): $${opt}"; \
+	    exit 1; \
+	  fi;\
+	done;
 	# Add here commands to configure the package.
 	./configure --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --disable-clamav --with-dbdir=/var/lib/clamav/ --sysconfdir=/etc/clamav --enable-milter --disable-clamuko --with-gnu-ld --enable-dns-fix ${DEBUG_OPTS} --disable-unrar --libdir=\$${prefix}/lib --with-system-tommath  --with-ltdl-include=/usr/include --with-ltdl-lib=/usr/lib
 
@@ -69,10 +75,13 @@ build-arch-stamp:  config.status
 ifeq ($(PO2DEBCONF),yes)
 	po2debconf -e utf8 debian/clamav-base.templates.master > debian/clamav-base.templates
 	po2debconf -e utf8 debian/clamav-freshclam.templates.master > debian/clamav-freshclam.templates
+	po2debconf -e utf8 debian/clamav-milter.templates.master > debian/clamav-milter.templates
 endif
 
 	$(MAKE) CFLAGS="${CFLAGS}" pkgdatadir=/var/lib/clamav/ all
 	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-milter.init.in > debian/clamav-milter.init
+	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-milter.config.in > debian/clamav-milter.config
+	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-milter.postinst.in > debian/clamav-milter.postinst
 	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-daemon.postinst.in > debian/clamav-daemon.postinst
 	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-daemon.init.in > debian/clamav-daemon.init
 	perl -pe 's~#COMMON-FUNCTIONS#~qx{cat debian/common_functions}~eg' < debian/clamav-freshclam.init.in > debian/clamav-freshclam.init
@@ -95,6 +104,8 @@ endif
 	rm -f debian/clamav-daemon.postinst
 	rm -f debian/clamav-daemon.init
 	rm -f debian/clamav-milter.init
+	rm -f debian/clamav-milter.config
+	rm -f debian/clamav-milter.postinst
 	rm -f debian/clamav-freshclam.init
 	rm -f debian/clamav-freshclam.config
 	rm -f debian/clamav-freshclam.postinst
@@ -267,8 +278,10 @@ clamav-milter: install
 	dh_installman -p$@
 	dh_installdocs -p$@ 
 	dh_installchangelogs -p$@ ChangeLog 
+	dh_installdebconf -p$@
 	dh_installlogcheck -p$@
 	dh_link -p$@
+	dh_installlogrotate -p$@
 	${STRIP_OPTS}
 	dh_compress -p$@
 	dh_md5sums -p$@

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list