Hello Dave,

/etc/mailscanner is artifact from stable.   try 'dpkg -s
/etc/mailscanner/mailscanner.conf' to verify package ownership, then
'dpkg --purge mailscanner' to rid yourself of it.  Note that this will
also remove any later versions, like your current testing package.

Now, for the backport.  

The mailscanner 4.26.7 debian testing/unstable needs a bit more magic
than prior versions for backporting, as pulls some ucf magic that
doesn't work on stable's version of ucf.

Luckly, this can all be worked around by making package changes.  Use
the debian/rules and debian/control files appended below the signature,
and you should be off to the races.

Other little details on how I build my backports for mailscanner:

apt-get -t unstable source mailscanner (/etc/apt/sources.list has stable
deb sources, and unstable deb-src entries)
cd mailscanner-4.26.7
dch -i
vi debian/rules
vi debian/control
make -f debian/rules clean
make -f debian/rules binary

If all goes well, you'll have a much happier mailscanner package.  
Edit /etc/MailScanner/MailScanner.conf, then /etc/default/mailscanner
prior to starting. 

You will also need a backport of libnet-cidr-perl-0.09 for MailScanner
4.26.7 to work.   It also needs some magic in debian/rules and
debian/control.  You could get this using CPAN, but that defeats the
purpose of a package management system.  

I can't help you with the webmin plugin as I hit the configuration files
directly, but I'll assume that you'll need it's testing/unstable
equivalent.

You'll also want to ensure that 'Notify Senders = no' in
MailScanner.conf.  The package and upstream have this set to 'yes',
which is a *major* source of spam.  I've filed a bug report with the
package maintainer to have this defaulted to 'no', but I'm unsure if
he'll act on it.  

Finally, if you use sendmail, you'll need to setup two daemons, one to
send the inbound mail through to a queue directory for MailScanner, and
another to deliver once mailscanner is done.   See the sendmail start
script below. 

Good luck, feel free to contact me if you have any other issues.  

-- 


Martin Foster                                   Phone:   +61 3 9674 7500
Systems Engineer               P A C I F I C    Fax:     +61 3 9698 4959
Pacific Internet (Australia)  I N T E R N E T   
http://www.pacific.net.au/                      NASDAQ:  PCNTF



---[MailScanner debian/rules]--------------------------
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=4

p = mailscanner
d = debian/$(p)

PWD = $(shell pwd)

patch_stamp = patch-stamp
patchdir = debian/patches

build: $(patch_stamp) build-stamp
build-stamp:
        dh_testdir
        : # don't build anything
        touch build-stamp

clean: unpatch
        dh_testdir
        dh_testroot
        rm -f *-stamp
        rm -rf bin/tnef*
        rm -rf ../$(shell basename $(PWD)).orig/bin/tnef*
        -find . ../$(shell basename $(PWD)).orig -name '.#*' | xargs rm
-f
        dh_clean

install: build
        dh_testdir
        dh_testroot
        dh_clean -k
        dh_installdirs \
                usr/sbin \
                usr/share/doc/mailscanner/html \
                usr/share/doc/mailscanner/examples \
                usr/share/doc/mailscanner/exim \
                usr/share/doc/mailscanner/sendmail \
                usr/share/man/man5 \
                usr/share/man/man8 \
                usr/share/MailScanner \
                etc \
                etc/default \
                etc/cron.daily \
                var/lock/subsys \
                var/run/MailScanner \
                var/lib/MailScanner \
                var/spool/MailScanner/archive \
                var/spool/MailScanner/incoming \
                var/spool/MailScanner/quarantine

#       cp -p bin/MailScanner $(d)/usr/sbin/
        sed -e 's,/opt/MailScanner/lib,/usr/share/MailScanner,g' \
                bin/MailScanner > $(d)/usr/sbin/MailScanner
        chmod 755 $(d)/usr/sbin/MailScanner

        sed -e 's,/opt/MailScanner/bin,/usr/sbin,g' \
            -e 's,/opt/MailScanner/etc,/etc/MailScanner,g' \
                bin/check_mailscanner > $(d)/usr/sbin/check_mailscanner
        chmod 755 $(d)/usr/sbin/check_mailscanner

        cp -p bin/df2mbox $(d)/usr/sbin/

        cp -p bin/upgrade_MailScanner_conf $(d)/usr/sbin/
        pod2man --section=8 bin/upgrade_MailScanner_conf
--center=MailScanner \
                > $(d)/usr/share/man/man8/upgrade_MailScanner_conf.8

        sed -e 's,/opt/MailScanner/bin,/usr/sbin,g' \
            -e 's,/tmp/MailScanner,/var/lock/subsys/MailScanner,g' \
                bin/update_virus_scanners >
$(d)/usr/sbin/update_virus_scanners
        chmod 755 $(d)/usr/sbin/update_virus_scanners

        chown mail.mail $(d)/var/lib/MailScanner
        chmod 750 $(d)/var/lib/MailScanner

        cp -a lib/MailScanner* $(d)/usr/share/MailScanner/.
        -find $(d)/usr/share/MailScanner -type f | xargs -n 50 chmod 644

        : # config files
        cp -a etc $(d)/etc/MailScanner
        rmdir $(d)/etc/MailScanner/old
        rmdir $(d)/etc/MailScanner/tcp
        cp -a debian/mailscanner.default $(d)/etc/default/mailscanner
        cp -a debian/cron.daily $(d)/etc/cron.daily/mailscanner
        chmod 755 $(d)/etc/cron.daily/mailscanner
        mkdir $(d)/etc/MailScanner/wrapper
        mkdir $(d)/etc/MailScanner/autoupdate
        cp -p lib/*wrapper* $(d)/etc/MailScanner/wrapper/.
        cp -p lib/*autoupdate* $(d)/etc/MailScanner/autoupdate/.
        sed -e 's,/usr/local,/usr,g' \
                lib/clamav-autoupdate \
                        >
$(d)/etc/MailScanner/autoupdate/clamav-autoupdate
        chmod 755 $(d)/etc/MailScanner/autoupdate/clamav-autoupdate
        cp -p debian/01_mailscanner_config \
                $(d)/usr/share/doc/mailscanner/examples/.

        : # examples
        mv $(d)/etc/MailScanner/*mcp
$(d)/usr/share/doc/mailscanner/examples/.
        cp -a $(d)/etc/MailScanner/rules \
                $(d)/usr/share/doc/mailscanner/examples/.
        chmod 644 $(d)/usr/share/doc/mailscanner/examples/rules/EXAMPLES
        chmod 644 $(d)/usr/share/doc/mailscanner/examples/rules/README
        chmod 644
$(d)/usr/share/doc/mailscanner/examples/rules/spam.whitelist.rules

        rm -f $(d)/etc/MailScanner/rules/EXAMPLES
        rm -f $(d)/etc/MailScanner/rules/README

        : # documentation
        cp -a docs/* $(d)/usr/share/doc/mailscanner/html/
        rm -f $(d)/usr/share/doc/mailscanner/html/COPYING
        rm -f $(d)/usr/share/doc/mailscanner/html/ChangeLog
        mv $(d)/usr/share/doc/mailscanner/html/man/MailScanner.8 \
                $(d)/usr/share/man/man8/.
        mv $(d)/usr/share/doc/mailscanner/html/man/MailScanner.conf.5 \
                $(d)/usr/share/man/man5/.
        cp -p README notes.txt INSTALL $(d)/usr/share/doc/$(p)/

        cp -a debian/exim-init.d debian/exim-cron.daily \
                $(d)/usr/share/doc/mailscanner/exim/

        cp -a debian/sendmail-init.d debian/sendmail.conf \
                $(d)/usr/share/doc/mailscanner/sendmail/

        -find $(d) -name '*[Ss]olaris' | xargs rm -f
        -find $(d) -name CVS | xargs rm -rf
        sed -e 's,/usr/local/MailScanner/bin/tnef,/usr/bin/tnef,g' \
            -e 's,^\(Run As .*=\),\1 Debian-exim,g' \
            -e 's,^\(Max Children =\).*,\1 1,g' \
            -e '/^MTA/s,sendmail,exim,g' \
            -e 's,/usr/sbin/sendmail,/usr/sbin/exim,g' \
            -e
's,/etc/exim/exim_send\.conf,/etc/exim/exim4_outgoing.conf,g' \
            -e 's,^\(Sendmail2\),#\1,g' \
            -e 's,^#\(Sendmail2.*exim\),\1,g' \
            -e 's,/opt/MailScanner/bin/tnef,/usr/bin/tnef,g' \
            -e 's,/opt/MailScanner/etc,/etc/MailScanner,g' \
            -e 's,/opt/MailScanner/var,/var/MailScanner,g' \
            -e 's,/var/spool/mqueue *$$,/var/spool/exim4/input,g' \
            -e 's,/var/spool/mqueue\.in
*$$,/var/spool/exim4_incoming/input,g' \
            -e 's,^\(PID file *=
*\).*,\1/var/run/MailScanner/MailScanner.pid,g' \
            -e 's,^\(Information Header *= *\),#\1,g' \
            -e 's,^\(Spam List *= *\),\1# ,g' \
            -e 's,^\(Virus Scanner *= *\).*,\1none,g' \
            -e 's,^\(Accept Spam From\),#\1,g' \
            -e 's,^\(Spam Checks *= *\).*,\1yes,g' \
            -e 's,^\(Use SpamAssassin *= *\).*,\1yes,g' \
            -e 's,^\(SpamAssassin User State Dir *=\).*,\1
/var/lib/MailScanner,g' \
                etc/MailScanner.conf >
$(d)/etc/MailScanner/MailScanner.conf

        sed -e 's,^#\(auto_whitelist_\),\1,g' \
            -e 's,^\(auto_whitelist_path[      
]*\).*,\1/var/lib/MailScanner/auto-whitelist,' \
            -e 's,^#\(bayes_\),\1,g' \
            -e 's,^\(bayes_path[       
]*\).*,\1/var/lib/MailScanner/bayes,' \
                etc/spam.assassin.prefs.conf \
                > $(d)/etc/MailScanner/spam.assassin.prefs.conf

        sed -e 's,/opt/MailScanner/lib/,/etc/MailScanner/wrapper/,g' \
                etc/virus.scanners.conf \
                > $(d)/etc/MailScanner/virus.scanners.conf

        -find $(d)/etc/MailScanner -type f | xargs -n 50 chmod 644
        chmod 755 $(d)/etc/MailScanner/autoupdate/*
        chmod 755 $(d)/etc/MailScanner/wrapper/*

#       sed -e 's,/usr/local/f-prot,/usr/lib/f-prot,g' \
#               f-prot/f-protwrapper \
#               > $(d)/etc/mailscanner/wrapper/f-protwrapper
#       chmod 755 $(d)/etc/mailscanner/wrapper/f-protwrapper

# Build architecture-independent files here.
binary-indep: build install
        dh_testdir
        dh_testroot
        dh_installdebconf
        dh_installdocs debian/README.exim4
        dh_installexamples
#       dh_installlogrotate
        dh_installinit
        dh_installcron
        dh_installman
        dh_undocumented check_mailscanner.8 df2mbox.8
        dh_installchangelogs docs/ChangeLog
        dh_compress -X.shtml -X01_mail -Xreports
        dh_fixperms
        chmod -R 750 $(d)/var/spool/MailScanner
        chown -R mail:mail $(d)/var/spool/MailScanner
        chown -R mail:mail $(d)/var/run/MailScanner

#       dh_perl
        dh_gencontrol
        dh_md5sums
        dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch

debian_patches = \
        awk-location \
        f-prot-location \
        clamav-location \
        filename.rules.conf \
        filetype.rules.conf \
        spam.assassin.prefs.conf \
        upgrade-manpage

#       rfc822-conformance

patch: $(patch_stamp)
$(patch_stamp): $(unpack_stamp) \
    $(foreach p,$(debian_patches),$(patch_stamp)-$(p))
        @echo "Patches applied: $(debian_patches)"
        @echo -e "\nPatches that Debian applied in this version:" > pxxx
        @for i in $(debian_patches); do \
          echo -e "\n$$i:" >> pxxx; \
          sed -n 's/^# *DP: */  /p' $(patchdir)/$$i.dpatch >> pxxx; \
        done
        @mv -f pxxx $@

unpatch:
        @for stamp in none `ls -1t $(patch_stamp)-* 2>/dev/null`; do \
          case "$$stamp" in none|patched-stamp|patched-\*) continue;
esac; \
          patch=`echo $$stamp | sed -e 's,$(patch_stamp)-,,'`; \
          echo "trying to revert patch $$patch ..."; \
          if [ -x $(patchdir)/$$patch.dpatch ]; then true; else \
            chmod +x $(patchdir)/$$patch.dpatch; fi; \
          if $(patchdir)/$$patch.dpatch -unpatch; then \
            echo "reverted $$patch patch."; \
            rm -f $$stamp; \
          else \
            echo "error in reverting $$patch patch."; \
            exit 1; \
          fi; \
        done
        rm -f patched-stamp

$(patch_stamp)-%: $(patchdir)/%.dpatch
        @if [ -x $< ]; then true; else chmod +x $<; fi
        @if [ -f $@ ]; then \
          echo "$* patches already applied."; exit 1; \
        fi
        $< -patch
        @echo "$* patches applied." > $@


.PHONY: build clean binary-indep binary-arch binary install patch
unpatch
--------------------------------------------------

---[MailScanner debian/control]-------------------------
Source: mailscanner
Section: mail
Priority: optional
Maintainer: Matthias Klose <[EMAIL PROTECTED]>
Build-Depends-Indep: debhelper (>> 4.0.2), perl (>= 5.6.1)
Standards-Version: 3.6.1

Package: mailscanner
Architecture: all
Pre-Depends: debconf (>= 0.5.00)
Depends: exim4 | mail-transport-agent, perl (>= 5.6.1),
libio-stringy-perl, libmime-base64-perl, libmailtools-perl, libmime-perl
(>= 5.411-1), libnet-cidr-perl, libhtml-parser-perl, libmail-audit-perl,
unzip, ncftp | wget, ucf
Recommends: tnef (>= 1.1.1), spamassassin
Suggests: clamav, f-prot-installer
Conflicts: exim4-base (<< 4.30-3)
Description: An email virus scanner and spam tagger
MailScanner is a freely distributable E-Mail gateway virus scanner
and spam detector. It uses sendmail or Exim as its basis, and a choice
of
17 commercial virus scanning engines to do the actual virus scanning.
It can decode and scan attachments intended solely for Microsoft Outlook
users (MS-TNEF). If possible, it will disinfect infected documents and
deliver them automatically. It also has features which protect it
against
Denial Of Service attacks.

Reply via email to