3

I am attempting to set up an email server on Ubuntu Natty based on postfix and using Courier's imap interface. Emails are received into virtual mailboxes without problem and can then be retrieved and read using an imap client, but I am unable to send emails from the client. Mail.log includes numerous entries like <time> <hostname> imapd: Failed to connect to socket /tmp/fam--.

Apparently /tmp/fam-- is part of the interface to fam (or in the case of a Ubuntu server) gamin, which monitors the mailbox files allowing Courier to learn of new emails immediately. From what I am able to determine, this is related to Courier's File Alteration Monitor, which allows multiple clients to open the same folder concurrently and to receive updates to folder contents in realtime. I had hoped that setting IMAP_ENHANCEDIDLE to 0 in /etc/courier/imapd would eliminate the dependency, eliminate further /tmp/fam-- errors and allow emails to start being sent. No such luck.

Gamin is installed in the system and ps -A|grep gam finds gam_server running. Maybe there is a configuration problem, but I don't see any relevant config options, either for Courier or for Gamin.

Searching for advise on this problem, I've found several references that suggest that gamin tends to grow over time (memory leak) and needs to be killed periodically. It sounds like it introduces more trouble than it's worth and is not essential to imapd.

At this point, I am inclined to compile courier-imap without FAM dependency and replace what was installed by apt-get, but I hesitate to do so, fearing that I will open up an even larger can of worms by doing so.

Any suggestions on how to get imapd talking to gamin? Am I right to want to just drop use of gamin by imapd? Any tips, advice or cautions on recompiling courier-imapd without FAM dependency?

  • Does not answer your question. But when you are still in the process of building a mail server I would highly recommend to switch to Dovecot. It is way easier to set up, more flexible, faster on IMAP and also replaces Cyrus SASL. So you need only two applications instead of three when using SMTP-AUTH. – mailq Oct 06 '11 at 16:30
  • The advise to use Dovecot instead was the best solution for me. Although at this time (two weeks later) no answers have been proposed to the /tmp/fam-- problem, any answers that might be proposed in the future are now moot to me. I'd still welcome answers in case they are useful to someone else. – Randy McLaughlin Oct 21 '11 at 15:49
  • This question isn’t clear, the subject suggests an error with Courier yet you state you’re receiving mail fine but can’t send mail. IMAP isn’t used for sending mail, SMTP is, so that would be a Postfix misconfiguration – bodgit Sep 06 '18 at 07:49

3 Answers3

0

Actually ran into this as well and the courier error is very deceptive. In my case it was caused by the maildir root dir being set up as owned by a uid that did not have a user defined in /etc/passwd (so essentially making the issue solved by the same answer as Nexus2k in 2012).

My maildir root directory (and users' maildirs) was owned by uid=9000 and I had not created the user with useradd. Adding the user/group (with no password and shell as /bin/false) got rid of the courier errors on the mail.log, making the whole complain about famd irrelevant and confusing.

kali
  • 21
  • 4
0

I was receiving the same error, but the problem was caused by bad permissions on /etc/passwd file. Someone changed it to 600 which prevented other programs like(postfix or courier) from reading the users and groups they needed .

My fix was:

-bash-3.2# chmod 644 /etc/passwd
-bash-3.2# chmod 644 /etc/group
-1

If anybody else comes across this problem. Here's the solution:

groupadd -g 2000 vmail

useradd -u 2000 -g vmail vmail

Did the trick for me. Seems gam_server doesn't start if the user don't exists. I wasn't able to switch to dovecot because I'm loving exim4 as MTA and dovecot needs postfix.

Nexus2k
  • 107
  • 1