O Exim não pode enviar para servidores de correio remotos

2

Estou usando uma compilação personalizada do exim (junto com o afterlogic pro mailsuite) com o centos5.6. O sistema não pode enviar para servidores de correio remotos, como o yahoo ou o gmail, e apresenta este erro:

[email protected] R=dnslookup defer (-1): host lookup did not complete

Eu posso pesquisar registros do gmail.com com o comando dig:

    #dig mx gmail.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> mx gmail.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2234
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;gmail.com.         IN  MX

;; ANSWER SECTION:
gmail.com.      3600    IN  MX  30 alt3.gmail-smtp-in.l.google.com.
gmail.com.      3600    IN  MX  20 alt2.gmail-smtp-in.l.google.com.
gmail.com.      3600    IN  MX  5 gmail-smtp-in.l.google.com.
gmail.com.      3600    IN  MX  10 alt1.gmail-smtp-in.l.google.com.
gmail.com.      3600    IN  MX  40 alt4.gmail-smtp-in.l.google.com.

;; Query time: 16 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Mar 16 16:23:27 2012
;; MSG SIZE  rcvd: 150

Eu executei um comando de depuração com o exim e ele veio assim:

    #bin/exim -bt -d-resolver [email protected]
Exim version 4.76 uid=0 gid=0 pid=2368 D=fbb95cfd
Berkeley DB: Berkeley DB 5.2.36: (September 14, 2011)
Support for: crypteq iconv() OpenSSL Content_Scanning DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz mysql
Authenticators: cram_md5 plaintext spa
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir autoreply pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.1.2 20080704 (Red Hat 4.1.2-51)]
Library version: OpenSSL: Compile: OpenSSL 1.0.0e 6 Sep 2011
                          Runtime: OpenSSL 1.0.0e 6 Sep 2011
Library version: PCRE: Compile: 8.13
                       Runtime: 8.13 2011-08-16
Total 7 lookups
Library version: MySQL: Compile: 5.1.56 [Source distribution]
                        Runtime: 5.1.56
WHITELIST_D_MACROS unset
TRUSTED_CONFIG_LIST unset
changed uid/gid: forcing real = effective
  uid=0 gid=0 pid=2368
  auxiliary group list: <none>
seeking password data for user "exim": cache not available
getpwnam() succeeded uid=3000 gid=3000
seeking password data for user "root": cache not available
getpwnam() succeeded uid=0 gid=0
configuration file is /usr/mailsuite/etc/exim
log selectors = 0000cefe 00233821
trusted user
admin user
seeking password data for user "exim": cache not available
getpwnam() succeeded uid=3000 gid=3000
seeking password data for user "exim": using cached result
getpwnam() succeeded uid=3000 gid=3000
seeking password data for user "exim": using cached result
getpwnam() succeeded uid=3000 gid=3000
originator: uid=0 gid=0 login=root name=root
sender address = [email protected]
Address testing: uid=0 gid=3000 euid=0 egid=3000
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing [email protected]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering [email protected]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing [email protected]
--------> dnslookup router <--------
local_part=someuser domain=gmail.com
checking domains
search_open: mysql "NULL"
search_find: file="NULL"
  key="SELECT name FROM awm_domains WHERE name = 'gmail.com' AND is_internal = 1 " partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
  type=mysql key="SELECT name FROM awm_domains WHERE name = 'gmail.com' AND is_internal = 1 "
database lookup required for SELECT name FROM awm_domains WHERE name = 'gmail.com' AND is_internal = 1 
MySQL query: SELECT name FROM awm_domains WHERE name = 'gmail.com' AND is_internal = 1 
MYSQL new connection: host=localhost port=0 socket=/usr/mailsuite/tmp/mysql.sock database=exim user=root
MYSQL: no data found
lookup failed
gmail.com in ""? no (end of list)
gmail.com in "! +local_domains"? yes (end of list)
calling dnslookup router
dnslookup router called for [email protected]
  domain = gmail.com
DNS lookup of gmail.com (MX) succeeded
DNS lookup of gmail-smtp-in.l.google.com (A) succeeded
DNS lookup of alt1.gmail-smtp-in.l.google.com (A) succeeded
DNS lookup of alt2.gmail-smtp-in.l.google.com (A) succeeded
DNS lookup of alt3.gmail-smtp-in.l.google.com (A) succeeded
DNS lookup of alt4.gmail-smtp-in.l.google.com (A) succeeded
fully qualified name = gmail.com
host_find_bydns yield = HOST_FOUND (2); returned hosts:
  gmail-smtp-in.l.google.com 209.85.225.27 MX=5 
  alt1.gmail-smtp-in.l.google.com 173.194.76.27 MX=10 
  alt2.gmail-smtp-in.l.google.com 74.125.115.27 MX=20 
  alt3.gmail-smtp-in.l.google.com 173.194.67.26 MX=30 
  alt4.gmail-smtp-in.l.google.com 173.194.65.26 MX=40 
set transport remote_smtp
queued for remote_smtp transport: local_part = someuser
domain = gmail.com
  errors_to=NULL
  domain_data=NULL localpart_data=NULL
routed by dnslookup router
  envelope to: [email protected]
  transport: remote_smtp
  host gmail-smtp-in.l.google.com [209.85.225.27] MX=5
  host alt1.gmail-smtp-in.l.google.com [173.194.76.27] MX=10
  host alt2.gmail-smtp-in.l.google.com [74.125.115.27] MX=20
  host alt3.gmail-smtp-in.l.google.com [173.194.67.26] MX=30
  host alt4.gmail-smtp-in.l.google.com [173.194.65.26] MX=40
[email protected]
  router = dnslookup, transport = remote_smtp
  host gmail-smtp-in.l.google.com      [209.85.225.27] MX=5
  host alt1.gmail-smtp-in.l.google.com [173.194.76.27] MX=10
  host alt2.gmail-smtp-in.l.google.com [74.125.115.27] MX=20
  host alt3.gmail-smtp-in.l.google.com [173.194.67.26] MX=30
  host alt4.gmail-smtp-in.l.google.com [173.194.65.26] MX=40
search_tidyup called
close MYSQL connection: localhost:(/usr/mailsuite/tmp/mysql.sock)/exim/root

Estou realmente perdido aqui, qualquer ajuda é apreciada.

    
por Tutul 16.03.2012 / 17:21

2 respostas

2

Descobrimos que os MTAs não conseguiam resolver os registros DNS por meio de resolvedores DNS externos. Eu instalei o dnsmasq no servidor local e coloquei-o como a primeira entrada em meu /etc/resolv.conf e tanto o exim quanto o postfix puderam enviar para servidores remotos.

    
por 18.03.2012 / 05:06
1

O Exim não será executado como root . O ID do usuário não-raiz padrão usado é codificado como parte da compilação. No seu caso, parece ser exim . Adicione um ID de usuário exim ao grupo exim e ele deve ser executado.

EDIT: Perdeu a barra de rolagem no log. O Exim parece estar selecionando o roteador correto e a pesquisa de DNS foi bem-sucedida. No entanto, não há indicação de que uma conexão está sendo estabelecida com o servidor remoto. Tente usar o telnet para um ou mais dos IPs para ver se você pode se conectar à porta SMTP. O comando

telnet 209.85.225.27 25

Deve resultar em algo como o seguinte:

Trying 209.85.225.27...
Connected to 209.85.225.27.
Escape character is '^]'.
220 mx.google.com ESMTP el4si7116293icb.3

A linha que começa com 220 é aquela que indica que você se conectou ao servidor. Se tiver êxito, digite QUIT para fechar a conexão. Se não for bem-sucedido, é provável que você tenha um firewall impedindo as conexões SMTP de saída.

    
por 17.03.2012 / 01:11