Postfix: Unable to send emails.

Discussion in 'Installation/Configuration' started by sammd006, Feb 10, 2011.

  1. sammd006

    sammd006 New Member

    Hi,

    I have followed Falko's tutorial below:
    http://www.howtoforge.com/virtual-u...urier-mysql-and-squirrelmail-fedora-14-x86_64
    Somehow I am missing something as my postfix is unable to send e-mails. I went through the howto many times but I am unable to find what is causing the problem.

    When I try to send an email from terminal I am getting the below error:
    451 4.3.0 <[email protected]>: Temporary lookup failure
    where example is just replace by the real e-mail address I am testing with.

    From logs i managed to find also some errors:
    Feb 10 19:26:28 example postfix/smtpd[10798]: connect from example.homelinux.com[127.0.0.1]
    Feb 10 19:27:05 example postfix/smtpd[10798]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)
    Feb 10 19:27:05 example postfix/smtpd[10798]: NOQUEUE: reject: RCPT from example.homelinux.com[127.0.0.1]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<root@localhost> to=<[email protected]> proto=ESMTP helo=<localhost>
    Feb 10 19:27:15 example postfix/cleanup[10806]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)
    Feb 10 19:27:15 example postfix/cleanup[10806]: warning: 1D86D9AC7AE: virtual_alias_maps map lookup problem for [email protected]
    Feb 10 19:27:15 example postfix/smtpd[10798]: disconnect from example.homelinux.com[127.0.0.1]
    Feb 10 19:30:12 example clamd[1332]: SelfCheck: Database status OK.

    I removed my real domain name with the name example....

    I really would appreciate any suggestions! Thanks everyone for looking!
    regards,
    sammd006
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Please make sure you have the correct MySQL details in your /etc/postfix/mysql*.cf files.

    Also make sure that your network connection is working and that you have valid nameservers in /etc/resolv.conf.
     
  3. sammd006

    sammd006 New Member

    Hi Falko,

    For /etc/postfix/mysql*.cf:
    Username / password are the same of the user i created for my mail DB.

    Below is what I have in my => /etc/resolv.conf :

    search homelinux.com
    nameserver 192.168.2.1 <= my private ip default gateway

    Is something missing?
    regards,
    sammd006
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you try
    Code:
    nameserver 8.8.8.8 
    as the first nameserver in /etc/resolv.conf and see if that changes anything?
     
  5. sammd006

    sammd006 New Member

    Hi Falko,

    I did the change as you have sugested but still I am having the Temporary lookup failure in my logs. :(

    regards,
    sammd006
     
  6. falko

    falko Super Moderator Howtoforge Staff

    There seems to be something wrong with your MySQL settings. Can you take the user and password from the mysql*.cf files and log into MySQL on the shell?

    Code:
    mysql -u [I]username[/I] -p
     
  7. sammd006

    sammd006 New Member

    Hi Falko,

    I do not think although from log files there seems to be some warnings which are not clear to me too.

    I tried from terminal as you suggested and managed to log into the DB with username and password from my mysql*.cf files.

    I am missing something somewhere :(... May I ask if I can send you my mail.cf conf file pm and you take a look maybe I have some missing entries?

    Regards,
    sammd006
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Does the password contain any special characters?
     
  9. sammd006

    sammd006 New Member

    Hi Falko,

    No it does not contain any special characters...

    regards,
    sammd006
     
  10. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ?
     
  11. sammd006

    sammd006 New Member

    Hi Falko,

    Output for netstat - tap:


    [root]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 example.homelinux:smux *:* LISTEN 1169/snmpd
    tcp 0 0 example.homelinu:10024 *:* LISTEN 1353/amavisd (maste
    tcp 0 0 example.homelinu:10025 *:* LISTEN 1462/master
    tcp 0 0 *:33577 *:* LISTEN 1000/rpc.statd
    tcp 0 0 *:mysql *:* LISTEN 1303/mysqld
    tcp 0 0 *:sunrpc *:* LISTEN 921/rpcbind
    tcp 0 0 *:ftp *:* LISTEN 1498/pure-ftpd (SER
    tcp 0 0 *:ssh *:* LISTEN 1178/sshd
    tcp 0 0 example.homelinux.:ipp *:* LISTEN 1054/cupsd
    tcp 0 0 *:smtp *:* LISTEN 1462/master
    tcp 1 0 example.homelinu:52014 x.x.x.x:http CLOSE_WAIT 1920/clock-applet
    tcp 0 524 example.homelinux.:ssh x.x.x.x:30718 ESTABLISHED 15836/1
    tcp 0 0 *:imaps *:* LISTEN 1373/couriertcpd
    tcp 0 0 *:pop3s *:* LISTEN 1385/couriertcpd
    tcp 0 0 *:netbios-ssn *:* LISTEN 1516/smbd
    tcp 0 0 *:vnc-server *:* LISTEN 1882/vino-server
    tcp 0 0 *:pop3 *:* LISTEN 1379/couriertcpd
    tcp 0 0 *:imap *:* LISTEN 1366/couriertcpd
    tcp 0 0 *:sunrpc *:* LISTEN 921/rpcbind
    tcp 0 0 *:http *:* LISTEN 1490/httpd
    tcp 0 0 *:ftp *:* LISTEN 1498/pure-ftpd (SER
    tcp 0 0 *:ssh *:* LISTEN 1178/sshd
    tcp 0 0 example.homelinux.:ipp *:* LISTEN 1054/cupsd
    tcp 0 0 *:41113 *:* LISTEN 1000/rpc.statd
    tcp 0 0 *:https *:* LISTEN 1490/httpd
    tcp 0 0 *:microsoft-ds *:* LISTEN 1516/smbd

    PS: some outputs are edited to hide from original names such as example is replacing real name and x.x.x.x are replacing some real public IP addresses.

    I would really like to thank you for your time in trying to help me figure out my problem!

    regards,
    sammd006
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Hm, MySQL is running, so that's not the problem.

    Are you absolutely sure that you can log in using
    Code:
    mysql -u postfix -p
    on the shell?
     
  13. sammd006

    sammd006 New Member

    Hi Falko,

    I am 100% sure I can log in into my postfix database. Both from shell and from my myphpadmin link.

    Although from logs I can't understand why I am having errors stating that postfix@localhost is trying to connect with my db since I do not have postfix as a username but is named with different username as per below:

    Feb 17 23:34:21 example postfix/cleanup[32081]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)


    Regards,
    sammd006
     
    Last edited: Feb 17, 2011
  14. falko

    falko Super Moderator Howtoforge Staff

    Do you have the username postfix somewhere in your configuration files in the /etc/postfix/ directory?
     
  15. sammd006

    sammd006 New Member

    Hi Falko,

    No I do not have any username named postfix. My username is named different from my /etc/postfix configuration files.

    From logs, I cannot seem to find any authentication trials with my db from my configured user. :(

    regards,
    sammd006
     
  16. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    cd /etc/postfix/
    grep -R postfix *
    ?
     
  17. sammd006

    sammd006 New Member

    Hi Falko,
    Below is my output:
    [root@ postfix]# grep -R postfix *
    access:# postmap /etc/postfix/access
    access:# postmap -q "string" /etc/postfix/access
    access:# postmap -q - /etc/postfix/access <inputfile
    access:# "postmap /etc/postfix/access" to rebuild an indexed file
    access:# /etc/postfix/main.cf:
    access:# check_client_access hash:/etc/postfix/access
    access:# /etc/postfix/access:
    access:# Execute the command "postmap /etc/postfix/access" after
    canonical:# postmap /etc/postfix/canonical
    canonical:# postmap -q "string" /etc/postfix/canonical
    canonical:# postmap -q - /etc/postfix/canonical <inputfile
    canonical:# "postmap /etc/postfix/canonical" to rebuild an indexed
    generic:# postmap /etc/postfix/generic
    generic:# postmap -q "string" /etc/postfix/generic
    generic:# postmap -q - /etc/postfix/generic <inputfile
    generic:# "postmap /etc/postfix/generic" to rebuild an indexed file
    generic:# /etc/postfix/main.cf:
    generic:# smtp_generic_maps = hash:/etc/postfix/generic
    generic:# /etc/postfix/generic:
    generic:# Execute the command "postmap /etc/postfix/generic" when-
    header_checks:# header_checks = pcre:/etc/postfix/header_checks
    header_checks:# mime_header_checks = pcre:/etc/postfix/mime_header_checks
    header_checks:# nested_header_checks = pcre:/etc/postfix/nested_header_checks
    header_checks:# body_checks = pcre:/etc/postfix/body_checks
    header_checks:# postmap -q "string" pcre:/etc/postfix/filename
    header_checks:# postmap -q - pcre:/etc/postfix/filename <inputfile
    header_checks:# /etc/postfix/main.cf:
    header_checks:# header_checks = pcre:/etc/postfix/header_checks.pcre
    header_checks:# /etc/postfix/header_checks.pcre:
    header_checks:# /etc/postfix/main.cf:
    header_checks:# body_checks = regexp:/etc/postfix/body_checks
    header_checks:# /etc/postfix/body_checks:
    main.cf:# http://www.postfix.org/.
    main.cf:queue_directory = /var/spool/postfix
    main.cf:daemon_directory = /usr/libexec/postfix
    main.cf:data_directory = /var/lib/postfix
    main.cf:mail_owner = postfix
    main.cf:#mynetworks = hash:/etc/postfix/network_table
    main.cf:#relay_recipient_maps = hash:/etc/postfix/relay_recipients
    main.cf:# "postfix reload" to eliminate the delay.
    main.cf:#header_checks = regexp:/etc/postfix/header_checks
    main.cf:sendmail_path = /usr/sbin/sendmail.postfix
    main.cf:newaliases_path = /usr/bin/newaliases.postfix
    main.cf:mailq_path = /usr/bin/mailq.postfix
    main.cf:sample_directory = /usr/share/doc/postfix-2.7.0/samples
    main.cf:readme_directory = /usr/share/doc/postfix-2.7.0/README_FILES
    main.cf:virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    main.cf:virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    main.cf:virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    main.cf:smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    main.cf:smtpd_tls_key_file = /etc/postfix/smtpd.key
    main.cf:transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    main.cf:virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    master.cf:# Do not forget to execute "postfix reload" after editing this file.
    master.cf:# flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
    relocated:# postmap /etc/postfix/relocated
    relocated:# "postmap /etc/postfix/relocated" to rebuild an indexed
    transport:# postmap /etc/postfix/transport
    transport:# postmap -q "string" /etc/postfix/transport
    transport:# postmap -q - /etc/postfix/transport <inputfile
    transport:# "postmap /etc/postfix/transport" to rebuild an indexed
    virtual:# postmap /etc/postfix/virtual
    virtual:# postmap -q "string" /etc/postfix/virtual
    virtual:# postmap -q - /etc/postfix/virtual <inputfile
    virtual:# "postmap /etc/postfix/virtual" to rebuild an indexed file
    virtual:# /etc/postfix/main.cf:
    virtual:# virtual_alias_maps = hash:/etc/postfix/virtual
    virtual:# /etc/postfix/virtual:
    virtual:# details and for default values. Use the "postfix reload"
    [root@ postfix]#

    regards,
    sammd006
     
  18. falko

    falko Super Moderator Howtoforge Staff

    Hm, that looks ok. I have no idea why you have this problem... :confused:
     

Share This Page