Centos 5.x: Postfix not sending emails via telnet, no error on logs?
Hi people.
I staring to learn postfix, at the wiki of centos exist some tutorials but I need a more deep setup. I read the book of postfix, try to setup but I still cannot receive emails, I want to setup this with dovecot but that is other history. Right now I test with telnet and everything works, I see that I can login with a user and send a test mail with telnet, but I check the user directory that supposes that will receive the mail but I don't see any new email. Telnet: [root@mail log]# telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.XXX.dyndns.org ESMTP Postfix (2.3.3) mail from:<user1@XXX.dyndns.org> 250 2.1.0 Ok rcpt to:<user1@XXX.dyndns.org> 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> Hi. . 250 2.0.0 Ok: queued as 52B5A18FA09 quit 221 2.0.0 Bye Connection closed by foreign host. The queue is empty. This is my current settings on main.cf, is the only setup I had touch of postfix. ********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 I don't want to use virtual users, I want to use the real /home folder for each user, because this is a domain with PDC+LDAP. Reading about I see that the only way to achieve this is to setup a procmailrc file inside /etc, this way will be a global setup, this is my procmailrc file: ****procmailrc****** MAILDIR=$HOME/Maildir DEFAULT=$HOME/Maildir LOGFILE=$HOME/pm.log VERBOSE=on TMP=/tmp Dovecot is not yet ready, I don't this for test right? I even increase the debug level in postfix as u can see, because it looks like postfix is sending the test mail but the users Mailbox is empty. The log is to large, but this is a part of it: 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 The procmail log: 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 One of the message I have at his folder: 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. Why I cannot receive my test emails, did I forget something? Here it suppose that I must see some new files inside the user Maildir/new? My Centos box is authenticated vs ldap, do I need to setup postfix to authenticated to? Using Centos 5.4 and all the from the repositories. Thanks. |
Postfix is the best mailer, imho.
Search for a config, and switch off all the fancy stuff to get started. I used the ones on the linuxfromscratch.org site. Write and Save an email to yourself. you can send it (Years since I did this) by cat email > 127.0.0.1:25 I ran into this difficulty. My isp was not catering for separate servers on it's connections (What's Linux? We DO NOT support linux. To which the reply is: "You're running linux yourselves!"). So my home domain was no good. The answer was to make postfix announce itself as _their_ network. Then it worked - I was one of their boxen on their network - all seemed good, and mail flowed. Try lying as follows: myhostname = mail.myisp.net mydomain = myisp.net myorigin = $mydomain To test you are getting out, simply log onto www.10minutemail.com, which gives an address, and bang that address into the test email and get it out inside 10 minutes. Send from a mail client, or cat it at port 25. Beware also that mailboxes and maildirs have to be set 0600 or programs don't like them. |
business_kid thanks.
After your comment about starting with a basic setup I finally found my issue. The line: mailbox_command = /usr/bin/procmail Was my issue, after I comment again this line my system start reciving and sending emails. I even remove the procmailrc file from /etc I don't need this. Thanks again. |
All times are GMT -5. The time now is 12:45 AM. |