Jump to content
Froxlor Forum
  • 0

Dovecot Configuration


Stephen

Question

The instructions for the Dovecot configuration on Debian Lenny are to execute the command "/etc/init.d/dovecot restart" after creating the config files. This is the error I get:

 

~# /etc/init.d/dovecot restart
Restarting IMAP/POP3 mail server: dovecotFatal: Dovecot is already running with
PID 23997 (read from /var/run/dovecot/master.pid)
failed!
~# /etc/init.d/dovecot reload
Reloading IMAP/POP3 mail server: dovecot.
~# netstat -ntulp | grep :110
~#

Also as can be seen above there is nothing listening on port 110 where I expected dovecot to be listening. Should there be?

 

When I attempt send email to the Dovecot Server they bounce with the error message:

Sorry, I couldn't find a mail exchanger or IP address. (#5.4.4)

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

dovecot is broken on lenny (well, the initscript is), see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516845

so either use dovecot from backports or fix the line yourself as stated in the bug.

This fix worked for awhile, but not anymore. There is another problem:

 

~# /etc/init.d/dovecot restart
Restarting IMAP/POP3 mail server: dovecotFatal: Dovecot is already running with
PID 23997 (read from /var/run/dovecot/master.pid)
failed!

There is no "//" so this time it is not the extra "/" pointed out in the bug description.

Link to comment
Share on other sites

I have dovecot listening now and connections to the server using the email client are no longer being refused.

 

I had been using the command "/etc/init.d/dovecot reload" expecting this would cause dovecot to reload "dovecot.conf." The command "dovecot -n" seemed to verify it reloaded "dovecot.conf." But the ports at 110 and 143 were still not open.

 

To get them open I had to kill dovecot and restart it. It did not work to do this with "/etc/init.d/dovecot restart." In response I got the error that dovecot was already running, which means the function "do_stop()" in the script "/etc/init.d/dovecot" did not work. This was true even with the correction described at:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516845

where the extra "/" character is removed. (This correction did work for awhile. But no longer for an unknown reason.)

 

To kill and restart dovecot to get the most recent "dovecot.conf" file acted on I had to do the command sequence:

pkill dovecot
/etc/init.d/dovecot start

My problem now is dovecot is not accepting the password I enter in the email client. The error log shows there is no connection to the database:

dovecot: Apr 24 18:32:01 Error: auth-worker(default): sql(Webmaster,0.0.0.0): Password query failed: Not connected to database

(The real ip numbers removed)

Link to comment
Share on other sites

mysql doesn't seem to be running, or the connection string for the database in /etc/dovecot/dovecot-sql.conf is wrong

 

My buggy control panel put the "listen = *" directive in the third line

of dovecot.conf.

this is what upstream does (in fact its commented out in their example config, to show this is default)

see /usr/share/dovecot/dovecot.conf for the example config

 

at any rate, i fail to see why it is "buggy" now, people have been using that setup (with the said initscript change) fine

 

and just seen the other post from you on that list, try using localhost and not 127.0.0.1 in dovecot-sql.conf

this is what the config templates tell you, in fact.

Link to comment
Share on other sites

I know a lot more about dovecot now. My statement about the location of the "listen = *" directive was premature and I was wrong about it. This is in fact the correct directive in the right place. I apologize for this one. I had been going by examples I found online that did it differently. When I read the dovecot documentation I realized my error.

 

Mysql is online and functional. I know this because Pure-FTPd can access it to get username and passwords for logging in yet dovecot cannot.

 

When I try to download email my client returns the message:

Sending of password did not succeed. Mail server responded: Temporary authentication failure

 

The entry in /var/log/mail.log:

Apr 25 19:16:12 debian postfix/trivial-rewrite[12002]: warning: do not list domain jail4judges.org in BOTH virtual_alias_domains and virtual_mailbox_domains

 

The entry in the error log file set to be this in the dovecot config file:

dovecot: Apr 25 20:25:27 Error: auth-worker(default): mysql: Connect failed to 127.0.0.1 (froxlor): Access denied for user 'froxlor'@'localhost' (using password: YES) - waiting for 1 seconds before retry

 

The connection string in etc/dovecot/dovecot-sql.conf:

driver = mysql
connect = host=127.0.0.1 dbname=froxlor user=froxlor password=<>
default_pass_scheme = CRYPT
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid,  CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE username = '%u' OR email = '%u'
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('maildir:storage=', (quota*1024)) as quota FROM mail_users WHERE username = '%u' OR email = '%u'

Where the actual password has been removed for posting here and <> put in its place.

 

I have yet to figure out why it is not connecting.

 

In regard to the other post about 127.0.0.1, every time I click on "Rebuild Config Files" in Froxlor 9.5 I have to run this BASH script I wrote or my site goes offline when "froxlor_bind.conf" is next loaded:

#!/bin/bash
sed -i 's/ns1.example.com/127.0.0.1/' /etc/bind/froxlor_bind.conf
sed -i 's/ns2.example.com/127.0.0.2/' /etc/bind/froxlor_bind.conf
/etc/init.d/bind9 reload

Where my actual domain name has been substituted for "example.com"

Link to comment
Share on other sites

I have dovecot listening now. The problem was illegal characters in the password for MySQL access in the configuration files. I had decided to strengthen the password with non alphanumeric characters and one of them was #. This caused it to fail to connect due to a conflict with bash. It would help if there were warnings in froxlor about the limitations on characters that can be used in the MySQL passwords.

 

My email client can connect now. But my next problem is there is never any mail to download because the emails are bouncing. There is a warning in syslog that may be a clue as to why. I have described it in the "Dovecot Configuration" thread I have started.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...