No meu Linode , segui este doc para configurar um servidor de e-mail.
Agora posso enviar email para qualquer domínio, mas não consigo receber de outros domínios!
Quero dizer [email protected] pode receber de [email protected] mas não pode receber qualquer email de xxx @ gmail / yahoo / ... com.
Eu verifiquei meu vmail (Maildir) também, e-mails de outros domínios não estão lá.
Recebi Notificação de status de entrega (Atraso) do Gmail (após cerca de 24 horas):
Delivery to the following recipient has been delayed:
[email protected]
Message will be retried for 2 more day(s)
Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at http://mail.google.com/support/bin/answer.py?answer=7720
[mail.mydomain.com. (10): Connection refused]
E são minhas configurações:
Eu tenho um registro MX :
mail.mydomain.com
e Registros A / AAAA :
mail (with same ip as my server)
Meu / etc / hosts
127.0.0.1 localhost.localdomain localhost
(server ip) hostname.mydomain.com hostname
Meu / etc / default / saslauthd
START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
Meu / etc / aliases
postmaster: root
root: [email protected]
Meu /usr/share/postfix/main.cf
protocols = imap imaps pop3 pop3s
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n/Maildir
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
namespace private {
separator = .
prefix = INBOX.
inbox = yes
}
protocol lda {
log_path = /home/vmail/dovecot-deliver.log
auth_socket_path = /var/run/dovecot/auth-master
postmaster_address = [email protected]
mail_plugins = sieve
global_script_path = /home/vmail/globalsieverc
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}
auth default {
user = root
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb static {
args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
}
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0600
user = vmail
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
Meu /usr/share/postfix/main.cf
# 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.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = 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
readme_directory = /usr/share/doc/postfix
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = hostname.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = hostname.mydomain.com, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = (server ip), 127.0.0.1
html_directory = /usr/share/doc/postfix/html
message_size_limit = 30720000
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destinationvirtual_create_maildirsize = yes
virtual_maildir_extended = 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 $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
Minhas regras do iptables :
(Eu uso 2525 em vez de 25 portas e ele está aberto na minha máquina e isp, eu posso fazer teleneteamento nele)
pkts bytes target prot opt in out source destination
130 7820 ACCEPT tcp -- any any anywhere anywhere tcp dpt:smtp
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:25
388 33099 ACCEPT tcp -- any any anywhere anywhere tcp dpt:2525
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:2525
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:100
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:pop3
65 3538 ACCEPT tcp -- any any anywhere anywhere tcp dpt:pop3
0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:26
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:26
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:pop3s
2355 184K ACCEPT tcp -- any any anywhere anywhere tcp dpt:pop3s
Registros
Nada acrescenta ao meu / var / log / mail.log quando eu deveria receber outros domínios, mas parece ok quando tento receber e-mails por clientes de e-mail.
Apr 14 07:53:51 hostname dovecot: pop3-login: Login: user=<[email protected]>, method=PLAIN, rip=94.182.127.182, lip=178.79.152.29, TLS
Apr 14 07:53:52 hostname dovecot: POP3([email protected]): Disconnected: Logged out top=0/0, retr=0/0, del=0/7, size=6546
Nada acontece ao / home / vmail / dovecot-deliver.log quando eu recebo emails de outros domínios, mas no caso de um mesmo email de domínio parece normal:
2011-04-14 05:42:53 deliver([email protected]): Info: msgid=<[email protected]>: saved mail to INBOX
Eu verifiquei o e-mail por VMail, mutt, Apple Mail e Thunderbird e minhas configurações em clientes de e-mail:
Tipo de conta: pop3
Servidor de e-mail de entrada: mail.mydomain.com
Nome de usuário: [email protected]
Senha: XXXXX
Servidor de correio de saída:
Nome do servidor: mail.mydomain.com
Porta: 2525
Usar SSL
Autenitocation : Senha
Nome de usuário: [email protected]
Senha: XXXXX