# imap not working(SOLVED)

## JC99

Greetings,

I am trying to install a mail server with postfix and courier-imap.

When I try and login with squirrel mail I get the following error...

 *Quote:*   

> ERROR : Connection dropped by imap-server.

 

Does anyone know what is wrong and how I can fix this.Last edited by JC99 on Wed Apr 06, 2005 4:40 pm; edited 3 times in total

----------

## kimchi_sg

Please post in the correct forum the next time. The correct place for this question is in Networking and Security.

----------

## Hayl

check in the /etc/courier-imap/imapd config file.

there are a number of setting syou can tweak in there such as the number of connections from 1 ip address, number of daemons started, timeout duration, etc.

----------

## JC99

I get the same error if I try a different imap server such as uw-imap

I fooled around with the courier config files, but I still get the same error.

----------

## wmartino

Have you tried looking here https://forums.gentoo.org/viewtopic-t-56633.html. It might help you answer your questions.

----------

## amne

Moved from IG.

----------

## JC99

Nope, that didn't help

----------

## JC99

In /var/log/messages I get the following

 *Quote:*   

> Apr  1 14:39:53 penguin imapd: Connection, ip=[::ffff:127.0.0.1]
> 
> Apr  1 14:39:53 penguin authdaemond: failed to connect to mysql server (server=mysql.example.com, userid=admin): Unknown MySQL Server Host 'mysql.example.com' (1)
> 
> Apr  1 14:39:53 penguin imapd: LOGIN FAILED, user=jay, ip=[::ffff:127.0.0.1]
> ...

 

----------

## indynet

 *Quote:*   

> Apr  1 14:39:53 penguin imapd: Connection, ip=[::ffff:127.0.0.1]
> 
> Apr  1 14:39:53 penguin authdaemond: failed to connect to mysql server (server=mysql.example.com, userid=admin): Unknown MySQL Server Host 'mysql.example.com' (1)
> 
> Apr  1 14:39:53 penguin imapd: LOGIN FAILED, user=jay, ip=[::ffff:127.0.0.1]
> ...

 

You need setup right address of your mysql server that it si used by authdaemond. Squirrel mail will be work fine as you corect setup imap server.

----------

## Mad_Jester

You need to setup authdaemon to authenticate properly.  Currently it looks like it is trying to use mysql, but you haven't configured it to point to a valid mysql server with correct credentials.  If you have a mysql server setup with user information then change the authdaemon config to point to it.  If you don't then you need to change the authdaemon to authenticate via another source, like local accounts.

----------

## JC99

How do I do that, I don't want to use mysql.

----------

## indynet

 *EvilEye wrote:*   

> How do I do that, I don't want to use mysql.

 

If you would like use local accounts, you should modify authdaemondrc to look

```
/etc/courier-imap/authdaemondrc

authmodulelist="authpam"
```

than look also to

```
 /etc/pam.d/imap

# PAM setup for

auth       required     pam_nologin.so

auth       required     pam_stack.so service=system-auth

account    required     pam_stack.so service=system-auth

session    required     pam_stack.so service=system-auth 
```

Please send us which method you would like to use to autenticate users.

----------

## JC99

I would like to use pam...I guess

----------

## JC99

Isn't there a FAQ somewhere that actually works

----------

## wmartino

Like is said earlier in this thread. Follow those instructions and you have no problems getting it up and running.

----------

## JC99

I'm having a problem with it trying to authenticate with mysql which isn't mentioned in that faq.. If I follow it exactly will it work anyways because in /var/log/messages I get the following

 *Quote:*   

> Apr  1 14:39:53 penguin imapd: Connection, ip=[::ffff:127.0.0.1]
> 
> Apr  1 14:39:53 penguin authdaemond: failed to connect to mysql server (server=mysql.example.com, userid=admin): Unknown MySQL Server Host 'mysql.example.com' (1)
> 
> Apr  1 14:39:53 penguin imapd: LOGIN FAILED, user=jay, ip=[::ffff:127.0.0.1]
> ...

 

----------

## justanothergentoofanatic

I think you're supposed to replace mysql.example.com with your actual IP or domain name.  :Shocked: 

I don't mean to get all RTFM on you, but I think you'd have a much easier time setting this stuff up if you read the relevant documentation. Aping a bunch of commands into a mysterious black box is probably not going to help your understanding very much.

-Mike

----------

## sarge

Did you ran conf.pl from squirrelmail/config ??

Its obviously needed for setting right type of imap server and connection method...

----------

## JC99

Yeah, I ran conf.pl, its set up properly, the problem is with the imap server configuration.

----------

## rex123

Your problem is that the imap server can't do authentication because it's expecting a mysql database. But you don't want to use a mysql database. And you want to use pam?

If so, you could try re-emerging courier-imap (and other courier things like authdaemon/authlib/whatever) with different USE flags. Try without mysql, for example. Or with pam.

The alternative is to fix the config files. The howto mentioned has good info on this. eg:

```

# vi /etc/courier-imap/authdaemond.conf

AUTHDAEMOND="authdaemond.plain"

```

----------

## JC99

/etc/courier-imap/authdaemondrc

/etc/courier-imap/authdaemond.conf 

niether exist

----------

## Nevermore

After looking in the /etc/init.d/courier-authlib file, I noticed that authlib is looking for:

/etc/courier/authlib/authdaemonrc

For instance, I changed mine from:

authmodulelist="authmysql authpgsql authpam authuserdb authshadow authcustom"

to

authmodulelist="authpam"

restarted courier-authlib:

/etc/init.d/courier-authlib restart

and all was well.

----------

## JC99

That did it Nevermore, thanks!!!

----------

