"-ERR chdir doamin.com/user/ failed" - Postfix, Courier And MySQL

Discussion in 'HOWTO-Related Questions' started by jasonwashere, Apr 13, 2008.

  1. jasonwashere

    jasonwashere New Member

    Well ehlo to all that read this. I have been working on getting the HowtoForge setup @ http://howtoforge.com/virtual-users-and-domains-postfix-courier-mysql-fedora8
    up and going and am pretty close but still not able to get it working.

    Like the title suggests I am getting the error "-ERR chdir doamin.com/user/ failed" with the domain.com/user being the domain name and user name I am trying to login with when I make a pop3 connection to the server.

    I have read thru some of the other articles relating to this error seeing that the main problem people are having is that they need to send an email to the user first to create the files/dir for the pop locker. I have done this a couple dozen times now and still do not get the email or a bounce or anything, the message disappears into the great unknown bit bucket.

    So I dug thru the logs to try and see what was going on and it looks to me like, don't know if I'm right or not, that the emails are not getting past ClamAV
    making it so the 1st email never shows up creating the mail directory for that user.

    I came to this conclusion based on the following output from /var/log/maillog
    ---------------------------------------------------------------------

    Apr 13 15:32:33 server1 postfix/smtp[2838]: 621C3F0172: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3302, delays=3295/0.02/0.01/7.8, ds
    n=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451-4.5.0 Error in processing, id=02631-06, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED
    : ClamAV-clamd av-scanner FAILED: CODE(0x91d75ac) Too many retries to talk to /var/spool/amavisd/clamd.sock (Can't connect to UNIX socket /var/spool/amavisd/c
    lamd.sock: No such file or directory) at (eval 57) line 310. at (eval 57) line 511.; ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan unexpected exit 50,
    output="LibClamAV Warning: ************************************************** 451-4.5.0 LibClamAV Warning: *** The virus database is older than 7 days! ***
    451-4.5.0 LibClamAV Warning: *** Please update it as soon as possible. *** 451-4.5.0 LibClamAV Warning: *************************************************
    * 451-4.5.0 LibClamAV Error: cli_loaddb(): No supported database files found in /var/lib/clamav/main.inc 451 4.5.0 ERROR: Not supported data format" at (eval
    57) line 511. (in reply to end of DATA command))

    ------------------------------------------------------------------
    where to=<[email protected]> in the above is the account I'm logging in as not actually [email protected].

    I see there is two problems here:
    /var/spool/amavisd/clamd.sock: No such file or directory &
    No supported database files found in /var/lib/clamav/main.inc

    I'm not to sure what to do at this point and seeing as how this is my 3rd attempt at getting a postfix server running I don't want to just go dinking around trying to get it to work so any ideas would be very much appreciated.

    Thanks,
    - Jason
     
  2. jasonwashere

    jasonwashere New Member

    Update

    Despite the fact I said I did not want to tinker around with this anymore with out having a better idea of what I was doing I could not resist...again. Guess thats why I like Linux.:rolleyes:

    So I did some more research and found that if I comment out the line:
    $inet_socket_port = 10024; # listen on this local TCP port(s)
    found in:
    /etc/amavisd/amavisd.conf
    that the errors go away and get replaced with the error:
    status=deferred (connect to 127.0.0.1[127.0.0.1]: Connection refused
    when trying to process an incoming SMTP connection.

    Also I can't stop the service clamd.amavisd it always fails and when it starts it looks like it is starting twice after a reboot.

    The boot looks like this:
    starting clamd.amavisd: starting clamd.amvisd: [OK]
    [OK]

    I still don't really know what this means or what to do to fix this but thought the info would be helpful to anyone that might want to help out.

    Thanks,
    - Jason
     
  3. zcworld

    zcworld New Member

    i was having a problem like that

    i just try another domain

    and see if thats works

    its a pain in the ass when u done it right and its errorrs up

    try like moo.mo as an domain
    and see if its works (add it to the domain and add users to it
    send an email from that account wait 2 mins and check
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please uncomment that line again. Postfix tries to pass on emails to amavisd which is listening on port 10024. If you disable that line, emails will never get delivered.

    What's in /etc/clamd.conf?
     
  5. jasonwashere

    jasonwashere New Member

    Update Du

    Good Morning and Thanks for the replays guys.

    Hi zcworld,
    I am guessing that you are talking about creating a new domain/user account in the MySQL database MAIL with the commands


    INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('[email protected]', ENCRYPT('mypassword'), 52428800);
    INSERT INTO `domains` (`domain`) VALUES ('mydomain.tld');


    If this is right I can do this, but I'll have to forward one of my other domains to point to my IP address first, which is more of a problem that it sounds like, in the middle of some hassles with my registrar and I'm not very good with using bind to create a local domain e.g. mydoamin.local but am willing to give it a try after classes today even though I have no understand of how this would help.

    Hi Falko,
    I do not have a /etc/clamd.conf or a clamd.conf anywhere on my system for that matter! Maybe this is my problem ehh?
    I do have a /etc/clamd.d/amavisd.conf which contains the below.
    LogSyslog yes
    LogFacility LOG_MAIL
    PidFile /var/run/amavisd/clamd.pid
    FixStaleSocket yes
    User amavis
    LocalSocket /var/spool/amavisd/clamd.sock


    I have to mention that I do not have a clamd.sock file either as listed on LocalSocket above but I do have a
    /var/spool/amavisd/amavisd.sock file.

    I tried creating the clamd.sock file and making it 777 and tried adding amavisd to the clamav group and vis versa all with no results.

    I also have a /etc/freshclam.conf which looks like it needs to be configured still, has the example uncommented.

    I re-uncommented the $inet_socket_port = 10024; # listen on this local TCP port(s) line. actually every time I try something that is mentioned in this thread and it does not solve the problem I change it back to how it was to keep form making a mess. the the int_socket the clamd.sock the group membership changes and anything else thus far have been set back to how they were at the end of the HowtoForge walk-thru document.

    Thanks,
    - Jason
     
  6. jasonwashere

    jasonwashere New Member

    Fixed

    Well I got it to work finally. It seems strange to me that it works with out a calmd.sock file of a clamd.conf file but I am able to send and receive emails and it appears to be scanning them for spam and viruses, although I have not sent a test virus thru yet I see in the maillog that it is scanning them emails.

    The fix was just commenting out the example line in the /etc/freshclam.conf file.
    Makes me want to punch myself missing the vi /etc/freshclam.conf command in set 11 of the walk thru. :(

    Any case I'm glad it is working now ever though I am missing the clamd.sock and .conf which still baffles me.

    Thanks,
    - Jason
     
  7. c4rdinal

    c4rdinal New Member

    Hi,

    I had the same problem. I wonder if u fixed the problem already.

    I copied the following:
    # cp /usr/share/doc/clamav-server-0.92.1/clamd.conf /etc/clamd.d/

    so I can have clamd.conf but don't know where to go afterwards.

    I want to integrate ASSP and ClamAV on my fedora machine but can't go further.

    If you have any progress please let me know how to fix it. I had the same error.

    Thanks.
     
  8. jasonwashere

    jasonwashere New Member

    None

    Hi c4rdinal,

    Yeah the fix for me was just commenting out the Example line in the freshclam.conf file that I missed in step 11 of the walk thru. even without a clamd.sock or a clamd.conf the emails are being scanned and I sent a test virus thru and it caught it so everything seems to be working at least check.
    I have not had much time to play around with it after getting it setup, finals are coming up soon, so I'm not too sure why it is working without the these files. Don't known if I mess up in the walk thru if there is errors in the walk thru, something to do with the platform or what but it seems that you do not even need the clamd.conf or .sock files but instead the amavisd.conf and .sock files???
     

Share This Page