PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Virenscanner in Mailserver einbinden



flachskopf
30.07.03, 17:55
Hallo Wissender,

Das Problem ist gelöst, ein neues ist entstanden, zu sehen in der Antwort!

Danke im Voraus für Eure Hilfe!!




Nach tagelangem Probieren habe ich es endlich geschafft, daß fetchmail + procmail + postfix + cyrus perfekt miteinander funktionieren :)
Alles landet, wo es hin soll.

Nun möchte ich den Server gern um einen Virenschutz erweitern und habe mich erstmal mit avmailgate versucht.

Falls Du ein ähnliches System betreibst, kennst Du bestimmt meines Rätsels Lösung. Bitte schau Dir den Thread mal an.
Vielleicht hast Du auch mit amavis diesbezüglich Erfahrungen. Ich würde es auch damit probieren, falls es leichter geht.

Hier nun das Problem:

avmailgate bietet zwei Konfigurationsmöglichkeiten, welche ich beide ausprobiert habe.

Zum einen das Lauschen AntiVir als Contentfilter. Dazu waren folgende Veränderungen nötig (Auszug aus: http://bsdforen.org/howtos/mailserver_howto.txt):

1. In der /etc/services muesst ihr folgendes hinzfuegen:
antivir 10024/tcp #Port for avgated
smtp-backdoor 10025/tcp #Port for postfix backdoor

2. Jetzt oeffnet ihr /etc/avmailgate.conf aendert diese Zeilen:
ListenAddress localhost port antivir
und
ForwardTo SMTP: localhost port smtp-backdoor

in /etc/postfix/master.cf
localhost:smtp-backdoor inet n - n - - smtpd -o content_filter=

in /etc/postfix/main.cf
content_filter = smtp:127.0.0.1:10024


Das habe ich gemacht. Ausgehende Mails werden gescannt. Damit eingehende überhaupt erkannt werden, musste ich den mda-Eintrag (s.u.) aus meiner fetchmailrc entfernen.
Die gescannten Mails landen allerdings im Nirvana statt in den Mailboxen. Ich sehe aber, daß es funzt, wenn ich es ohne cyrus mache. Dann landen die unverseuchten Mails in /var/mail.


Die zweite Konfigurationsmethode ist das Lauschen an Port 25 (wieder Auszug):

Edit the file master.cf. Locate the following line:
smtp inet n - n - - smtpd

and add the following comment char using #:
#smtp inet n - n - - smtpd


Wenn ich es so probiere meldet meine procmail-logdatei:

Jul 30 18:07:50 gandalf avgated[8169]: connection from localhost
Jul 30 18:07:50 gandalf avgated[8169]: spooled to 08169-47345875
Jul 30 18:07:50 gandalf avgatefwd[8170]: Message 'incoming/xf-08169-47345875' scheduled for scanning now.
Jul 30 18:07:50 gandalf avgatefwd[8170]: Virus Scanner will process message 'incoming/qf-08169-47345875'.
Jul 30 18:07:50 gandalf avgatefwd[8173]: Message 'outgoing/xf-08169-47345875' scheduled for delivery now.
Jul 30 18:07:50 gandalf avgatefwd[8173]: connect() failed (Connection refused)
Jul 30 18:07:50 gandalf avgatefwd[8173]: connection to host "localhost", port 10025 failed
Jul 30 18:07:50 gandalf avgatefwd[8173]: Message 'outgoing/qf-08169-47345875' could not be forwarded now. We'll retry later.

...nur later ist auch nichts passiert.

Hier noch meine relevanten Konfigdateien, falls Sie Dir etwas nützen.

BITTE, BITTE HILF MIR; Ich weiß als Anfänger im Moment nicht weiter.

Gruß, Flachskopf

main.cf
-------

...
mailbox_command = /usr/bin/procmail
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
#content_filter = smtp:127.0.0.1:10024 #falls erster Konfigweg
...


master.cf
---------

smtp inet n - n - - smtpd
#falls erster Konfigweg
#localhost:smtp-backdoor inet n - n - - smtpd -o content_filter=
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 nqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
smtp unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
#localhost:10025 inet n - n - - smtpd -o content_filter=

cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}


fetchmailrc
-----------

poll pop.gmx.net protocol pop3 username flachsi@gmx.net password geheim mda "/usr/bin/procmail"
#zum Virenscan muss ich den mda-Eintrag entfernen


procmailrc
----------

...

:0
* ^TO_flachsi@gmx.net
|/usr/lib/cyrus/bin/deliver -a -m flachsi

...


cyrus.conf
----------

# standard standalone server implementation
START {
# do not delete this entry!
recover cmd="ctl_cyrusdb -r"

# this is only necessary if using idled for IMAP IDLE
# idled cmd="idled"
}

# UNIX sockets start with a slash and are put into /var/lib/imap/socket
SERVICES {
# add or remove based on preferences
imap cmd="imapd" listen="imap" prefork=0
# imaps cmd="imapd -s" listen="imaps" prefork=0
pop3 cmd="pop3d" listen="pop3" prefork=0
# pop3s cmd="pop3d -s" listen="pop3s" prefork=0
sieve cmd="timsieved" listen="sieve" prefork=0

# at least one LMTP is required for delivery
# lmtp cmd="lmtpd" listen="lmtp" prefork=0
lmtpunix cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1

# this is only necessary if using notifications
# notify cmd="notifyd" listen="/var/lib/imap/socket/notify" proto="udp" prefork=1
}

EVENTS {
# this is required
checkpoint cmd="ctl_cyrusdb -c" period=30

# this is only necessary if using duplicate delivery suppression
delprune cmd="ctl_deliver -E 3" period=1440

# this is only necessary if caching TLS sessions
tlsprune cmd="tls_prune" period=1440

# cleanup cmd="ipurge -d 30 -f" period=60
}


:) IM VORAUS DANKE!!! :)

flachskopf
30.07.03, 20:56
Habe das Problem jetzt mit amavis gelöst. Ist einfacher zu konfigurieren als avmailgate, wie ich festgestellt habe.

Nun gibt es aber noch ein neues Problem beim Versenden der Mails mit pine. Sie kommen nicht beim Empfänger an sondern landen in /var/mail/nobody

Die /var/log/mail meint dazu:

Jul 31 00:07:48 gandalf postfix/smtpd[1654]: connect from
localhost[127.0.0.1]
Jul 31 00:07:48 gandalf postfix/smtpd[1654]: 9843319237:
client=localhost[127.0.0.1]
Jul 31 00:07:49 gandalf postfix/smtpd[1654]: disconnect from
localhost[127.0.0.1]
Jul 31 00:07:49 gandalf postfix/pickup[1650]: 5F7971D0FA:
uid=0 from=<root@gandalf.meinhomeserver.de>
Jul 31 00:07:49 gandalf postfix/cleanup[1656]: 5F7971D0FA:
message-id=<Pine.LNX.4.44.0307310007340.1653-100000@gandalf.meinhomeserver.de>
Jul 31 00:07:49 gandalf postfix/qmgr[1651]: 5F7971D0FA:
from=<flachsi@gmx.net>, size=558, nrcpt=1 (queue active)
Jul 31 00:07:51 gandalf amavis[1659]: starting. amavis
0.3.12pre8 Wed Sep 11 11:18:05 UTC 2002
Jul 31 00:07:52 gandalf postfix/smtpd[1662]: connect from
localhost[127.0.0.1]
Jul 31 00:07:52 gandalf postfix/smtpd[1662]: 463411D202:
client=localhost[127.0.0.1]
Jul 31 00:07:52 gandalf postfix/cleanup[1656]: 463411D202:
message-id=<Pine.LNX.4.44.0307310007340.1653-100000@gandalf.meinhomeserver.de>
Jul 31 00:07:52 gandalf postfix/qmgr[1651]: 463411D202:
from=<flachsi@gmx.net>, size=775, nrcpt=1 (queue active)
Jul 31 00:07:52 gandalf postfix/smtpd[1662]: disconnect from
localhost[127.0.0.1]
Jul 31 00:07:52 gandalf postfix/pipe[1658]: 5F7971D0FA:
to=<megaflachs@yahoo.de>, relay=vscan, delay=4, status=sent
(gandalf.meinhomeserver.de)
Jul 31 00:07:52 gandalf postfix/pipe[1663]: 463411D202:
to=<megaflachs@yahoo.de>, relay=procmail, delay=0,
status=sent (gandalf.meinhomeserver.de)

Wo könnte denn der Fehler stecken??
Ich poste gern noch meine veränderten Konfig-dateien.

Im Voraus Danke!

Gruß, Flachskopf