Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix und amavisd-new nur bei kommenden Mails
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Fibbs
Guru
Guru


Joined: 26 Jan 2003
Posts: 448
Location: Forstern near Munich / Germany

PostPosted: Wed Jun 01, 2005 10:36 am    Post subject: Postfix und amavisd-new nur bei kommenden Mails Reply with quote

Hallo an alle,

Ich benutze auf einem Rootserver seit einiger Zeit ein Postfix-Setup mit
amavisd-new, virtuellen Benutzern in mySQL, mailman, greylisting (gld)
und cyrus-imapd. Alles funktioniert seit Monaten hervorragend. Meine
Benutzer benutzen SMTPAuth, um relayen zu dürfen. Allerdings möchte ich
nun, dass amavisd-new, den ich über content_filter eingebunden habe, nur
bei eingehenden Mails verwendet wird. Alle emails, die von einem
sasl_authenticated user kommt, soll ohne über den amavisd-new geschleift
zu werden, zugestellt werden. Leider habe ich keine Ahnung, wie ich das
handhaben muss. Ich schicke hier mal Teile meiner main.cf und master.cf,
IP-Adressen, Hostnamen etc. habe ich geändert.

main.cf:
Code:

myhostname = mail.test.org
mydomain = test.org
myorigin = $mydomain
inet_interfaces = 20.20.20.20/24, 127.0.0.1
mynetworks = localhost, localhost.$mydomain

mydestination = $myhostname, localhost.$mydomain, $mydomain,
mail.$mydomain, mysql:/etc/postfix/mysql-mydestination.cf,
hash:/etc/postfix/mydestination

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf,
hash:/etc/postfix/virtual-mailman
#, hash:/home/mailman/data/virtual-mailman

sender_canonical_maps = hash:/etc/postfix/sender-canonical,
mysql:/etc/postfix/mysql-canonical.cf

transport_maps = hash:/etc/postfix/transport

mailbox_transport = cyrus

alias_database = hash:/etc/mail/aliases

owner_request_special = no
recipient_delimiter = +
unknown_local_recipient_reject_code = 550

local_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases, hash:/home/mailman/data/aliases
smtpd_banner = $myhostname ESMTP the really cool Mailserver

smtpd_sasl_auth_enable = yes

smtpd_client_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_rbl_client bl.spamcop.net,
        reject_rbl_client dul.dnsbl.sorbs.net,
        reject_rbl_client sbl-xbl.spamhaus.org,
        reject_rbl_client list.dsbl.org,
        reject_rbl_client opm.blitzed.org

smtpd_recipient_restrictions =
        check_recipient_access hash:/etc/postfix/recipient_access,
        permit_sasl_authenticated,
        permit_mynetworks,
        reject_unauth_destination,
        reject_non_fqdn_recipient,
        reject_unknown_recipient_domain,
        reject_invalid_hostname,
        check_client_access mysql:/etc/postfix/mysql-clients.cf
        check_recipient_access mysql:/etc/postfix/mysql-recipients.cf
        reject_unlisted_recipient,
        check_policy_service inet:127.0.0.1:2525,
        permit_auth_destination,
        reject

smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_helo_required = yes

smtpd_use_tls = yes
smtpd_tls_key_file = /var/imap/server.pem
smtpd_tls_cert_file = /var/imap/server.pem
smtpd_tls_CAfile = /var/imap/server.pem

smtpd_helo_required = yes

smtpd_sender_restrictions=
        reject_non_fqdn_sender,
        reject_unknown_sender_domain

# Content-Filter stuff for amavisd-new
content_filter = smtp-amavis:[127.0.0.1]:10024

maximal_queue_lifetime = 3d
smtpd_timeout = 300
message_size_limit = 51200000



master.cf:
Code:

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       15       smtpd
    -o cleanup_service_name=pre-cleanup


ssmtp     inet  n       -       n       -       15      smtpd
        -o smtpd_tls_wrappermode=yes
        -o smtpd_sasl_auth_enable=yes
        -o cleanup_service_name=pre-cleanup

#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
    -o cleanup_service_name=pre-cleanup

cleanup   unix  n       -       n       -       0       cleanup
    -o mime_header_checks=
    -o nested_header_checks=
    -o body_checks=
    -o header_checks=

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
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       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.

# Great Interfaces to the really nice amavisd-new software
smtp-amavis unix -      -       n       -       2       smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes

localhost:10025 inet n - n - 10 smtpd
        -o content_filter=
        -o local_recipient_maps=
        -o mynetworks=127.0.0.0/8
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o strict_rfc821_envelopes=yes

pre-cleanup  unix n     -       n       -       0       cleanup
        -o virtual_alias_maps=

ondemand    unix -     -        n      -        -       smtp
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix  -       n       n       -       -       pipe
  flags=R user=cyrus argv=/usr/lib/cyrus/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
cyrus     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -m ${extension}
${user}

cyrus-ondemand     unix  -       n       n       -       -       pipe
  user=cyrus argv=/usr/lib/cyrus/deliver -e -r ${sender} -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


Ich würde mich über einen Tip freuen.


Fibbs
Back to top
View user's profile Send private message
tgurr
Retired Dev
Retired Dev


Joined: 27 Jan 2004
Posts: 571
Location: germany

PostPosted: Wed Jun 01, 2005 4:03 pm    Post subject: Reply with quote

Ich hatte ein ähliches Problem, habe das durch einen zusätzlichen Eintrag in der master.cf gelöst, ein weiterer smtp Dienst, welcher auf Port 30 hört.

Ankommende Emails: fetchmail -> smtp port 25 -> content filter
Ausgehende Emails: MUA -> smtp port 30 -> und weg

Nachteil: Man muss in Anwendungen wie Outlook in die erweiterten Optionen und explizit Port 30 angeben.
Ich hab leider nicht rausgefunden wie man fetchmail an port 30 ausliefern lassen könnte, sonst könnte man es umgekehrt machen und man hätte dieses Problem nicht.
Back to top
View user's profile Send private message
benjamin200
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1426
Location: DE Munich

PostPosted: Thu Jun 02, 2005 10:44 pm    Post subject: Reply with quote

Hi,
das ganze soll wohl auch folgende Realisiert werder können (habs nicht getestet):
Code:

#/etc/amavisd.conf
#
# To reliably avoid spam-scanning outgoing mail, use @bypass_spam_checks_maps
# for nonlocal recipients. To reliably avoid spam scanning for locally
# originating mail (including internal-to-internal mail), recognized by
# the original SMTP client IP address matching @mynetworks, use policy bank
# MYNETS, adjust @mynetworks, and turn on XFORWARD in the Postfix smtp client
# service feeding amavisd.



Gruß
Benjamin
_________________
Gentoo Linux Stage1 / Kernel 2.6.18
AMD Athlon64 3500+ on Asus A8N-E / 1024 MB DDR-RAM / ATI X700 PCIe
Take LINUX and forget Blue Screens
Back to top
View user's profile Send private message
el*Loco
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jan 2003
Posts: 91
Location: Cologne, Germany

PostPosted: Fri Jun 03, 2005 11:18 am    Post subject: Reply with quote

Psy' wrote:
Ich hatte ein ähliches Problem, habe das durch einen zusätzlichen Eintrag in der master.cf gelöst, ein weiterer smtp Dienst, welcher auf Port 30 hört.

Ankommende Emails: fetchmail -> smtp port 25 -> content filter
Ausgehende Emails: MUA -> smtp port 30 -> und weg

Nachteil: Man muss in Anwendungen wie Outlook in die erweiterten Optionen und explizit Port 30 angeben.
Ich hab leider nicht rausgefunden wie man fetchmail an port 30 ausliefern lassen könnte, sonst könnte man es umgekehrt machen und man hätte dieses Problem nicht.

Warum Port 30? Dafür gibt es den Submission Port 587 - der ist genau dafür da. In der master.cf sollte folgendes stehen:
Code:
submission   inet  n    -       n       -       -       smtpd
  -o smtpd_etrn_restrictions=reject
  -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
  -o content_filter=

In der /etc/services sollte folgendes stehen:
Code:
submission      587/tcp               # Submission
submission      587/udp               # Submission

_________________
WARNING: Do not let Dr. Mario touch your genitals. He is not a real doctor!
Back to top
View user's profile Send private message
Fibbs
Guru
Guru


Joined: 26 Jan 2003
Posts: 448
Location: Forstern near Munich / Germany

PostPosted: Fri Jun 03, 2005 3:58 pm    Post subject: Reply with quote

Hi Psy'!

Leider bringt mich Deine Methode nicht weiter, da ja auf meinem Server keine Mails mit fetchmail abgeholt werden, die kommen alle über die entsprechenden MX-Einträge im DNS direkt auf Port 25 an, das kann ich auch nur schlecht beeinflussen.

Die Clients umstellen, ist auch so ne Sache. Viele Clients lassen sich ersten Portmäßig gar nicht umstellen (Outlook kann sowas z. B. bestimmt nicht) und außerdem sind die meisten User ja schon damit überfordert, überhaupt was ins email-Programm einzutragen.

Hi benjamin200!

Dein Schnipsel sieht sehr gut aus. Ich hab zwar noch nicht 100%ig verstanden, was der mir genau sagen will, aber der Ansatz ist gut. Ich habe in amavisd-new mal vor längerer Zeit einen Parameter gefunden, der eine Liste der lokalen Domains angibt, mit dem man auch die Checks ausschließen kann, was sich aber aufgrund dessen, dass meine Domains in einer mySQLDB liegen, als schwierig herausgestellt hat.

Die Lösung, die Du gepostet hast, sieht interessant aus, ich werde mir das nochmal genau in den docs durchlesen und dann mal Testen, anschließend melde ich mich wieder hier.


Gruß

Fibbs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum