LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2010, 11:01 AM   #1
elorc
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Rep: Reputation: 0
Courier issues: no such file or directory when testing IMAP and POP


Using the following software:
  • Ubuntu Server 8.04
  • SquirrelMail 1.4.13
  • Postfix 2.5.1
  • Courier 0.59.0 (Courier-IMAP 4.3.1)
  • Apache2 2.2.8

I've installed a mail server per the instructions at http://howtoforge.com/virtual-users-...ail-ubuntu8.04. Neither POP nor IMAP test successfully with the user that I just added after following the setup instructions.

IMAP:
# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc. See COPYING for distribution information.
01 LOGIN testuser@mydomain.dom Testpassword
* BYE [ALERT] Fatal error: mydomain.com/testuser/: No such file or directory
Connection closed by foreign host.
POP:
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Hello there.
user testuser@mydomain.com
+OK Password required.
pass Testpassword
-ERR chdir mydomain.com/testuser/ failed
Connection closed by foreign host.
This doesn't make any sense. I added the user to the mysql database:

Code:
mysql> select * from users;
+------------------------+---------------+----------+
| email                  | password      | quota    |
+------------------------+---------------+----------+
| firstuser@mydomain.com | Xhjv3NJGut846 | 10485760 | 
| testuser@mydomain.com  | LKJsg57bdgjle | 10485760 | 
+------------------------+---------------+----------+
2 rows in set (0.00 sec)
And after I did that, I ran the postfix reload command. If I try to log in as firstuser@mydomain.com, which is the user I created during the setup and configuration process, it works fine.

I checked the virtual mail account's home folder, and under the mydomain.com folder, I only see a folder for firstuser. I'd create one for testuser manually, but I don't know if that'll work since it seems to contain a particular folder structure of its own.

What am I missing? Is there some other command that I have to run? I don't recall having to do anything additional when setting up firstuser.
 
Old 07-28-2010, 07:47 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
A couple of hints:
1 - look very carefully at the .cnf files you created. Look for any odd ' or ` characters as these don't translate well and any blank spaces at the end of the lines.
2 - there may be an issue with the setup (main.cf) for your virtual user mappings.
3 - What process did you use to create the first user and how does it differ from the second? You appear to be really close to having your server functional if the first user works correctly.
4 - look in your mail.log for any error messages. Sometimes they can be cryptic but any sort of error or warning is a clue that something (a configuration file usually) has a bug in it.

You may be able to turn on debugging in courier (check the documentation to see what it supports and how) which may provide more information regarding what is happening.
 
Old 07-28-2010, 08:30 PM   #3
elorc
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
The process I used to create the first user was step 13 on that guide. Specifically:
  1. Populate the domain table: INSERT INTO `domains` (`domain`) VALUES ('example.com');
  2. Add the first user to the database: INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('sales@example.com', ENCRYPT('secret'), 10485760);
  3. Skipped forwarding and transport tables.
  4. Ran command: postfix reload

That's all I did, which is exactly what I did for the second user (minus the population of the domain table since that was already done).

Postfix reload is supposed to build the folder structure for the new users, correct?
 
Old 07-29-2010, 05:19 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
If you change anything in postfix's main or master.cf postfix reload will cause it to refresh the configuration files. Since you are using virtual users, you should be able to add one via the database and not have to do anything with postfix.

Lets try this. Send a test email via the first user, the one that is working, and then attempt to send one that is not working. Next, take a loot at your log (probably /var/mail.log) and you should see about 10 lines associated with those two access attempts. Copy those lines, removing any information your not comfortable posting on the forum, such as an email address, and lets take a look at what errors you are getting.

You probably have something simple that isn't quite right, but without the error information we are only guessing as to what. Focus on sending mail first which uses the Postfix portion of the system. Next, we will look at receiving mail which involves courier.

If you would like an example of what I meant by ` back ticks and ' single quotes, look at your reply to me. Half of the entries in your lines contain ` marks which your database program will choke on as these need to be single quotes. If you got one or more of these wrong (e.g. copied and pasted text from the how to) on your second user it is possible that is the problem.
 
Old 07-29-2010, 10:12 AM   #5
elorc
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Interesting, I think I figured it out. One thing I did that I didn't mention is that I used mailx to send a test email to the first account. I did not do that with the second account.

I got the second account working by copying the first user's folder structure and removing any mail items within it. That worked. But for the hell of it, I created a third user in the MySQL table. As expected, no folder popped up. So I used mailx to send an email to it. Sure enough, the folder structure for the third user was automatically created.
 
Old 07-29-2010, 12:34 PM   #6
jamrock
Member
 
Registered: Jan 2003
Location: Kingston, Jamaica
Posts: 444

Rep: Reputation: 41
I think you need to make a distinction between users and mailboxes.

When you send mail to a Postfix server, it checks to see if the user exists. If the user does not exist, it rejects the mail.

If the user exists, it checks for the user's mailbox. If the mailbox exists, the mail is put in the relevant folder.

If the mailbox does not exist, Postfix creates it and puts the mail in the relevant folder.

When you create the user in Mysql, you are creating the user and not the user's mailbox. Sending the first mail creates the mailbox.

Courier is checking for the mailbox. Since it hasn't been created yet, it says "no such file or directory".

Last edited by jamrock; 07-29-2010 at 12:38 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squirrelmail pop/imap? issues branden_burger Linux - Networking 0 12-08-2005 06:23 AM
qmail problem. Works with courier-imap, not with pop.. rincewind Linux - Software 9 05-26-2005 08:18 AM
LDAP and Courier-IMAP issues coolamit78 Linux - Networking 1 03-16-2005 02:48 PM
Configuring courier-imap courier-pop redsky Debian 1 06-02-2004 04:09 PM
Configuring courier-imap courier-pop redsky Linux - Software 0 06-01-2004 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration