首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何启动dovecot?

如何启动dovecot?
EN

Stack Overflow用户
提问于 2011-11-30 07:19:08
回答 5查看 18.1K关注 0票数 4

我正在构建一个web服务器来托管多个网站。我把所有东西都弄好了,除了邮件服务器。我正在使用linode来托管我的vp,并且我一直在遵循他们的教程。仅供参考,我使用的是Ubuntu 11.10。

这是我一直关注的链接,http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid。我得到了它告诉我重启dovecot的部分,所以我尝试了"service dovecot restart“。但随后我得到了这个“重新启动:未知实例:”。我是以root用户身份登录的,所以我没有使用sudo。

由于这不起作用,我尝试了"/etc/init.d/dovecot restart“,得到的结果是"dovecot start/running,process 4760”。所以我尝试"/etc/init.d/dovecot status“,得到的结果是"dovecot stop/waiting”。

所以我尝试了"service dovecot start“,得到的结果是"dovecot start/running,process 4781”。所以我试着获取状态,所以我厌倦了"service dovecot status“而得到了"dovecot stop/waiting”

然后我尝试了"/etc/init.d/dovecot start“,得到的结果是"dovecot start/running,process 4794”。所以我尝试获取状态,所以我尝试了"/etc/init.d/dovecot status“,并得到了"dovecot stop/waiting”

为了好玩,我试着杀死进程,我使用了当我做"service dovecot start“时得到的PID,这是命令"kill -9 4444”,我得到这个"bash: kill:(4805) -没有这样的进程“

我做错了什么吗?

--编辑1--

以下是/var/log/syslog中包含dovecot的日志

代码语言:javascript
复制
dovecot: master: Dovecot v2.0.13 starting up (core dumps disabled)
dovecot: ssl-params: Generating SSL parameters
dovecot: ssl-params: SSL parameters regeneration completed
dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: config: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: anvil: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
kernel: init: dovecot main process (10276) terminated with status 89
kernel: init: dovecot main process (10289) terminated with status 89
kernel: init: dovecot main process (10452) terminated with status 89
kernel: init: dovecot main process (2275) terminated with status 89
kernel: init: dovecot main process (3028) terminated with status 89
kernel: init: dovecot main process (3216) terminated with status 89
kernel: init: dovecot main process (3230) terminated with status 89
kernel: init: dovecot main process (3254) terminated with status 89
kernel: init: dovecot main process (3813) terminated with status 89
kernel: init: dovecot main process (3845) terminated with status 89
kernel: init: dovecot main process (4664) terminated with status 89
kernel: init: dovecot main process (4760) terminated with status 89
kernel: init: dovecot main process (4781) terminated with status 89
kernel: init: dovecot main process (4794) terminated with status 89
kernel: init: dovecot main process (4805) terminated with status 89

--编辑2 (/etc/dovecot/dovecot.conf)--

以下是dovecot.conf文件

代码语言:javascript
复制
protocols = imap imaps pop3 pop3s
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n/Maildir

ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem

namespace private {
    separator = .
    prefix = INBOX.
    inbox = yes
}

protocol lda {
    log_path = /home/vmail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = postmaster@[mydomainname.com]
    mail_plugins = sieve
    global_script_path = /home/vmail/globalsieverc
}

protocol pop3 {
    pop3_uidl_format = %08Xu%08Xv
}

auth default {
    user = root

    passdb sql {
        args = /etc/dovecot/dovecot-sql.conf
    }

    userdb static {
        args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
    }

    socket listen {
        master {
            path = /var/run/dovecot/auth-master
            mode = 0600
            user = vmail
        }

        client {
            path = /var/spool/postfix/private/auth
            mode = 0660
            user = postfix
            group = postfix
        }
    }
}

--编辑3 (/var/log/mail.log) --

以下是/var/log/mail.log中的内容

代码语言:javascript
复制
dovecot: master: Dovecot v2.0.13 starting up (core dumps disabled)
dovecot: ssl-params: Generating SSL parameters
postfix/master[9917]: daemon started -- version 2.8.5, configuration /etc/postfix
dovecot: ssl-params: SSL parameters regeneration completed
postfix/master[9917]: terminating on signal 15
postfix/master[10196]: daemon started -- version 2.8.5, configuration /etc/postfix
dovecot: master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: config: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: anvil: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
dovecot: log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
postfix/master[2435]: daemon started -- version 2.8.5, configuration /etc/postfix
postfix/master[2435]: terminating on signal 15
postfix/master[2965]: daemon started -- version 2.8.5, configuration /etc/postfix
EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2011-11-30 07:22:27

这意味着它会启动,尝试解析配置,但失败了。在/var/log中查找累积dovecot日志记录的日志,以确定问题所在。它是什么日志,将取决于您正在使用的Linux发行版。

-编辑--

状态89表示配置中存在与解析器相关的错误。请先看看您是否已终止所有{}个花括号。这将是我的第一个预感。

票数 3
EN

Stack Overflow用户

发布于 2013-05-24 23:13:01

作为一般提示,尝试直接在前台运行dovecot:

dovecot -F

原因是前台通常会将加载错误消息直接输出到控制台,这通常会让您快速跟踪通常不会记录的错误(如配置解析错误)。

票数 21
EN

Stack Overflow用户

发布于 2013-01-03 20:52:46

本教程从2010年5月9日开始。

看看你看到的dovecots变化日志...

v1.2.6 2009-10-05该日期之前的最后一个dovecot版本

v2.0.rc1 2010-07-02该日期之后的下一个dovecot版本

因此,本教程可能会使用1.x配置,而现在我们将使用dovecot2.x。

现在我找到了这个http://wiki2.dovecot.org/Upgrading/2.0

在其他一些信息旁边,它提供了一种将配置从1.2转换到2.0的方法。

下面是关于升级http://wiki2.dovecot.org/Upgrading的更多信息

我还没有解决方案。

编辑:(解决方案)

首先,您还需要安装:

代码语言:javascript
复制
apt-get install dovecot-sieve  
apt-get install dovecot-managesieved  
apt-get install dovecot-mysql

如果您愿意,请阅读有关升级旧的1.x配置http://wiki2.dovecot.org/Upgrading的提示

我的dovecot.conf:

代码语言:javascript
复制
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n/Maildir
namespace {
  inbox = yes
  location = 
  prefix = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-master {
    mode = 0600
    user = vmail
  }
  user = root
}
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
#userdb {
#  args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
#  driver = static
#}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  log_path = /home/vmail/dovecot-deliver.log
  mail_plugins = sieve
  postmaster_address = postmaster@example.com
  plugin {
    sieve_global_path = /var/vmail/globalsieverc
    # The include extension fetches the :personal scripts from this 
    # directory. When ManageSieve is used, this is also where scripts 
    # are uploaded.

    sieve_dir = ~/sieve

    # The location of the user's active script:

    sieve = ~/.dovecot.sieve

    # Directory for :global include scripts (for v1.1 include extension)

    sieve_global_dir = /var/vmail/sieve

    sieve_maxscriptsize = 128
  }
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}

我的dovecot-db.conf.ext

代码语言:javascript
复制
driver = mysql
connect = host=127.0.0.1 dbname=mail user=mail_admin password=your_password
default_pass_scheme = PLAIN-MD5
#password_query = SELECT email as user, password FROM users WHERE email='%u';
#user_query = SELECT email as user, password, 5000 as uid, 5000 as gid, '/var/vmail/%d/%n' as home FROM view_users WHERE email='%u';
password_query = SELECT email AS user, password, 5000 AS userdb_uid, 5000 AS userdb_gid, '/var/vmail/%d/%n' AS userdb_home FROM users WHERE email = '%u';
user_query = SELECT email AS user, password, 5000 AS uid, 5000 AS gid, '/var/vmail/%d/%n' AS home FROM users WHERE email = '%u';

还要编辑您的/etc/postfix/master.cf,使其包含smtps (在465上使用SSL/TLS的smtp)。我必须激活它才能从家里访问smtp,因为我的isp阻止了端口25 (这是很常见的)。另外,我更喜欢具有传输层安全性的smtp。

代码语言:javascript
复制
smtps     inet  n       -       -       -       -       smtpd

并运行service postfix restart

来源:

我已经通过谷歌收集了所有关于这个问题的信息,我不知道我在哪里,但最后一个问题

代码语言:javascript
复制
2013-01-03 16:43:27 lda: Error: userdb lookup(info@example.com): Disconnected unexpectedly
2013-01-03 16:43:27 lda: Fatal: Internal error occurred. Refer to server log for more information.

我解决了阅读http://workaround.org/ispmail/lenny/configure-dovecot的一些问题

基本上,我发现当你搜索你在这里得到的任何错误输出时,你会得到很好的结果:

代码语言:javascript
复制
/home/vmail/dovecot-deliver.log
/var/log/mail.log
/var/log/mail.err
/var/log/syslog
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8319151

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档