Debian 6 +Postfix +Dovecot +SASL, a relay-hez miért nem kell hitelesítenie magát a felhasználónak, ha saját magának küld???

Fórumok

Sziasztok!

Van egy Postfix-es gondom, ami már nagyon bosszant, mert napok óta nem tudom megoldani és gondoltam, talán Ti tudtok segíteni. Van egy Debian Squeeze szerverem (64bit), Potsfix és Dovecot csomagokkal (minden a legfrissebb). A levél küldés szépen jön-megy, beállítottam, hogy elérjem IMAP-on POP3-on keresztül és mindezt titkosítva, továbbá a relay access is csak hitelesítéssel megy, illetve akár TLS-en keresztül is.

Tehát látszólag kész is lennék, de a tesztelés közben észrevettem, hogy a belső felhasználóm (nevezzük belso@ceg1.hu -nak) habár valóban nem tud kifele küldeni e-mailt hitelesítés nélkül (kulso@ceg2.hu részére), de valamilyen okból kifolyólag saját magának IGEN! Tehát, ha beállítom az Oulookban, hogy az én e-mail címem belso@ceg1.hu és a hozzá tartozó SMTP kiszolgálót, akkor minden további nélkül tudok küldeni egy e-mailt a belso@ceg1.hu címre. Máshova persze nem, de ettől még így egy csomó spam-et kaphatok illetéktelenektől a saját nevemben, saját magamnak..

Tud erre valaki tanácsolni nekem valamilyen megoldást? Éjjel-nappal szörfölök a neten választ találni a kérdésemre, de eddig még nem kaptam.

Előre is köszönöm a segítségetek!

Üdv.

D

Hozzászólások

nem a kuldo, hanem a cimzett miatt tudsz oda kuldeni, mivel a cimzett helyi.

t

Ez hülyeség, valami nem oké a konfigban.
A feladó címe az egy dolog, de mynetworks -ből és sasl_authenticated forrásból engedsz küldeni, nem?

Ebben az esetben tulajdonképpen nem számít h. mi a feladó címe. Legalábbis nem kellene számítania :)

Bocs közben rájöttem h. rájöttél. Keep up the good work!

Ez esetleg segít:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.

# should be the FQDN of your machine
myhostname=mail.ceg1.hu
# internet domain name of your system.
# Default is to use $myhostname without the sub-domain
mydomain=ceg1.hu
# the domain from which local emails will be from: root@example.org
myorigin=$mydomain

# set to localhost, because we handle all domains via virtual_mailbox_domains
mydestination = localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
inet_interfaces = all
mailbox_size_limit = 0
recipient_delimiter = +

# debug level for messages in log. level 2 is the default one
debug_peer_level=2
# debug request only coming from this IP
#debug_peer_list=127.0.0.1

# the banner your mail system will greet a client who opens a socket to us
smtpd_banner=$myhostname ESMTP $mail_name
# disable information messages to local users about new emails
biff=no

# we don't use relayhost, so set it empty
relayhost=

# disable showing why the user does not exist in your system
show_user_unknown_table_name=no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# local aliases for postmaster, root, ...
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

# virtual domain options
###############################
# save destination of the incoming mails
virtual_mailbox_base=/var/vmail
# the following 3 files are 2-columns files. I will call the left column the left side handed (LSH) and the right column the right side handed (RSH)
# contains the domain names for which emails will be accepted. The LSH contains the names, the RSH any string but at least one char (e.g. OK)
virtual_mailbox_domains=hash:/etc/postfix/virtual_mailbox_domains
# contains the virtual mailboxes for which emails will be saved on this system. LSH: incoming e-mail address, RSH: location of the mailbox relative to $virt$
virtual_mailbox_maps=hash:/etc/postfix/virtual_mailbox_maps
# contains the redirections. LSH: incoming e-mail address, RSH: forwarding e-mail address, multiple forwading addresses are seperated with comma
virtual_alias_maps=hash:/etc/postfix/virtual_alias_maps

# userid of the virtual mailbox user we created
virtual_minimum_uid=100
virtual_uid_maps=static:5000
# groupid of the virtual mailbox user we created
virtual_gid_maps=static:5000
# delivery agent we use to save the mails
virtual_transport=dovecot

# TLS parameters
###############################
# own certificate
smtpd_tls_cert_file=/etc/apache2/ssl/mail.ceg1.hu.pem
smtpd_tls_key_file=/etc/apache2/ssl/mail.ceg1.hu.key
# accepted CA certificates
smtpd_tls_CAfile=/etc/ssl/certs/ca-certificates.crt
smtp_tls_CAfile=/etc/ssl/certs/ca-certificates.crt

smtp_use_tls=yes
smtpd_use_tls=yes
smtpd_tls_loglevel=1
smtpd_tls_received_header=yes
tls_random_source=dev:/dev/urandom
smtp_tls_note_starttls_offer=yes

smtpd_tls_session_cache_timeout=3600s
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

queue_directory=/var/spool/postfix
smtpd_sasl_type=dovecot
smtpd_sasl_path=private/auth
#smtpd_sasl_path=auth/dovecot
smtpd_sasl_auth_enable=yes
broken_sasl_auth_clients=yes

smtpd_sasl_security_options=noanonymous
smtpd_sasl_tls_security_options=$smtpd_sasl_security_options
smtpd_sasl_local_domain=$myhostname
smtpd_sasl_application_name=smtpd

smtpd_helo_required=yes
smtpd_helo_restrictions=reject_invalid_helo_hostname
smtpd_recipient_restrictions=
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination
reject_unauth_pipelining
reject_invalid_hostname
reject_non_fqdn_sender
reject_unknown_sender_domain
reject_non_fqdn_recipient
reject_unknown_recipient_domain

Hello, végül megtaláltam a megoldást. Az smtpd_recipient_restrictions után nem mindegy, milyen sorrendben visszük fel a kritériumokat. Az alábbival már tökéletesen működik:

smtpd_recipient_restrictions=
permit_sasl_authenticated
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_non_fqdn_hostname,
reject_invalid_hostname,
permit_mynetworks,
reject_unauth_pipelining,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_unknown_client,
permit

Üdv.

D