Operating System - Linux
1821827 Members
3384 Online
109638 Solutions
New Discussion юеВ

Re: dovecot failed to start

 
SOLVED
Go to solution
Maaz
Valued Contributor

dovecot failed to start

Everything is default in dovecot.conf, and I did the following:
/etc/dovecot.conf
protocols = imap imaps pop3 pop3s

#service dovecot start
#service dovecot status
dovecot (pid 2411) is running...

Then I descide not to use the default(bogus) certificate, and use my own
certificate, I did the following

#cd /usr/share/ssl/certs
#mv dovecot.pem dovecot.pem.orig
#make dovecot.pem

umask 77 ; \
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
/usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365
-out $PEM2 ; \
cat $PEM1 > dovecot.pem ; \
echo "" >> dovecot.pem ; \
cat $PEM2 >> dovecot.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
..........++++++
................++++++
writing new private key to '/tmp/openssl.Vy2497'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:GB
State or Province Name (full name) [Berkshire]:Berkshire
Locality Name (eg, city) [Newbury]:Newbury
Organization Name (eg, company) [My Company Ltd]:Me & My
Organizational Unit Name (eg, section) []:Lab
Common Name (eg, your name or your server's hostname) []:imapop.test.com
Email Address []:root@test.com


service dovecot start
Starting Dovecot Imap: [ OK ]

service dovecot stop
Stopping Dovecot Imap: [FAILED]

service dovecot status
dovecot dead but subsys locked

tail -f /var/log/messages
Apr 23 21:43:20 mail dovecot: dovecot startup succeeded
Apr 23 21:43:24 mail dovecot: dovecot shutdown failed

Then i did the following and once again dovecot starts working
#rm dovecot.pem
#mv dovecot.pem.orig dovecot.pem
service dovecot start
Starting Dovecot Imap:
service dovecot status
dovecot (pid 2743) is running...

Also attaching the dovecot.conf

Any Help will be highly appreciated
Regards
Maaz
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: dovecot failed to start

Shalom Maaz,

Check that dovecot is not already running.

ps -ef | grep -i dovecot

ps -ef | grep cyrus

You may have another service interfering with dovecot

netstat -an | grep ":143 "

See if something else is listening on port 143.

service iptables status.

Shut down iptables and see if you get better results if its running.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor
Solution

Re: dovecot failed to start

Can you post the information in /var/log/messages and /var/log/maillog when you run service dovecot start|stop?

After you do the start, the service keeps running? check with service dovecot status.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: dovecot failed to start

Dear SEP and Ivan Ferriera Many thanks for the reply/help.

Simple ... when I use the default(bogus) "dovecot.pem" dovecot works just fine.
But when I create my own "dovecot.pem" by doing the following:
#cd /usr/share/ssl/certs
#mv dovecot.pem dovecot.pem.orig
#make dovecot.pem

And then

#service dovecot start|restart
Starting Dovecot Imap: [ OK ]
#service dovecot status
dovecot dead but subsys locked

service dovecot stop
Stopping Dovecot Imap: [FAILED]

Dovecot doesnt start

iptables is stop.

if some other service is interfering with dovecot, then dovecot should also refuse to work when I use the default "dovecot.pem" file. dovecot Only doesnt works when I use my own certificate.

Thanks n Regards
Maaz
Steven E. Protter
Exalted Contributor

Re: dovecot failed to start

Shalom Maaz,

You are not using the right procedure to create the file. Put the default back, get a procedure form dovecot then it will work.

Here is a possible procedure that might work:
http://voxx.demon.co.uk/linux/linuxd.php?filename=00000050.txt

Please post back what works, I have to do the same thing.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: dovecot failed to start

This procedure is a bit better.

The install script generates a good pem file though.

http://applications.linux.com/article.pl?sid=06/03/28/1919226

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor

Re: dovecot failed to start

You did not posted the log files. I have tested and in the dovecot doc dir, /usr/share/dovecot-version/examples, there is a script called mkcert.sh. I used this to generate a new certificate and the service start just fine. Try using that script.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: dovecot failed to start

Dear SEP whats cyrus ?

and Dear Ivan Ferriera, I have solved the prblm from the guidence of ur post, I my self check the /var/log/maillog, and maillog tells the actuall reason
I have attached the maillog

in /etc/dovecot.conf

Before(when prblm)
#ssl_cert_file = /usr/share/ssl/certs/dovecot.pem
#ssl_key_file = /usr/share/ssl/private/dovecot.pem

Solution/After
ssl_cert_file = /usr/share/ssl/certs/dovecot.pem
ssl_key_file = /usr/share/ssl/certs/dovecot.pem

That is I uncoment the ssl_cert_file and ssl_key_file lines, and provide the same path of ssl_key_file as of ssl_cert_file.
;)
Regards
Maaz
Maaz
Valued Contributor

Re: dovecot failed to start

sory I forget to attached the maillog