• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Postfix UUCP AmaVis

Status
Für weitere Antworten geschlossen.

cinos22

Newbie
Hallo!

Ich habe Postfix als Relayserver für Exchange und meinen Provider eingerichtet. Die Mails von Postfix zu Exchange werden über SMTP gehandelt. Der Mailaustausch zwischen Postfix und Provider läuft über UUCP. Zu dem Postfix habe ich außerdem auf der Distru. Mandrake 10.0 das bekannte AmaVis mit Virenscannern und SpamAssassins installiert.

Jetzt habe ich ich das Problem, das zwar alle Mails die von Exchange via SMTP versand werden durch AmaVis laufen, jedoch nicht die von extern erhaltenen über UUCP. Habe schon im Web gesucht und herausgefunden, das AmaVis nur über SMTP oder LMTP ansprechbar ist, jedoch nicht über UUCP.

Ich hoffe jemand hat eine Idee, wie ich auch die externen Mails, die über UUCP hereinkommen durch AmaVis geleitet werden.

Hier die /etc/postfix/main.cf:
Code:
# These are only the parameters changed from a default install
# see /etc/postfix/main.cf.dist for a commented, fuller version of this file.

# Verzeichnis für Mailqueue
queue_directory = /var/spool/postfix

# Verzeichnis für Kommandos
command_directory = /usr/sbin

# Verzeichnis der Postfix Installation
daemon_directory = /usr/lib/postfix

# Sonstige Pfade
sendmail_path = /usr/sbin/sendmail.postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
setgid_group = postdrop
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.1.0/README_FILES
sample_directory = /usr/share/doc/postfix-2.1.0/samples

# Inhaber der Mailqueue
mail_owner = postfix
default_privs = nobody

# Netzwerkspezifikationen
myhostname = postfix.???.de
mydomain = ???.de
myorigin = $mydomain
inet_interfaces = all
mynetworks = 192.168.?.?, 192.168.?.?, 127.0.0.0/8

smtpd_banner = $myhostname ESMTP $mail_name

alias_maps = hash:/etc/postfix/aliases
transport_maps = hash:/etc/postfix/transport

debug_peer_level = 2
debug_peer_list = 127.0.0.1


#Nur Anfragen annehmen, wenn der Client ein "helo" schickt
smtpd_helo_required = yes

#BruteForce Attacken gegen Benutzerausspähung entgegenwirken
disable_vrfy_command = yes

smtpd_helo_restrictions = reject_invalid_hostname


content_filter = lmtp-filter:[127.0.0.1]:10025
content_filter = smtp-amavis:[127.0.0.1]:10025
max_use = 10
receive_override_options = no_address_mappings

Hier die /etc/postfix/master.cf:
Code:
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp    inet    n       -       y       -       -       smtpd
#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       -       y       60      1       pickup
  -o content_filter=
  -o receive_override_options=
cleanup unix    n       -       y       -       0       cleanup
qmgr    fifo    n       -       y       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr  fifo    -       -       y       300     1       tlsmgr
rewrite unix    -       -       y       -       -       trivial-rewrite
bounce  unix    -       -       y       -       0       bounce
defer   unix    -       -       y       -       0       bounce
trace   unix    -       -       y       -       0       bounce
verify  unix    -       -       y       -       1       verify
flush   unix    n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp    unix    -       -       y       -       -       smtp -v
relay   unix    -       -       y       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq   unix    n       -       y       -       -       showq
error   unix    -       -       y       -       -       error
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp    unix    -       -       y       -       -       lmtp
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=nobody argv=/usr/bin/maildrop -d ${recipient}
#
# Cyrus. Please See the Postfix CYRUS_README file for details
#
# deliver interface (deprecated), to use this also use
# postconf -e cyrus-deliver_destination_recipient_limit=1
cyrus-deliver     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#
# for default cyrus socket placement
cyrus     unix  -       n       n       -       -       lmtp
  -o lmtp_cache_connection=yes
#
# if you configure cyrus socket in the chroot jail
cyrus-chroot     unix  -       -       y       -       -       lmtp
  -o lmtp_cache_connection=yes
#
# for lmtp to cyrus via tcp
cyrus-inet      unix    -       -       y       -       -       lmtp
  -o lmtp_cache_connection=yes
  -o lmtp_sasl_auth_enable=yes
  -o lmtp_sasl_password_maps=hash:/etc/postfix/cyrus_lmtp_sasl_pass
  -o lmtp_sasl_security_options=noanonymous
#
# UUCP. Unix to Unix CoPy
#
uucp      unix  -       n       n       -       -       pipe
  flags=F user=uucp argv=/usr/bin/uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# these are not distributed with Mandrake Linux
#
#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

##### START OF CONTENT FILTER CUSTOMIZATIONS #####
# Please see the Postfix FILTER_README for details.
# These sample entries expect your content filter to
# listen on port 10025 and to inject mail back into
# postfix on port 10026.
#
# to enable such content filter run the command
#    postconf -e content_filter=smtp-filter:127.0.0.1:10025
#    postconf -e smtp-filter_destination_concurrency_limit=2
# or
#    postconf -e content_filter=lmtp-filter:127.0.0.1:10025
#    postconf -e lmtp-filter_destination_concurrency_limit=2
# and the command
#    postconf -e receive_override_options=no_address_mappings
#
smtp-amavis     unix    -       -       y       -       2       lmtp
   -o smtp_data_done_timeout=1200
   -o disable_dns_lockups=yes

#uucp-amavis    unix    -       -       y       -       2       uucp
#   -o uucp_data_done_timeout=1200
#   -o disable_dns_lockups=yes

127.0.0.1:10026 inet    n       -       y       -       -       smtpd
   -o content_filter=
   -o local_recipient_maps=
   -o relay_recipient_maps=
   -o smtpd_restriction_classes=
   -o smtpd_client_restrictions=
   -o smtpd_helo_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks=127.0.0.0/8
   -o strict_rfc821_envelopes=yes


lmtp-filter     unix    -       -       y       -       -       lmtp
  -o lmtp_data_done_timeout=1200
  -o disable_dns_lookups=yes

smtp-filter     unix    -       -       y       -       -       smtp
  -o smtp_data_done_timeout=1200
  -o disable_dns_lookups=yes

und die /etc/postfix/transport.db
Code:
???.de  smtp:[192.168.?.?]
*       uucp:mfsuucp
 

oc2pus

Ultimate Guru
Habe schon im Web gesucht und herausgefunden, das AmaVis nur über SMTP oder LMTP ansprechbar ist, jedoch nicht über UUCP.
na und ?

du musst den postfix so konfigurieren, das er nach Annahme der mails diese an den amavis übergibt und dieser nach dem Scan die mails wieder dem postfix zurückgibt.

Normalerweise sieht das dann so aus:
postfix -> (10024) amavis -> (10025) postfix -> lokale Postfächer
Die Werte in Klammer=ports auf localhost

siehe hier
http://www.linux-tin.org/modules.php?op=modload&name=PagEd&file=index&page_id=11
 
OP
cinos22

cinos22

Newbie
Hallo oc2pus.

Erst mal besten Dank für die schnelle Antwort! :)

Das mit den Ports ist mir klar. Es funktioniert ja auch, wenn ich eine externe Mail verschicke:

Exchange => (25) Postfix => (10025) AmaVis => (10026) Postfix => UUCP => Provider

Nur wenn ich eine externe Mail über UUCP bekomme, wird diese nur über Port 25 geleitet und dann vom MTA direkt nach Exchange.

Meines Wissens lauscht AmaVis nur auf SMTP und LMTP und nicht auf UUCP. Die Installation funktioniert ja auch, nur werden die externen Mails über UUCP nicht nach AmaVis geleitet.
 

oc2pus

Ultimate Guru
cinos22 schrieb:
Nur wenn ich eine externe Mail über UUCP bekomme, wird diese nur über Port 25 geleitet und dann vom MTA direkt nach Exchange.

wir reden doch über incoming mails ... wenn du dir den geposteten link etwas genauer anschauen würdest, hättest du schon erkannt was an deinem System nicht funktioniert;)

du must den postfix via content-filter dazu bringen die mails erst an den amvis zu geben...
d.h dir fehlt ein Übergang von postfix -> amavis -> postfix
 
OP
cinos22

cinos22

Newbie
du must den postfix via content-filter dazu bringen die mails erst an den amvis zu geben...
d.h dir fehlt ein Übergang von postfix -> amavis -> postfix

Das denke ich auch, ich bin leider noch nicht so fit in der Materie.

Selbst wenn ich folgende Zeile in die "master.cf" einfüge, laufen immer noch nicht die externen eingehenden Mails über AmaVis.

Code:
smtp    inet    n       -       y       -       -       smtpd
    -o content_filter=smtp:[127.0.0.1]:10025

So langsam verstehe ich es auch nicht. Es kommt mir sovor, dass UUCP die Mails per rmail an Postfix übergibt und Postfix diese dann, wie in der "transport.db" definiert, einfach übergibt.
 

oc2pus

Ultimate Guru
hast du das dem amvis schon mitgeteilt, das er auf port 10025 Eingaben erwarten soll ?

# SMTP SERVER (INPUT) PROTOCOL SETTINGS (e.g. with Postfix, Exim v4, ...)
# (used when MTA is configured to pass mail to amavisd via SMTP or LMTP)
$inet_socket_port = 10024; # accept SMTP on this local TCP port
# (default is undef, i.e. disabled)
# multiple ports may be provided: $inet_socket_port = [10024, 10026, 10028];

hast du den content_filter in der main.cf richtig gesetzt?
dieser Eintrag muss mit dem Eintrag in der master.cf korrespondieren.

hast du nach config Änderungen die Diesnte neu gestartet
rcpostfix restart bzw rcamavisd restart
 
OP
cinos22

cinos22

Newbie
Also AmaVis läuft! Wenn ich ihn über

Code:
telnet localhost 10025

meldet sich AmaVis auch korrekt. Auch im Debug Mode (/usr/sbin/amavisd debug) sehe ich, dass beim MailVERSAND der Scanner durchlaufen wird.

Zu Deiner Frage:

hast du den content_filter in der main.cf richtig gesetzt?

Ich denke schon ...

Code:
### master.cf ###
smtp    inet    n       -       n       -       50      smtpd -o content_filter=smtp:[localhost]:10025
smtp-amavis     unix    -       -       y       -       2       smtp
   -o smtp_data_done_timeout=1200
   -o disable_dns_lockups=yes


localhost:10026 inet    n       -       y       -       -       smtpd
   -o content_filter=
   -o local_recipient_maps=
   -o relay_recipient_maps=
   -o smtpd_restriction_classes=
   -o smtpd_client_restrictions=
   -o smtpd_helo_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks=127.0.0.0/8
   -o strict_rfc821_envelopes=yes

### main.cf ###
content_filter = smtp-amavis:[127.0.0.1]:10025

Könnte es am Type (z.B. inet, unix, fifo ...) liegen. Die externen Mails erreichen Postfix ja über UUCP (rmail).
 

oc2pus

Ultimate Guru
hm, kann es sein das du Duplicate in deiner main.cf drin hast ?

das ist aus deinem ersten posting:
content_filter = lmtp-filter:[127.0.0.1]:10025
content_filter = smtp-amavis:[127.0.0.1]:10025

ansonsten:
tail -f /var/log/mail in einer Konsole als root

dann empfange eine email und beobachte das logfile.
dieses Log-File dann hier psoten (ab der Stelle wo die email deinen Postfix erreicht bis zum zustellen der email)
 
OP
cinos22

cinos22

Newbie
Ja ich hatte beide Einträge in der main.cf. Aber auch wenn ich nur den 2. Eintrag (... smtp-amavis ...) drin lassen, funktioniert es immer auch nicht.

Hier ist der Auszug aus der Log-Datei:

Code:
Sep 26 13:19:40 localhost postfix/pickup[11354]: 7E7DCE197: uid=10 from=<???@gmx.net>
Sep 26 13:19:40 localhost postfix/cleanup[11361]: 7E7DCE197: message-id=<30738.1096283807@www44.gmx.net>
Sep 26 13:19:40 localhost postfix/qmgr[11355]: 7E7DCE197: from=<???s@gmx.net>, size=1772, nrcpt=1 (queue active)
Sep 26 13:19:40 localhost postfix/smtp[11363]: 7E7DCE197: to=<???@akl.de>, relay=192.168.?.?[192.168.?.?], delay=0, status=sent (250 1770 bytes received in 0,0 seconds; Message accepted for delivery)
Sep 26 13:19:40 localhost postfix/qmgr[11355]: 7E7DCE197: removed

Ich bin glaube ich nen Schritt weiter. Aus dem Logfile kann man ja erkennen, dass er von UUCP (rmail) die Nachricht mit "pickup" entgegennimmt. Wenn ich folgendes in die "master.cf" einfüge ...

Code:
pickup  fifo    n       -       y       60      1       pickup
  -o content_filter=smtp:[localhost]:10025
  -o receive_override_options=

... dann klappt das mit der Übergabe an AmaVis. Die Frage ist nur, ob dies zu sinnvoll ist?
 

oc2pus

Ultimate Guru
... dann klappt das mit der Übergabe an AmaVis. Die Frage ist nur, ob dies zu sinnvoll ist?

ja, warum nicht. Wenn der pickup die Mail annimmt, dann muss der doch für den Übergang zu amavis sorgen :)

sorry, aber das mit dem logfile hätte ich früher schreiben sollen ...dann wär das schneller gelaufen ;)
 
OP
cinos22

cinos22

Newbie
sorry, aber das mit dem logfile hätte ich früher schreiben sollen ...dann wär das schneller gelaufen

Ist doch kein Problem. :D Auf jedenfall habe ich das Problem gelöst. Nochmals vielen Dank für den Wink mit dem Zaunpfahl in die richtige Richtung. :lol:
 
Status
Für weitere Antworten geschlossen.
Oben