# [SOLVED] courier with mysql Authproblem in IMAP and SMTP

## wolf34wien

HI

I have a problem to Authentificate in IMAP and in SMTP, it works in POP3.

IMAP comes until the authentification but stops there.

With telnet I can connect to IMAP and with

login login username password

I get:

Login OK LOGIN OK

With POP3 I can contact and also retrieve e-mails.

Thanks for any help.

As I'm new to gentoo and a little out of my linux knowledge, step by step please, thanks.Last edited by wolf34wien on Tue Feb 07, 2006 9:05 pm; edited 1 time in total

----------

## wazow

 *wolf34wien wrote:*   

> I have a problem to Authentificate in IMAP and in SMTP, it works in POP3.
> 
> IMAP comes until the authentification but stops there.

 

I do not know whether this helps, but I had some problems after ugrading courier recently.  It was either me being not careful, or dispatch-conf too happy hacking on my config scripts, but suddendly courier's authdeamon started to use mysql for athentication (which was not properly configured).   I believed I had always used pam until that unlucky moment.

I just went to /etc/courier/authlib and edited authdaeomonrc. I removed authmysql and authldap from the list in authmodulelist string.  Then restarted courier-authlib and the problems were gone.

If this does not help then post the relevant fragment of /var/log/messages that is produced when you fail to authenticate.

----------

## wolf34wien

Hi, 

I guess you did not read that I want him to authenticate with a mysql database.

It works fine with pop.

To my installation:

Gentoo with genkernel (was to  lazy and did not have enough time to play with the optimal settings yet)

Iptables firewall, can open when needed or for testing (what I did.)

No good logging so far.

Installed Xampp, as I was not familar with the gentoo emerge system, only learned it now  :Smile: 

For Courier-authlib I had to emerge mysql as well. But still use the one of Xampp.

Then I emerged Courier-authlib.

In IMAP and also in SMTP I know I could at one time connect, but not any more.

When I test with testauth, he also is succesfull with POP, SMTP and IMAP also with the password.

If I try to telnet to port 25 (Smtp) I cannot connect.

XAMPP, with proftp with Mysql and apache is working nicely, also the pop3 is working nicely.

Use my own webpage to send a e-mail into the account which I retrieve later from another computer with pop. And works nicely.

Just IMAP and SMTP does not work.

Did see a hint somewhere that downgrading might help, but did not find the link again, and stupidly this would mean to emerge again, but ok, if it has to be. But perhaps somebody can come up with another suggestion.

Thanks in advance for all help.

To wazow, there are no relevant logfiles, actually I do not even have /var/log/messages  :Wink: 

So perhaps the Authentification works and the connection is lost afterwards, but what causes the problem?

----------

## wolf34wien

I just remembered that during my problems with proftp mysql authentification I changed the my.cnf file, but this should not be the problem, as the POP is still working.

Also changing back did not help either.

The mysql I emerged is 5.0.17, and with XAMPP 5.0.15 is in.

I only use the one of XAMPP, the otherone does not even want to start.

In the myconf, I set the XAMPP Mysql as Data Dir, so this might be the reason that the otherone does not start.

----------

## wolf34wien

Emerged Bash 3.1, did not help!

Also changed the Database dir to the System mysql, but mysql can still not start even if I close down the mysql from XAMPP. and making sure no instance of mysql is running.

Was then also trying to connect with pop with no Mysql running, and there it did not work to connect, so the authentification is working correct for POP3, but not for IMAP and for SMTP, so where is there the mistake? Any ideas?

----------

## wazow

 *wolf34wien wrote:*   

> Was then also trying to connect with pop with no Mysql running, and there it did not work to connect, so the authentification is working correct for POP3, but not for IMAP and for SMTP, so where is there the mistake? Any ideas?

 

Are you then sure that imap-courier is started? And that you are trying the right version/port for ssl/nonssl authentication?

----------

## wolf34wien

So I reinstalled my complete system, as I needed a repartitioning anyway. Now I did not install XAMPP, used the emerge function.

The problem with the SMTP still exists, In POP he can connect and also authenticate, did not try to receive a mail, but to that later.

In IMAP Opera (on another computer) shows connected as well.

In SMTP I cannot send a message, and he also does not show any error message in /var/log/messages.

Furthermore I have a problem with PHP and the builtin function, he does not want to deliver to one of the already created maildirs.

It did work earlier with XAMPP, but no it does not work.

Did set the sendmail-path  with "/etc/sbin/sendmail"

That could be still a wrong setting in apache, but still looking for it.

Did now also see something funny, actully not really funny, the Mailserver sometimes almost is getting stuck, and the then not even the POP is working, but after restarting the mailserver it is working again.

But restarting it all the time is annoying, any help will be appreciated.

----------

## wolf34wien

Kernel 2.6.12-r6

Apache 2.0.54

PHP 5.0.5

Mysql 5.0.18

Courier 0.48.1-r1 (WITH SMTP, IMAP POP and FAX (Setting up FAX will come later)

Courier-authlib 0.58

Just in case that it can help to fidn the problem.

----------

## wolf34wien

I have upgraded Courier to 0.50.1-r1

The Messages file is existing.

All problems still exist. Nothing did change

PLEASE HELP

----------

## wolf34wien

It is started and I have the right ports

----------

## wolf34wien

The PHP sending of the email to a local account was a wrong apache setting as suspected, now this is working.

But I still cannot connect to my SMTP PORT from outside, but I can ping it.

My ISP is not blocking it.

Must be a wrong setting in Courier.

Also sending with Telent from local to an extern e-mail address did not work error 513 Relay denied.

Any suggestions where the mistake is?

----------

## wolf34wien

Managed to solve the problem.

----------

## wazow

 *wolf34wien wrote:*   

> Managed to solve the problem.

 

Can you just briefly mention how?

----------

## wolf34wien

First of all I have more NIC in my PC, so Courier needs a subnet of 0.0.0.0 otherwise it will block everything. I have usually just set my router as gateway and my official Subnet as netmaks. But for Courier this was not enough. there are no problems in Proftp or in Apache.

The other thing was then with sending mails from an external computer, and accepting mails form other mail accounts.

Here first of all do not activate the Auth required as that will mean you want Servers also to Authenticate, what of course will be a bit of a problem. It still wil not be an open relay, as one has to set for what ip relay without Authentication is allowed. And also for what domains mail will be accepted (terminating at the server).

So everything is up and running

Next Problem, Courier Fax, and first of all mgetty and sendfax with Trust USB modem, Any help will be appreciated.

----------

