Centos 5.x: Problemas de envio con postfix.

Todos los comentarios sobre redes y servidores en linux y su interacción con otros sistemas operativos.

Moderadores: doc, Kde_Tony, ps-ax

Responder
Avatar de Usuario
klabacitaa
Forista Nuevo
Forista Nuevo
Mensajes: 19
Registrado: Dom Dic 06, 2009 8:00 am

Centos 5.x: Problemas de envio con postfix.

Mensaje por klabacitaa » Dom Dic 06, 2009 6:41 am

Hola.

He estado tratando de configurar un servidor de correo con postfix, pero aun no he logrado hacer que mis cuentas reciban correo local. No estooy usando virtual users, sino los mismos directorios home de cada usuario: /home/$USER.

Por default postfix desea usar los usuarios virtuales, leyendo me encontre que para cambiar eso necesito crear un promailrc en /etc y con ese se aplica globalmente a todos los usuarios, espero haya otra manera de hacer esto, aqui esta mi procmailrc:

****procmailrc******
MAILDIR=$HOME/Maildir
DEFAULT=$HOME/Maildir
LOGFILE=$HOME/pm.log
VERBOSE=on
TMP=/tmp

Postfix principal:

********main.conf***********
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.my-domain
mydomain = my-domain
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.50.0/24, 127.0.0.0/8
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
local_recipient_maps = unix:passwd.byname $alias_maps
home_mailbox = Maildir/
mailbox_command = /usr/bin/procmail
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
local_destination_concurrency_limit = 1
debug_peer_level = 5
debug_peer_list = 127.0.0.1
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

Mis pruebas han sido directamente con telnet, todos mi usuarios esta contenidos en ldap, y con smbldap-tools los controlo. Todo esto esta funcionando.

Mi dns esta operando, por resolucion no veo problemas en mi red.

Incremente el debug-level de postfix y a continuacion se los pego, a ver si alguien logra decifrar si por ahi esta el error:

Dec 5 00:12:17 mail postfix/smtpd[6547]: resolve_clnt: `' -> `user1@XXX.dyndns.org' -> transp=`local' host=`mail.XXX.dyndns.org' rcpt=`user1@XXX.dyndns.org' flags= class=local
Dec 5 00:12:17 mail postfix/smtpd[6547]: ctable_locate: install entry key user1@XXX.dyndns.org
Dec 5 00:12:17 mail postfix/smtpd[6547]: extract_addr: in: <XXX@XXX.dyndns.org>, result: XXX@XXX.dyndns.org
Dec 5 00:12:17 mail postfix/smtpd[6547]: fsspace: .: block size 4096, blocks free 3816770
Dec 5 00:12:17 mail postfix/smtpd[6547]: smtpd_check_queue: blocks 4096 avail 3816770 min_free 0 msg_size_limit 10240000
Dec 5 00:12:17 mail postfix/smtpd[6547]: > mail.XXX.dyndns.org[192.168.50.140]: 250 2.1.0 Ok
Dec 5 00:12:17 mail postfix/smtpd[6547]: watchdog_pat: 0x819ae78
Dec 5 00:12:17 mail postfix/smtpd[6547]: vstream_fflush_some: fd 9 flush 14
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 9 got 39
Dec 5 00:12:30 mail postfix/smtpd[6547]: < mail.XXX.dyndns.org[192.168.50.140]: rcpt to:<user2@XXX.dyndns.org>
Dec 5 00:12:30 mail postfix/smtpd[6547]: extract_addr: input: <user2@XXX.dyndns.org>
Dec 5 00:12:30 mail postfix/smtpd[6547]: smtpd_check_addr: addr=user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: event_request_timer: reset 0x59a310 0x81a8e70 100
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr request = rewrite
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr rule = local
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr address = user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_fflush_some: fd 12 flush 64
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 12 got 45
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: 0
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: address
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: address
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: (list terminator)
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: (end)
Dec 5 00:12:30 mail postfix/smtpd[6547]: rewrite_clnt: local: user2@XXX.dyndns.org -> user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: event_request_timer: reset 0x59a310 0x81a8e70 100
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr request = resolve
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr sender =
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr address = user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_fflush_some: fd 12 flush 61
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 12 got 105
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: 0
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: transport
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: transport
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: local
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: nexthop
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: nexthop
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: mail.XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: recipient
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: recipient
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: resolve_clnt: `' -> `user2@XXX.dyndns.org' -> transp=`local' host=`mail.XXX.dyndns.org' rcpt=`user2@XXX.dyndns.org' flags= class=local
Dec 5 00:12:30 mail postfix/smtpd[6547]: ctable_locate: install entry key user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: extract_addr: in: <user2@XXX.dyndns.org>, result: user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: event_request_timer: reset 0x59a310 0x81a8e70 100
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr request = rewrite
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr rule = local
Dec 5 00:12:30 mail postfix/smtpd[6547]: send attr address = postmaster
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_fflush_some: fd 12 flush 47
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 12 got 47
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: flags
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: 0
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: address
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: address
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute value: postmaster@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: private/rewrite socket: wanted attribute: (list terminator)
Dec 5 00:12:30 mail postfix/smtpd[6547]: input attribute name: (end)
Dec 5 00:12:30 mail postfix/smtpd[6547]: rewrite_clnt: local: postmaster -> postmaster@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: >>> START Recipient address RESTRICTIONS <<<
Dec 5 00:12:30 mail postfix/smtpd[6547]: generic_checks: name=permit_mynetworks
Dec 5 00:12:30 mail postfix/smtpd[6547]: permit_mynetworks: mail.XXX.dyndns.org 192.168.50.140
Dec 5 00:12:30 mail postfix/smtpd[6547]: match_hostname: mail.XXX.dyndns.org ~? 192.168.50.0/24
Dec 5 00:12:30 mail postfix/smtpd[6547]: match_hostaddr: 192.168.50.140 ~? 192.168.50.0/24
Dec 5 00:12:30 mail postfix/smtpd[6547]: generic_checks: name=permit_mynetworks status=1
Dec 5 00:12:30 mail postfix/smtpd[6547]: >>> CHECKING RECIPIENT MAPS <<<
Dec 5 00:12:30 mail postfix/smtpd[6547]: ctable_locate: leave existing entry key user2@XXX.dyndns.org
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: recipient_canonical_maps: user2@XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: recipient_canonical_maps: user2: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: recipient_canonical_maps: @XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: mail_addr_find: user2@XXX.dyndns.org -> (not found)
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: canonical_maps: user2@XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: canonical_maps: user2: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: canonical_maps: @XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: mail_addr_find: user2@XXX.dyndns.org -> (not found)
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: virtual_alias_maps: user2@XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: virtual_alias_maps: user2: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: virtual_alias_maps: @XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: mail_addr_find: user2@XXX.dyndns.org -> (not found)
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: local_recipient_maps: user2@XXX.dyndns.org: not found
Dec 5 00:12:30 mail postfix/smtpd[6547]: maps_find: local_recipient_maps: unix:passwd.byname(0,lock|fold_fix): user2 = user2:x:1001:513:System User:/home/user2:/sbin/nologin
Dec 5 00:12:30 mail postfix/smtpd[6547]: mail_addr_find: user2@XXX.dyndns.org -> user2:x:1001:513:System User:/home/user2:/sbin/nologin
Dec 5 00:12:30 mail postfix/smtpd[6547]: smtpd_check_rewrite: trying: permit_inet_interfaces
Dec 5 00:12:30 mail postfix/smtpd[6547]: permit_inet_interfaces: mail.XXX.dyndns.org 192.168.50.140
Dec 5 00:12:30 mail postfix/smtpd[6547]: before input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping enable_milters
Dec 5 00:12:30 mail postfix/smtpd[6547]: after input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapping
Dec 5 00:12:30 mail postfix/smtpd[6547]: connect to subsystem public/cleanup
Dec 5 00:12:30 mail postfix/smtpd[6547]: > mail.XXX.dyndns.org[192.168.50.140]: 250 2.1.5 Ok
Dec 5 00:12:30 mail postfix/smtpd[6547]: watchdog_pat: 0x819ae78
Dec 5 00:12:30 mail postfix/smtpd[6547]: vstream_fflush_some: fd 9 flush 14
Dec 5 00:12:32 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 9 got 6
Dec 5 00:12:32 mail postfix/smtpd[6547]: < mail.XXX.dyndns.org[192.168.50.140]: data
Dec 5 00:12:32 mail postfix/smtpd[6547]: rec_put: type M len 0 data
Dec 5 00:12:32 mail postfix/smtpd[6547]: rec_put: type N len 81 data Received:
Dec 5 00:12:32 mail postfix/smtpd[6547]: rec_put: type N len 62 data ?by mail.p
Dec 5 00:12:32 mail postfix/smtpd[6547]: rec_put: type N len 73 data ?for <eque
Dec 5 00:12:32 mail postfix/smtpd[6547]: > mail.XXX.dyndns.org[192.168.50.140]: 354 End data with <CR><LF>.<CR><LF>
Dec 5 00:12:32 mail postfix/smtpd[6547]: vstream_fflush_some: fd 9 flush 37
Dec 5 00:12:39 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 9 got 7
Dec 5 00:12:39 mail postfix/smtpd[6547]: rec_put: type N len 5 data test.
Dec 5 00:12:39 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 9 got 3
Dec 5 00:12:39 mail postfix/smtpd[6547]: rec_put: type X len 0 data
Dec 5 00:12:39 mail postfix/smtpd[6547]: rec_put: type E len 0 data
Dec 5 00:12:39 mail postfix/smtpd[6547]: vstream_fflush_some: fd 14 flush 235
Dec 5 00:12:39 mail postfix/smtpd[6547]: public/cleanup socket: wanted attribute: status
Dec 5 00:12:39 mail postfix/cleanup[6551]: 6B6CC18FA01: message-id=<20091205081230.6B6CC18FA01@mail.XXX.dyndns.org>
Dec 5 00:12:39 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 14 got 18
Dec 5 00:12:39 mail postfix/smtpd[6547]: input attribute name: status
Dec 5 00:12:39 mail postfix/smtpd[6547]: input attribute value: 0
Dec 5 00:12:39 mail postfix/smtpd[6547]: public/cleanup socket: wanted attribute: reason
Dec 5 00:12:39 mail postfix/smtpd[6547]: input attribute name: reason
Dec 5 00:12:39 mail postfix/smtpd[6547]: input attribute value: (end)
Dec 5 00:12:39 mail postfix/smtpd[6547]: public/cleanup socket: wanted attribute: (list terminator)
Dec 5 00:12:39 mail postfix/smtpd[6547]: input attribute name: (end)
Dec 5 00:12:39 mail postfix/smtpd[6547]: > mail.XXX.dyndns.org[192.168.50.140]: 250 2.0.0 Ok: queued as 6B6CC18FA01
Dec 5 00:12:39 mail postfix/smtpd[6547]: watchdog_pat: 0x819ae78
Dec 5 00:12:39 mail postfix/smtpd[6547]: vstream_fflush_some: fd 9 flush 37
Dec 5 00:12:39 mail postfix/qmgr[6516]: 6B6CC18FA01: from=<user1@XXX.dyndns.org>, size=406, nrcpt=1 (queue active)
Dec 5 00:12:39 mail postfix/local[6552]: 6B6CC18FA01: to=<user2@XXX.dyndns.org>, relay=local, delay=22, delays=22/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)
Dec 5 00:12:39 mail postfix/qmgr[6516]: 6B6CC18FA01: removed
Dec 5 00:12:40 mail postfix/smtpd[6547]: vstream_buf_get_ready: fd 9 got 6
Dec 5 00:12:40 mail postfix/smtpd[6547]: < mail.XXX.dyndns.org[192.168.50.140]: quit
Dec 5 00:12:40 mail postfix/smtpd[6547]: > mail.XXX.dyndns.org[192.168.50.140]: 221 2.0.0 Bye
Dec 5 00:12:40 mail postfix/smtpd[6547]: vstream_fflush_some: fd 9 flush 15
Dec 5 00:12:40 mail postfix/smtpd[6547]: match_hostname: mail.XXX.dyndns.org ~? 192.168.50.0/24
Dec 5 00:12:40 mail postfix/smtpd[6547]: match_hostaddr: 192.168.50.140 ~? 192.168.50.0/24
Dec 5 00:12:40 mail postfix/smtpd[6547]: disconnect from mail.XXX.dyndns.org[192.168.50.140]
Dec 5 00:12:40 mail postfix/smtpd[6547]: master_notify: status 1
Dec 5 00:12:40 mail postfix/smtpd[6547]: connection closed
Dec 5 00:12:40 mail postfix/smtpd[6547]: watchdog_stop: 0x819ae78
Dec 5 00:12:40 mail postfix/smtpd[6547]: watchdog_start: 0x819ae78

Log de procmail


From XXX.dyndns.org@XXX.dyndns.org Sat Dec 5 00:04:42 2009
Folder: /home/user2/Maildir/msg.CFHP 607
procmail: [6553] Sat Dec 5 00:12:39 2009
procmail: Assigning "TMP=/tmp"
procmail: Assigning "PATH=/home/user2/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
procmail: Assigning "LASTFOLDER=/home/user2/Maildir/msg.DFHP"
procmail: Opening "/home/user2/Maildir/msg.DFHP"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "user2@0:/home/user2/Maildir/msg.DFHP"
From user1@XXX.dyndns.org Sat Dec 5 00:12:39 2009
Folder: /home/user2/Maildir/msg.DFHP 583

Dentro de este usuario tengoe estos logs, donde al parecer indica que si llego un mensaje:

cat msg.DFHP

From user1@XXX.dyndns.org Sat Dec 5 00:12:39 2009
Return-Path: <user1@XXX.dyndns.org>
X-Original-To: user1@XXX.dyndns.org
Delivered-To: user1@XXX.dyndns.org
Received: from mail.XXX.dyndns.org (mail.XXX.dyndns.org [192.168.50.140])
by mail.XXX.dyndns.org (Postfix) with SMTP id 6B6CC18FA01
for <user1@XXX.dyndns.org>; Sat, 5 Dec 2009 00:12:17 -0800 (PST)
Message-Id: <20091205081230.6B6CC18FA01@mail.XXX.dyndns.org>
Date: Sat, 5 Dec 2009 00:12:17 -0800 (PST)
From: user1@XXX.dyndns.org

test.

Cualquier cosa que pueda ayudarme sera bien recibida, se los agradezco, saludos :D
Avatar de Usuario
Kde_Tony
Moderador
Moderador
Mensajes: 3866
Registrado: Mié Jul 20, 2005 7:00 am
Ubicación: /home/Peru/Lima/La Molina
Contactar:

Mensaje por Kde_Tony » Lun Dic 07, 2009 5:55 pm

1.- tus dns estan mal configurados
2.- main.cf tiene errores segun el log.

dices que tienes usuarios con ldap, cuando pones en consola id usuario, a que grupo hace referencia ???
"Quiero cambiar al mundo pero no me dan los RPM"
----------------------------
Tony Blair
Linux User # 433253
Ubuntu User # 9562
-----------------------------
Avatar de Usuario
klabacitaa
Forista Nuevo
Forista Nuevo
Mensajes: 19
Registrado: Dom Dic 06, 2009 8:00 am

Re: Centos 5.x: Problemas de envio con postfix.

Mensaje por klabacitaa » Lun Dic 07, 2009 9:35 pm

Bueno, hasta ahorita no probado la comunicacion hacia el exterior es pura prueba interna,
mi /etc/hosts apunta a el nombre de mi host.

Si yo pingeo mi hosts ejemplo, ya sea:

ping localhost
ping127.0.0.1
ping mail.XXX.dyndns.org
ping 192.168.50.140

En todos me responde esta caja.

Estuve revisando mi firewall y cuando hago mis pruebas nunca recibe algun paquete de esta caja, esto me indica que no esta haciendo uso de mi dns, ya que por el momento no pretendo aun hacer pruebas externas.

Si me voy a alguna equipo de la red por ejemplo windows, cuando pingeo esa caja me responde sin problemas.

Que mas pruebas deberia hacerle?

De los errores del log, no entiendo muy bien alguno parametros, cuales son los errores para empezar a corregirlos?

En este momento no tengo acceso la caja esa, pero al parecer ldap esta operando sin problemas, puedo aplicar permisos sin problemas, crear cuentas y Centos las reconoce sin problemas, postfix no esta confiugrado aun para usar a ldap , por ello estoy haciendo las pruebas basicas.

Pero mas tarde puedo responder sin problemas esa pregunta.

Gracias Kde_ton.
Avatar de Usuario
klabacitaa
Forista Nuevo
Forista Nuevo
Mensajes: 19
Registrado: Dom Dic 06, 2009 8:00 am

Mensaje por klabacitaa » Mié Dic 09, 2009 10:49 am

kde_tony gracias por tu pronta respuesta.
Pero no era el dns, era este comando:

mailbox_command = /usr/bin/procmail

Al ponerlo como comentario todo empezo a funcionar, gracias!!!
Avatar de Usuario
Kde_Tony
Moderador
Moderador
Mensajes: 3866
Registrado: Mié Jul 20, 2005 7:00 am
Ubicación: /home/Peru/Lima/La Molina
Contactar:

Mensaje por Kde_Tony » Mié Dic 09, 2009 3:41 pm

no te olvides de colocar el post como solucionado

sls
"Quiero cambiar al mundo pero no me dan los RPM"
----------------------------
Tony Blair
Linux User # 433253
Ubuntu User # 9562
-----------------------------
Responder
  • Similar Topics
    Respuestas
    Vistas
    Último mensaje