Postfix - 3 adresy IP i 3 domeny

Konfiguracja serwerów, usług, itp.
Buster
Posty: 1
Rejestracja: 26 września 2017, 09:37

Postfix - 3 adresy IP i 3 domeny

Post autor: Buster » 26 września 2017, 09:57

Witam.
Mam pewien problem, a może to nie problem, tylko ma tak być.
Staram się skonfigurować Postfixa do wysyłania poczty dla 3 domen z konkretnych adresów: domena.1 z adresu.1, domena.2 z adresu.2 itd. Niby działa, ale w nagłówku otrzymanej wiadomości mam dwa pola Received. W pierwszym są dane serwera wysyłającego, a w drugim dane klienta. O pole z danymi klienta się nie czepiam, natomiast dane serwera wysyłającego się w ogóle nie zgadzają.Np dla domeny.2 czy domeny.3 pojawia się adres.1. A tak nie chciałem. Pomoże ktoś w poprawieniu konfiguracji?
Zamieszczam pliki main.cf oraz master.cf.

main.cf

Kod: Zaznacz cały

#soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
#default_privs = nobody
myhostname = host.domena.1
mydomain = domena.1
#myorigin = $myhostname
#myorigin = $mydomain
inet_interfaces = all
inet_protocols=ipv4
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4
#mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,
#mail.$mydomain, www.$mydomain, ftp.$mydomain
local_recipient_maps = unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
mynetworks = $config_directory/mynetworks
relay_domains = $mydestination
#relayhost = [an.ip.add.ress]
#relay_recipient_maps = hash:/etc/postfix/relay_recipients
#in_flow_delay = 1s
#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases
#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
#alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
#recipient_delimiter = +
home_mailbox = Maildir/
#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a "$EXTENSION"
#mailbox_transport = lmtp:unix:/file/name
#mailbox_transport = cyrus
#fallback_transport = lmtp:unix:/file/name
#fallback_transport = cyrus
#fallback_transport =
#luser_relay = $user@other.host
#luser_relay = $local@other.host
#luser_relay = admin+$local
#header_checks = regexp:/etc/postfix/header_checks
#fast_flush_domains = $relay_domains
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
#local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 20
debug_peer_level = 2
#debug_peer_list = some.domain
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = no


disable_vrfy_command    = yes
smtpd_recipient_limit   = 250
biff                    = no
# (note this setting below only affects LOCAL mail delivery agent, not virtual mailboxes)
mailbox_size_limit      = 1073741824
maximal_queue_lifetime  = 5d
message_size_limit      = 80000000
delay_warning_time      = 4h
default_process_limit   = 50
append_dot_mydomain     = no
parent_domain_matches_subdomains =



smtpd_sasl_auth_enable          = yes
smtpd_sasl_security_options     = noanonymous
broken_sasl_auth_clients        = yes
smtpd_sasl_path                 = postfix
smtpd_sasl_local_domain         =
smtpd_sasl_authenticated_header = yes

smtp_use_tls                     = yes
smtpd_use_tls                    = yes
smtpd_tls_auth_only              = no
#smtpd_tls_CAfile                = /usr/local/ssl/ca.pem
#smtpd_tls_key_file               = /usr/local/ssl/key.pem
#smtpd_tls_cert_file              = /usr/local/ssl/cert.pem
#smtpd_tls_CAfile                = /usr/local/ssl/cert.crt
smtpd_tls_key_file               = /usr/local/ssl/smtp.ofertait.pl.key
smtpd_tls_cert_file              = /usr/local/ssl/smtp.ofertait.pl.crt
smtpd_tls_session_cache_database = btree:/etc/postfix/tls_smtpd_scache
smtpd_tls_loglevel               = 1
smtpd_tls_received_header        = yes

proxy_read_maps =
  $local_recipient_maps,
  $mydestination,
  $virtual_alias_maps,
  $virtual_alias_domains,
  $virtual_mailbox_maps,
  $virtual_mailbox_domains,
  $relay_recipient_maps,
  $relay_domains,
  $canonical_maps,
  $sender_canonical_maps,
  $recipient_canonical_maps,
  $relocated_maps,
  $transport_maps,
  $mynetworks,
  $smtpd_recipient_restrictions

###################################################################################
### DEFINE OUR SMTPD RESTRICTIONS, RELAY CONTROL, RBL BLOCKING ETC
smtpd_helo_restrictions =
smtpd_client_restrictions =
smtpd_sender_restrictions =

smtpd_recipient_restrictions =
    check_client_access proxy:mysql:/etc/postfix/mysql-client-access.cf,
    check_sender_access proxy:mysql:/etc/postfix/mysql-sender-access.cf,
    check_recipient_access proxy:mysql:/etc/postfix/mysql-recipient-access.cf,
    permit_sasl_authenticated,
    permit_mynetworks,
    reject_unauth_destination,
    reject_invalid_helo_hostname,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_sender_domain,
    reject_unknown_recipient_domain,
#    reject_rbl_client list.dsbl.org,
    reject_rbl_client cbl.abuseat.org,
    reject_rbl_client dnsbl.njabl.org,
    permit

smtpd_data_restrictions =
    reject_unauth_pipelining,
    permit

###################################################################################
### Virtual alias config
virtual_alias_domains   = proxy:mysql:/etc/postfix/mysql-virtual-alias-domains.cf
virtual_alias_maps      = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf,
                          proxy:mysql:/etc/postfix/mysql-virtual-mailbox-to-alias-maps.cf

###################################################################################
### Virtual mailbox config
# virtual_mailbox_domains : A list of all the virtual mailbox domains
# virtual_mailbox_base  : This value will be prepended to all the virtual_mailbox_maps
# virtual_mailbox_maps  : Virtual email addr to disk location mappings
# virtual_mailbox_limit : Maximal size of an individual mailbox/Maildir file

virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_base    = /var/vmail
virtual_mailbox_maps    = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_mailbox_limit   = 20480000

virtual_transport       = maildrop
maildrop_destination_recipient_limit = 1


smtpd_milters   = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action   = accept
milter_protocol         = 2
master.cf

Kod: Zaznacz cały

smtp      inet  n       -       n       -       -       smtpd
adres.ip.1:submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=reject_sender_login_mismatch,permit
  -o receive_override_options=no_header_body_checks,no_address_mappings
  -o smtpd_sender_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
  -o myhostname=host.domena.1
  -o mydomain=domena.1
  -o smtp_bind_address=adres.ip.1
  -o smtp_helo_name=host.domena.1
#  -o milter_macro_daemon_name=ORIGINATING
adres.ip.2:submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=reject_sender_login_mismatch,permit
  -o receive_override_options=no_header_body_checks,no_address_mappings
  -o smtpd_sender_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
  -o myhostname=host.domena.2
  -o mydomain=domena.2
  -o smtp_bind_address=adres.ip.2
  -o smtp_helo_name=host.domena.2
#  -o milter_macro_daemon_name=ORIGINATING
adres.ip.3:submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=reject_sender_login_mismatch,permit
  -o receive_override_options=no_header_body_checks,no_address_mappings
  -o smtpd_sender_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
  -o myhostname=host.domena.3
  -o mydomain=domena.3
  -o smtp_bind_address=adres.ip.3
  -o smtp_helo_name=host.domnea.3
#  -o milter_macro_daemon_name=ORIGINATING

smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#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       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
maildrop  unix  -       n       n       -       10       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

ODPOWIEDZ