btsperate
(usa Slackware)
Enviado em 12/02/2014 - 17:41h
Pessoal Boa tarde!
Preciso de uma ajuda para configurar o Postfix eu instalei o Zpanel onde ele instalou o postfix e eu fiquei com a configuração.
Os logs de erros: mail.log
root@rmce:/var/log# tail -f mail.log
Feb 12 14:22:00 www postfix/smtp[9919]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c03::1a]:25: Network is unreachable
Feb 12 14:22:00 www postfix/smtp[9918]: connect to alt1.gmail-smtp-in.l.google.com[74.125.131.26]:25: Connection timed out
Feb 12 14:22:00 www postfix/smtp[9918]: connect to alt1.gmail-smtp-in.l.google.com[2607:f8b0:400c:c03::1a]:25: Network is unreachable
Feb 12 14:22:00 www postfix/smtp[9919]: 74A5D2370C: to=<bruno.sperate@gmail.com>, relay=none, delay=493, delays=433/0.02/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c03::1a]:25: Network is unreachable)
Feb 12 14:22:30 www postfix/smtp[9921]: connect to mta6.am0.yahoodns.net[63.250.192.45]:25: Connection timed out
Feb 12 14:22:30 www postfix/smtp[9918]: connect to alt2.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out
Feb 12 14:22:30 www postfix/smtp[9918]: B022A20335: to=<bruno.sperate@gmail.com>, relay=none, delay=1504, delays=1413/0.03/90/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out)
Feb 12 14:23:00 www postfix/smtp[9921]: connect to mta5.am0.yahoodns.net[66.196.118.240]:25: Connection timed out
Feb 12 14:23:30 www postfix/smtp[9921]: connect to mta6.am0.yahoodns.net[66.196.118.240]:25: Connection timed out
Feb 12 14:23:30 www postfix/smtp[9921]: 1C181245E6: to=<bruno_sperate@yahoo.com.br>, relay=none, delay=12985, delays=12835/0.03/150/0, dsn=4.4.1, status=deferred (connect to mta6.am0.yahoodns.net[66.196.118.240]:25: Connection timed out)
Feb 12 14:31:00 www postfix/qmgr[9829]: D026520058: from=<root@control.yourdomain.com>, size=722, nrcpt=1 (queue active)
Feb 12 14:31:00 www postfix/qmgr[9829]: 8B25F23654: from=<root@mail.rmce.com.br>, size=366, nrcpt=1 (queue active)
Feb 12 14:31:00 www postfix/qmgr[9829]: 74A5D2370C: from=<root@mail.rmce.com.br>, size=366, nrcpt=1 (queue active)
Feb 12 14:31:00 www postfix/qmgr[9829]: 9A288208FD: from=<>, size=2957, nrcpt=1 (queue active)
Feb 12 14:31:00 www postfix/smtp[9944]: D026520058: to=<root@control.yourdomain.com>, orig_to=<root>, relay=none, delay=373614, delays=373614/0.03/0.05/0, dsn=4.4.4, status=SOFTBOUNCE (Host or domain name not found. Name service error for name=control.yourdomain.com type=AAAA: Host not found)
Feb 12 14:31:00 www postfix/smtp[9947]: 9A288208FD: to=<root@control.yourdomain.com>, relay=none, delay=96547, delays=96547/0.03/0.05/0, dsn=4.4.4, status=SOFTBOUNCE (Host or domain name not found. Name service error for name=control.yourdomain.com type=AAAA: Host not found)
Feb 12 14:31:30 www postfix/smtp[9945]: connect to gmail-smtp-in.l.google.com[74.125.196.26]:25: Connection timed out
Feb 12 14:31:30 www postfix/smtp[9945]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4002:c07::1b]:25: Network is unreachable
Feb 12 14:31:30 www postfix/smtp[9945]: connect to alt1.gmail-smtp-in.l.google.com[2607:f8b0:400c:c03::1a]:25: Network is unreachable
Feb 12 14:31:30 www postfix/smtp[9946]: connect to gmail-smtp-in.l.google.com[74.125.196.26]:25: Connection timed out
Feb 12 14:31:30 www postfix/smtp[9946]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4002:c07::1b]:25: Network is unreachable
Feb 12 14:31:30 www postfix/smtp[9946]: connect to alt1.gmail-smtp-in.l.google.com[2607:f8b0:400c:c03::1a]:25: Network is unreachable
Feb 12 14:32:00 www postfix/smtp[9945]: connect to alt1.gmail-smtp-in.l.google.com[74.125.131.26]:25: Connection timed out
Feb 12 14:32:00 www postfix/smtp[9945]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable
Feb 12 14:32:00 www postfix/smtp[9946]: connect to alt1.gmail-smtp-in.l.google.com[173.194.75.26]:25: Connection timed out
Feb 12 14:32:00 www postfix/smtp[9945]: 8B25F23654: to=<bruno.sperate@gmail.com>, relay=none, delay=1512, delays=1452/0.02/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable)
Feb 12 14:32:30 www postfix/smtp[9946]: connect to alt2.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out
Feb 12 14:32:30 www postfix/smtp[9946]: 74A5D2370C: to=<bruno.sperate@gmail.com>, relay=none, delay=1123, delays=1033/0.02/90/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection timed out)
O postfix envia o email para ele tipo: contato@rmce.com.br para contato@rmce.com.br
o email chega, mas para os servidores gmail, Hotmail.com yahoo não chega.
O iptables esta configurado dessa forma.
root@rmce:/var/log# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports 1984
ACCEPT all -- anywhere anywhere
fail2ban-ssh tcp -- anywhere anywhere multiport dports 1984
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:http
DROP all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere tcp dpt:imaps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:submission
ACCEPT udp -- anywhere anywhere udp dpt:submission
ACCEPT udp -- anywhere anywhere udp dpt:pop3
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-ssh (2 references)
target prot opt source destination
RETURN all -- anywhere anywhere
RETURN all -- anywhere anywhere
O arquivo de configuração do postfix esta assim:
root@rmce:/etc/postfix# cat main.cf
# postfix config file
# uncomment for debugging if needed
soft_bounce=yes
# postfix main
mail_owner = postfix
setgid_group = postdrop
delay_warning_time = 4
# postfix paths
html_directory = no
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
queue_directory = /var/spool/postfix
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.2.2/samples
readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES
# network settings
inet_interfaces = all
mydomain = rmce.com.br
myhostname = mail.rmce.com.br
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mydestination = $myhostname
relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
# mail delivery
recipient_delimiter = +
# mappings
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#transport_maps = hash:/etc/postfix/transport
#local_recipient_maps =
# virtual setup
virtual_alias_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_alias_maps.cf,
regexp:/etc/zpanel/configs/postfix/virtual_regexp
virtual_mailbox_base = /var/zpanel/vmail
virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_limit_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_minimum_uid = 150
virtual_uid_maps = static:150
virtual_gid_maps = static:8
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
# debugging
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
# authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# tls config
smtp_use_tls = no
smtpd_use_tls = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
#smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
# Change mail.example.com.* to your host name
smtpd_tls_key_file = /etc/ssl/private/mail.rmce.com.br.key
smtpd_tls_cert_file = /etc/ssl/certs/mail.rmce.com.br.crt
smtpd_tls_CAfile = /etc/ssl/certs/root.crt
# rules restrictions
smtpd_client_restrictions =
smtpd_helo_restrictions =
smtpd_sender_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain
# uncomment for realtime black list checks
# ,reject_rbl_client zen.spamhaus.org
# ,reject_rbl_client bl.spamcop.net
# ,reject_rbl_client dnsbl.sorbs.net
smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining
relayhost =
mailbox_size_limit = 0
inet_protocols = all