Can't receive mails

Discussion in 'Server Operation' started by satimis, May 8, 2009.

  1. satimis

    satimis New Member

    Hi folks,


    OpenVZ
    Guest - Ubuntu 8.04
    postfix
    mysql


    Mail server can send mails but unable to receive mails.


    # tail /var/log/mail.log
    Code:
    May  8 10:03:24 vz2 postfix/qmgr[1919]: 1181E3C8826: removed
    May  8 10:03:27 vz2 postfix/smtpd[1963]: disconnect from localhost.localdomain[127.0.0.1]
    May  8 10:05:30 vz2 postfix/smtpd[1970]: connect from web35208.mail.mud.yahoo.com[66.163.179.87]
    May  8 10:05:51 vz2 postfix/smtpd[1970]: warning: 87.179.163.66.sbl.spamhaus.org: RBL lookup error: Host or domain name not found. Name service error for name=87.179.163.66.sbl.spamhaus.org type=A: Host not found, try again
    May  8 10:05:51 vz2 postfix/smtpd[1970]: warning: connect to 127.0.0.1:60000: Connection refused
    May  8 10:05:51 vz2 postfix/smtpd[1970]: warning: problem talking to server 127.0.0.1:60000: Connection refused
    May  8 10:05:52 vz2 postfix/smtpd[1970]: warning: connect to 127.0.0.1:60000: Connection refused
    May  8 10:05:52 vz2 postfix/smtpd[1970]: warning: problem talking to server 127.0.0.1:60000: Connection refused
    May  8 10:05:52 vz2 postfix/smtpd[1970]: NOQUEUE: reject: RCPT from web35208.mail.mud.yahoo.com[66.163.179.87]: 451 4.3.5 Server configuration problem; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<web35208.mail.mud.yahoo.com>
    May  8 10:05:52 vz2 postfix/smtpd[1970]: disconnect from web35208.mail.mud.yahoo.com[66.163.179.87]
    

    # /etc/init.d/clamav-daemon start
    Code:
     * Starting ClamAV daemon clamd  
    LibClamAV Warning: ***********************************************************
    LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
    LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
    LibClamAV Warning: ***********************************************************
                                                                                [fail]
    

    # clamdscan - </etc/hosts
    Code:
    connect(): Connection refused
    WARNING: Can't connect to clamd.
    [email protected]:/# clamscan ./virtualmin-install.log 
    LibClamAV Warning: ***********************************************************
    LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
    LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
    LibClamAV Warning: ***********************************************************
    WARNING: Can't access file ./virtualmin-install.log
    ./virtualmin-install.log: No such file or directory
    
    ----------- SCAN SUMMARY -----------
    Known viruses: 548954
    Engine version: 0.94.2
    Scanned directories: 0
    Scanned files: 0
    Infected files: 0
    Data scanned: 0.00 MB
    Time: 3.114 sec (0 m 3 s)
    

    # whereis freshclam
    Code:
    freshclam: /usr/bin/freshclam /usr/share/man/man1/freshclam.1.gz
    

    # whereis clamscan
    Code:
    clamscan: /usr/bin/clamscan /usr/share/man/man1/clamscan.1.gz
    

    /# ldd `which freshclam`
    Code:
    	libclamav.so.5 => /usr/lib/libclamav.so.5 (0xb7f16000)
    	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb7f06000)
    	libgmp.so.3 => /usr/lib/libgmp.so.3 (0xb7ec1000)
    	libz.so.1 => /usr/lib/libz.so.1 (0xb7eac000)
    	libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7e99000)
    	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e81000)
    	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d32000)
    	/lib/ld-linux.so.2 (0xb7fca000)
    [email protected]:/# 
    

    Please advise where shall I check? How to fix the problem?

    TIA


    B.R.
    satimis
     
  2. topdog

    topdog Active Member HowtoForge Supporter

    What is postfix connecting to on port 60000 ? That is where your problem is.
     
  3. satimis

    satimis New Member

    Hi topdog,

    The server is behind a router. Whether you meant port 60000 has been forwarded to the server on router? It has NOT been forwarded.

    Please explain in more detail. How to check it on the server? On main.cf OR master.cf? TIA

    B.R.
    satimis
     
  4. topdog

    topdog Active Member HowtoForge Supporter

    No i do not mean port forwarding, look at your maillog postfix is trying to make a connection to a service listening on localhost 60000, it could be configured in either main.cf or master.cf
     
  5. satimis

    satimis New Member

    vz2:/# cat /etc/postfix/main.cf | grep 60000
    Code:
    smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, permit
    vz2:/# cat /etc/postfix/master.cf | grep 60000
    No printout

    satimis
     
  6. topdog

    topdog Active Member HowtoForge Supporter

    Postfix is configured to use a policy daemon on port 60000, this policy daemon is not running, because of that postfix cannot process and deliver mail. You need to start that service
     
  7. satimis

    satimis New Member

    Which service?

    Whether you meant clamav-daemon ?

    [email protected]:~$ sudo /etc/init.d/clamav-daemon start
    Code:
     * Starting ClamAV daemon clamd        
    LibClamAV Warning: ***********************************************************
    LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
    LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
    LibClamAV Warning: ***********************************************************
    LibClamAV Error: cli_calloc(): Can't allocate memory (17 bytes).
    calloc_problem: Cannot allocate memory
    LibClamAV Error: cli_loadmd5: Malformed MD5 string at line 360401
    LibClamAV Error: cli_loadmd5: Problem parsing database at line 360401
    LibClamAV Error: Can't load main.mdb: Malformed database
    LibClamAV Error: cli_tgzload: Can't load main.mdb
    LibClamAV Error: Can't load /var/lib/clamav/main.cld: Malformed database
    ERROR: Malformed database                                               [fail]
    
    I'm still searching a solution to fix it.


    satimis
     
  8. topdog

    topdog Active Member HowtoForge Supporter

    Your clamav is not working but that is not what is supposed to be listening to port 60000, a policy daemon is the one listening to that port ? How did u setup the system as you do not seem to know which components are being used ?
     
  9. satimis

    satimis New Member

    I followed following document to set up this mail server;

    http://flurdy.com/docs/postfix/index.html#editions


    satimis
     
  10. topdog

    topdog Active Member HowtoForge Supporter

    According to that link the service in question is postgrey. You need to start that service.
     
  11. danieljdoughty

    danieljdoughty New Member

    he's right, looks like that HOWTO tells you to set up postgrey on port 60000(you have to search for it as it scrolls off the side of the page) and then you set postfix to reach out to it. this is the line in the main.cf is referencing port 60000.

    s mtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000,
     
  12. satimis

    satimis New Member

    Hi topdog,

    # apt-cache policy postgrey
    Code:
    postgrey:
      Installed: (none)
      Candidate: 1.31-2
      Version table:
         1.31-2 0
            500 http://archive.ubuntu.com hardy/universe Packages
    
    Oh, sorry. I left out postgrey.

    After installing postgrey. Mails can be received.

    # tail /var/log/mail.log
    Code:
    May  8 22:58:07 vz2 postgrey: action=pass, reason=client whitelist, client_name=ti-out-0910.google.com, client_address=209.85.142.184, [email protected], [email protected] 
    May  8 22:58:07 vz2 postfix/smtpd[2455]: 22D593C8826: client=ti-out-0910.google.com[209.85.142.184]
    May  8 22:58:07 vz2 postfix/cleanup[2466]: 22D593C8826: message-id=<[email protected]>
    May  8 22:58:07 vz2 postfix/qmgr[2317]: 22D593C8826: from=<[email protected]>, size=1674, nrcpt=1 (queue active)
    May  8 22:58:07 vz2 postfix/virtual[2467]: 22D593C8826: to=<[email protected]>, relay=virtual, delay=21, delays=21/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
    May  8 22:58:07 vz2 postfix/qmgr[2317]: 22D593C8826: removed
    May  8 22:58:37 vz2 postfix/smtpd[2455]: disconnect from ti-out-0910.google.com[209.85.142.184]
    May  8 23:01:57 vz2 postfix/anvil[2456]: statistics: max connection rate 1/60s for (smtp:66.163.179.80) at May  8 22:55:46
    May  8 23:01:57 vz2 postfix/anvil[2456]: statistics: max connection count 1 for (smtp:66.163.179.80) at May  8 22:55:46
    May  8 23:01:57 vz2 postfix/anvil[2456]: statistics: max cache size 1 at May  8 22:55:46
    

    # ls /var/spool/mail/virtual/satimis/new/
    Code:
    1241823369.V15I3ce283M533587.vz2.satimis.com  1241823487.V15I3ce589M256451.vz2.satimis.com
    
    THANKS.

    # /etc/init.d/clamav-daemon start
    Code:
     * Starting ClamAV daemon clamd                                                   LibClamAV Warning: ***********************************************************
    LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
    LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
    LibClamAV Warning: ***********************************************************
    LibClamAV Error: cli_calloc(): Can't allocate memory (28 bytes).
    calloc_problem: Cannot allocate memory
    LibClamAV Error: cli_loadmd5: Problem parsing database at line 311626
    LibClamAV Error: Can't load main.mdb: Unable to allocate memory
    LibClamAV Error: cli_tgzload: Can't load main.mdb
    LibClamAV Error: Can't load /var/lib/clamav/main.cld: Malformed database
    ERROR: Malformed database
                                                                               [fail]
    
    Problem still remains. Where shall I check to fix it?


    B.R.
    satimis
     
  13. satimis

    satimis New Member

    Noted and thanks


    B.R.
    satimis
     
  14. topdog

    topdog Active Member HowtoForge Supporter

    Code:
    rm -rf /var/lib/clamav/*
    freshclam
     
  15. satimis

    satimis New Member

    [email protected]:/# ls -al /var/lib/clamav/
    Code:
    total 46404
    drwxr-xr-x  2 clamav clamav     4096 May  8 05:38 .
    drwxr-xr-x 33 root   root       4096 May  8 22:31 ..
    -rw-r--r--  1 clamav clamav  3056640 May  8 05:38 daily.cld
    -rw-r--r--  1 clamav clamav 44391424 Apr 23 03:56 main.cld
    -rw-------  1 clamav clamav      208 May  8 22:36 mirrors.dat
    

    [email protected]:/# rm -rf /var/lib/clamav/*
    No complaint

    [email protected]:/# freshclam
    Code:
    ClamAV update process started at Fri May  8 23:49:10 2009
    WARNING: Your ClamAV installation is OUTDATED!
    WARNING: Local version: 0.94.2 Recommended version: 0.95.1
    DON'T PANIC! Read http://www.clamav.net/support/faq
    main.cvd is up to date (version: 50, sigs: 500667, f-level: 38, builder: sven)
    daily.cvd is up to date (version: 9347, sigs: 49124, f-level: 42, builder: ccordes)
    
    [email protected]:/# /etc/init.d/clamav-daemon stop
    Code:
     * Stopping ClamAV daemon clamd        
                                                                         [fail]
    
    [email protected]:/# /etc/init.d/clamav-daemon start
    Code:
     * Starting ClamAV daemon clamd               
    LibClamAV Warning: ***********************************************************
    LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
    LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
    LibClamAV Warning: ***********************************************************
    LibClamAV Error: cli_realloc(): Can't re-allocate memory to 15384 bytes.
    realloc_problem: Cannot allocate memory
    LibClamAV Error: cli_ac_addpatt: Can't realloc ac_pattable
    LibClamAV Error: cli_parse_add(): Problem adding signature (3).
    LibClamAV Error: Problem parsing database at line 48390
    Segmentation fault
    
    Problem is still there

    B.R.
    satimis
     
  16. topdog

    topdog Active Member HowtoForge Supporter

    Code:
    apt-get upgrade clamav-daemon
     
  17. satimis

    satimis New Member

    I did it before without result.

    # apt-get upgrade clamav-daemon
    Code:
    Reading package lists... Done
    Building dependency tree        
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
    # aptitude dist-upgrade clamav-daemon
    Code:
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    terminate called after throwing an instance of 'std::bad_alloc'
      what():  std::bad_alloc
    Aborted
    
    satimis
     
  18. topdog

    topdog Active Member HowtoForge Supporter

    You need to run
    Code:
    apt-get update
    first
     
  19. satimis

    satimis New Member

    [email protected]:/# apt-get update
    Code:
    Hit http://archive.canonical.com hardy Release.gpg                         
    Hit http://archive.canonical.com hardy Release                             
    Ign http://archive.canonical.com hardy/partner Packages                    
    Ign http://archive.canonical.com hardy/partner Sources                     
    Hit http://archive.canonical.com hardy/partner Packages                    
    Hit http://archive.canonical.com hardy/partner Sources                     
    Hit http://security.ubuntu.com hardy-security Release.gpg                  
    Hit http://archive.ubuntu.com hardy Release.gpg
    Hit http://archive.ubuntu.com hardy-backports Release.gpg
    Hit http://security.ubuntu.com hardy-security Release
    Hit http://archive.ubuntu.com hardy Release   
    Hit http://archive.ubuntu.com hardy-backports Release               
    Hit http://security.ubuntu.com hardy-security/main Packages         
    Hit http://archive.ubuntu.com hardy/main Packages
    Hit http://archive.ubuntu.com hardy/restricted Packages
    Hit http://archive.ubuntu.com hardy/main Sources
    Hit http://security.ubuntu.com hardy-security/restricted Packages
    Hit http://security.ubuntu.com hardy-security/main Sources
    Hit http://archive.ubuntu.com hardy/restricted Sources
    Hit http://archive.ubuntu.com hardy/universe Packages
    Hit http://archive.ubuntu.com hardy/universe Sources
    Hit http://archive.ubuntu.com hardy-backports/main Packages
    Hit http://archive.ubuntu.com hardy-backports/restricted Packages
    Hit http://archive.ubuntu.com hardy-backports/universe Packages
    Hit http://archive.ubuntu.com hardy-backports/multiverse Packages
    Hit http://archive.ubuntu.com hardy-backports/main Sources
    Hit http://archive.ubuntu.com hardy-backports/restricted Sources
    Hit http://security.ubuntu.com hardy-security/restricted Sources
    Hit http://archive.ubuntu.com hardy-backports/universe Sources
    Hit http://archive.ubuntu.com hardy-backports/multiverse Sources
    Reading package lists... Done
    
    [email protected]:/# apt-get upgrade clamav-daemon
    Code:
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
    satimis
     

Share This Page