Kmail and Netscape Mail with Mailscanner
Victor Cain
vic at vicsfamily.net
Thu Mar 13 16:14:37 GMT 2003
I am running mailscanner 3.27, spamassassin 2.43, fetchmail 5.9.11, exim 3.36
and using Kmail to read mail on a Debian Sarge system, thanks to many e-mails
from Julian. It is working fine, as long as the Debian incompatabilities
don't get too bad, however I would also like to read mail with Netscape Mail
as an alternative to Kmail.
Netscape Mail can send mail the same way as Kmail, just sending to "localhost"
but Netscape Mail doesn't read the mail. Kmail just reads from "localhost"
but when I try that with Netscape, nothing happens. Mailx, which is also on
the system, does read it, but not Netscape. Do I need for MailScanner to
send it to a different place? Any help would be appreciated.
The attachment is what I did, for my own records.
TIA,
--
Victor R. Cain (865)435-5084 Fax:(865)435-9709
E: vic at vicsfamily.net Web: www.vicsfamily.net
------------ Quote of the Hour ------------
The cost of living hasn't affected its popularity.
-------------- next part --------------
Steps to installation of MailScanner, Tnef, SpamAssassin, Fetchmail using Exim
Operating System: Debian Linux "sarge" (testing)
MTA: exim
Mail Reader: kmail
I INSTALL PACKAGES
%%-> apt-get install f-prot-installer
(This will tell you where to go to download the actual installation files
and where to store them on your hard drive. It then does the install.)
%%-> apt-get install tnef mailscanner spamassassin fetchmail fetchmailconf
On my system this installed:
mailscanner 3.27.1-1
spamassassin 2.43-1
tnef 1.1.1-0.1
fetchmail 5.9.11-7
fetchmailconf 5.9.11-7
exim 3.36-3 (previously installed)
II CHANGE EXIM TO RUN AS DAEMON
Exim was changed to run as a daemon by commenting out the following line
in /etc/inetd.conf
# smtp stream tcp nowait mail /usr/sbin/exim exim -bs
III CREATE SPOOL DIRECTORIES AND EXIM CONFIG FILES
At this point, I followed the instructions in
http:///www.sng.ecs.soton.ac.uk/mailscanner/install/exim.shtml
along with almost identical instructions in file:
/usr/share/doc/mailscanner/README.exim
provided with the mailscanner package. Briefly, do this:
- create a spool for the incoming queue:
mkdir -p /var/spool/exim_incoming
mkdir -p /var/spool/exim_incoming/db
mkdir -p /var/spool/exim_incoming/input
mkdir -p /var/spool/exim_incoming/msglog
chown -R mail.mail /var/spool/exim_incoming
chmod -R 750 /var/spool/exim_incoming
- modify the exim configuration:
cp -p /etc/exim/exim.conf /etc/exim/exim_original.conf
cp -p /etc/exim/exim.conf /etc/exim/exim_outgoing.conf
mv /etc/exim/exim.conf /etc/exim/exim_incoming.conf
ln -sf exim_incoming.conf /etc/exim/exim.conf
IV MODIFY /ETC/EXIM/EXIM_INCOMING.CONF
The upshot of the modifications to /etc/exim/exim_incoming.conf:
%%-> diff /etc/exim/exim_original.conf /etc/exim/exim_incoming.conf
27a28,32
> # mailscanner config
> spool_directory = /var/spool/exim_incoming
> queue_only = true
>
>
298a304,309
> #mailscanner config -- this added at the _top_ of the directors configuration
> defer_director:
> driver = smartuser
> new_address = :defer: All deliveries are deferred
> verify = false
>
372a384,391
> #mailscanner config -- this added at the _top_ of the routers configuration
> defer_router:
> driver = domainlist
> self = defer
> route_list = "* 127.0.0.1 byname"
> verify = false
Note that lines 304-309 (defer_director) must be the first entry in the "Director's
Configuration" in the file, and lines 384-391 (defer_router) must be the first entry
in the "Router's Configuration" in the file.
V MODIFY /ETC/EXIM/EXIM_OUTGOING.CONF
The comparable changes in /etc/exim/exim_outgoing.conf:
%%-> diff /etc/exim/exim_original.conf /etc/exim/exim_outgoing.conf
27a28,32
>
> # mailscanner configuration
> log_file_path = syslog : /var/log/exim_outgoing/%slog
>
>
281a287,288
> hosts = smtp.comcast.net
> hosts_override = true
The two statements at lines 287-288 follow the "driver = smtp" line in the
"remote_smtp" transport. Obviously if you are not a Comcast customer, use your
ISP's mail server in place of "smtp.comcast.net". (This change was found necessary
to keep several SPAM filters from tagging all of my outgoing e-mails as spam. Why,
I don't really understand.)
VI CREATE NEW EXIM START/STOP SCRIPT
%%-> cp /usr/share/doc/mailscanner/exim/exim-init.d /etc/init.d/exim
Note that there may be some problems with this script. It uses "start-stop-daemon"
to start and stop _two_ daemons and I am not convinced that that program can really
do that, but it does start the two daemons needed with the "/etc/init.d/exim start"
command, as long as there are not previous versions running. Otherwise, who knows?
VII DELETE EXIM CRON.D SCRIPT
Comment out all executables in /etc/cron.d/exim (or delete the file).
VIII CREATE NEW EXIM CRON.DAILY SCRIPT
%%-> cp /usr/share/doc/mailscanner/exim/exim-cron.daily /etc/cron.daily/exim
%%-> mkmod a+x /etc/cron.daily/exim
I also uncommented the if loop that generates daily e-mail activity reports (just
for the fun of it -- not much point if you're not really running a mail server).
IX F-PROT
Make sure $FProtRoot in /etc/mailscanner/autoupdate/f-prot is set correctly.
%%-> grep "FProtRoot " /etc/mailscanner/autoupdate/f-prot
$FProtRoot = "/usr/lib/f-prot";
%%-> cat /usr/bin/f-prot
#!/bin/sh
#
# This is a shell script to invoke the F-Prot OnDemand Scanner for Linux.
#
exec /usr/lib/f-prot/f-prot ${@+"$@"}
MAKE SURE the directories /usr/lib/f-prot and /var/lib/f-prot are owned by "mail.mail".
F-PROT UPDATE from /etc/cron.d/f-prot (NOTE: this is modified from the original)
%%-> cat /etc/cron.d/f-prot
# /etc/cron.d/f-prot
27 4 * * * mail if [ -x /etc/mailscanner/autoupdate/f-prot ]; \
then /etc/mailscanner/autoupdate/f-prot -cron; fi
F-PROT Wrapper (without comments):
%%-> nocomment /etc/mailscanner/wrapper/f-protwrapper
PackageDir=/usr/lib/f-prot # This may vary depending on your OS
Scanner=f-prot
ScanOptions=""
exec ${PackageDir}/$Scanner $ScanOptions "$@"
X CHANGE TO /ETC/DEFAULT/MAILSCANNER
run_mailscanner=1
XI MODIFY /ETC/MAILSCANNER/MAILSCANNER.CONF
The only changes from the Debian default file were:
Virus scanner = f-prot
Sweep = /etc/mailscanner/wrapper/f-protwrapper
Local Postmaster = postmaster at vicsfamily.net
Log Spam = yes
These are some of the more important settings:
Run As User = mail
Run As Group = mail
Host name = Monarch2
Incoming Work Dir = /var/spool/mailscanner/incoming
Quarantine Dir = /var/spool/mailscanner/quarantine
Pid File = /var/run/mailscanner/mailscanner.pid
Filename Rules = /etc/mailscanner/filename.rules.conf
Log Permitted Filenames = no
Hide Incoming Work Dir = yes
Incoming Queue Dir = /var/spool/exim_incoming/input
Outgoing Queue Dir = /var/spool/exim/input
MTA = exim
Sendmail = /usr/sbin/exim
Sendmail2 = /usr/sbin/exim -C /etc/exim/exim_outgoing.conf
Log Facility = mail
Virus Scanning = yes
Virus Scanner = f-prot
Sweep = /etc/mailscanner/wrapper/f-protwrapper
Virus Scanner Timeout = 300
Expand TNEF = yes
TNEF Expander = /usr/bin/tnef --maxsize=100000000
TNEF Timeout = 120
Notify Local Postmaster = yes
Postmaster Gets Full Headers = no
Local Postmaster = postmaster at vicsfamily.net
Local Domains = /etc/mailscanner/localdomains.conf
Spam Checks = yes
Spam Header = X-MailScanner-SpamCheck:
Spam Modify Subject = yes
Spam Subject Text = {SPAM?}
Spam Action = deliver
Log Spam = yes
Use SpamAssassin = yes
Max SpamAssassin Size = 50000
SpamAssassin Timeout = 15
Max SpamAssassin Timeouts = 10
SpamAssassin Prefs File = /etc/mailscanner/spam.assassin.prefs.conf
SpamAssassin Auto Whitelist = yes
Compile SpamAssassin Once = yes
Always Include SpamAssassin Report = yes
Spam List = ORDB-RBL, relays.ordb.org.
Spam List Timeout = 5
Max Spam List Timeouts = 7
Delivery Method = batch
Lock File Dir = /tmp
Deliver Unparsable TNEF = no
Deliver In Background = yes
Minimum Code Status = supported
XII SUGGESTED CHANGE TO /ETC/MAILSCANNER/SPAM.ASSASSIN.PREFS.CONF
Required_hits = 9 ### Not done yet
XIII KMAIL CONFIGURATION
NOTE: Kmail does not communicate directly with the ISP's mail server
Incoming (Receiving)
POP Host: localhost
Port: 110
Dest Fldr: inbox
Outgoing (Sending)
SMTP Host: localhost
Port: 25
XIV NETSCAPE MAIL CONFIGURATION
I don't have the slightest idea how to get Netscape Mail to read the incoming mail.
I did succeed in getting the outgoing mail working by just changing the ISP mail
server (smtp.comcast.net) with "localhost", leaving everything else alone.
IF ANYONE KNOWS HOW TO DO THIS, PLEASE LET ME KNOW!
XV FETCHMAIL
Run fetchmailconf (not as root)
%%-> cd
%%-> /usr/bin/fetchmailconf
%%-> su -c "cp .fetchmailrc /etc/fetchmailrc"
%%-> su -c "chown fetchmail.nogroup /etc/fetchmailrc"
This is my copy of /etc/fetchmailrc, with 'u's for the user name and
'p's for the password, if you just want to copy it. This one checks the ISP
for mail every ten minutes.
# Configuration created Wed Mar 5 15:59:51 2003 by fetchmailconf
set postmaster "vic"
set bouncemail
set no spambounce
set properties ""
set daemon 600
poll pop3.comcast.net with proto POP3
user 'uuuuuu' there with password 'pppppp' is 'vic' here options fetchall
XVI CREATE OUTGOING LOG DIRECTORY
%%-> cd /var/log
%%-> mkdir exim_outgoing
%%-> chown mail.adm exim_outgoing
%%-> chmod --reference=exim exim_outgoing
XVII START EVERYTHING UP
I'm not sure just what you should do -- it all seems to start up if you reboot. I assume
that there is some proper sequence of commands like:
/etc/init.d/mailscanner restart
/etc/init.d/exim restart
/etc/init.d/fetchmail restart
More information about the MailScanner
mailing list