Linux 如何开始鸽舍?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8319151/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to start dovecot?
提问by samwell
I'm building a web server to host multiple websites. I got everything working except the mail server. I'm using linode to host my vps and I've been following their tutorials. FYI, I'm using Ubuntu 11.10.
我正在构建一个 Web 服务器来托管多个网站。除了邮件服务器,我一切正常。我正在使用 linode 来托管我的 vps,我一直在关注他们的教程。仅供参考,我使用的是 Ubuntu 11.10。
Here is the link I've been following, http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid. I got up to the part where it tells me to restart dovecot, so I tried "service dovecot restart". But then I get this "restart: Unknown instance:". I'm logged in as root, so I'm not using sudo.
这是我一直在关注的链接,http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid。我到达了它告诉我重新启动 dovecot 的部分,所以我尝试了“service dovecot restart”。但是后来我得到了这个“重启:未知实例:”。我以 root 身份登录,所以我没有使用 sudo。
Since that didn't work I tried "/etc/init.d/dovecot restart" and I get "dovecot start/running, process 4760". So I try "/etc/init.d/dovecot status" and I get "dovecot stop/waiting".
由于那不起作用,我尝试了“/etc/init.d/dovecot restart”,然后得到“dovecot start/running, process 4760”。所以我尝试“/etc/init.d/dovecot status”,然后得到“dovecot stop/waiting”。
So I tried "service dovecot start" and I get "dovecot start/running, process 4781". So I tried to get the status, so I tired "service dovecot status" and got "dovecot stop/waiting"
所以我尝试了“service dovecot start”,得到“dovecot start/running, process 4781”。所以我试图获得状态,所以我厌倦了“service dovecot status”并得到“dovecot stop/waiting”
Then I tired "/etc/init.d/dovecot start" and I get "dovecot start/running, process 4794". So I tired to get the status, so I tired "/etc/init.d/dovecot status" and got "dovecot stop/waiting"
然后我累了“/etc/init.d/dovecot start”,我得到“dovecot start/running, process 4794”。所以我厌倦了获取状态,所以我厌倦了“/etc/init.d/dovecot status”并得到“dovecot stop/waiting”
Just for kicks and giggles I tired to kill the process, I used the PID that I got when I did "service dovecot start", this was the command "kill -9 4444" and I get this "bash: kill: (4805) - No such process"
只是为了踢球和咯咯笑我厌倦了杀死进程,我使用了我在执行“service dovecot start”时得到的PID,这是命令“kill -9 4444”,我得到了这个“bash:kill:(4805) - 没有这样的过程”
Am I doing something wrong?
难道我做错了什么?
--EDIT 1--
--编辑1--
The following are logs that were found in /var/log/syslog that involved dovecot
以下是在 /var/log/syslog 中发现的涉及 dovecot 的日志
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
--Edit 2 (/etc/dovecot/dovecot.conf)--
-- 编辑 2 (/etc/dovecot/dovecot.conf)--
The following is the dovecot.conf file
以下是dovecot.conf文件
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
}
}
}
-- Edit 3 (/var/log/mail.log) --
-- 编辑 3 (/var/log/mail.log) --
The following is what is in /var/log/mail.log
以下是/var/log/mail.log中的内容
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
采纳答案by favoretti
That means it starts, tries to parse the config and fails. Look in /var/log for the log that accumulates dovecot logging to determine what the problem is. Which log it is, will depend on the Linux distro you're using.
这意味着它启动,尝试解析配置并失败。在 /var/log 中查找积累 dovecot 日志的日志以确定问题所在。它是哪个日志,将取决于您使用的 Linux 发行版。
-- EDIT --
- 编辑 -
Status 89 means there's an error in the config, related to parser. Please have a look first whether you have terminated all {} curly bracers. This would be my first hunch.
状态 89 表示配置中存在与解析器相关的错误。请先查看您是否已终止所有 {} 花括号。这将是我的第一个预感。
回答by Allisone
The tutorial is from May 9th, 2010.
Looking at dovecots changelog you see...v1.2.6 2009-10-05
The last dovecot version before that datev2.0.rc1 2010-07-02
The next dovecot version after that date
该教程是从 2010 年 5 月 9 日开始的。
查看 dovecots 更新日志,您会看到...v1.2.6 2009-10-05
该日期之前的最后一个 dovecot 版本 该日期之后v2.0.rc1 2010-07-02
的下一个 dovecot 版本
So the tutorial probably will use a 1.x configuration, while nowadays we will use dovecot 2.x.
所以本教程可能会使用 1.x 配置,而现在我们将使用 dovecot 2.x。
Now I found this http://wiki2.dovecot.org/Upgrading/2.0
Next to some other info, it provides a way to convert the config from 1.2 to 2.0.
现在我找到了这个http://wiki2.dovecot.org/Upgrading/2.0
在其他一些信息旁边,它提供了一种将配置从 1.2 转换为 2.0 的方法。
Here's even more about upgrading http://wiki2.dovecot.org/Upgrading
这里有更多关于升级http://wiki2.dovecot.org/Upgrading
I have no solution though (yet)
我没有解决办法(还)
Edit: (Solution)
编辑:(解决方案)
First of all, you need to install also:
首先,您还需要安装:
apt-get install dovecot-sieve
apt-get install dovecot-managesieved
apt-get install dovecot-mysql
if you like, read the hints on upgrading the old 1.x config http://wiki2.dovecot.org/Upgrading
如果您愿意,请阅读有关升级旧 1.x 配置的提示 http://wiki2.dovecot.org/Upgrading
My dovecot.conf:
我的 dovecot.conf:
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 = [email protected]
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
}
My dovecot-db.conf.ext
我的 dovecot-db.conf.ext
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';
Also edit your /etc/postfix/master.cf
so it includes smtps (smtp using SSL/TLS on 465). I had to activate it to reach the smtp from my home, because port 25 was blocked from my isp (it's common). Also I prefer smtp with transport layer security.
还要编辑您的内容/etc/postfix/master.cf
,使其包括 smtps(在 465 上使用 SSL/TLS 的 smtp)。我必须激活它才能从我家访问 smtp,因为端口 25 被我的 isp 阻止(这很常见)。此外,我更喜欢具有传输层安全性的 smtp。
smtps inet n - - - - smtpd
and run service postfix restart
并运行 service postfix restart
Sources:
I've gathered all infos about this by googling, and don't know where I was everywhere, but the last problem
资料来源:
我通过谷歌搜索收集了有关此的所有信息,但不知道我在哪里,但最后一个问题
2013-01-03 16:43:27 lda: Error: userdb lookup([email protected]): Disconnected unexpectedly
2013-01-03 16:43:27 lda: Fatal: Internal error occurred. Refer to server log for more information.
I solved reading some of http://workaround.org/ispmail/lenny/configure-dovecot
Basically, I found that you get good results when you google whatever error output you get in here:
我解决了阅读http://workaround.org/ispmail/lenny/configure-dovecot 的一些问题
基本上,我发现当你用谷歌搜索你在这里得到的任何错误输出时,你会得到很好的结果:
/home/vmail/dovecot-deliver.log
/var/log/mail.log
/var/log/mail.err
/var/log/syslog
回答by Graham
As a general tip, try running dovecot directly in the foreground:
作为一般提示,尝试直接在前台运行 dovecot:
dovecot -F
鸽舍-F
The reason is the foreground will often output loadup error messages directly to the console, which will often allow you to quickly track down errors that are not usually logged (such as config parsing errors).
原因是前台经常会直接向控制台输出加载错误消息,这通常可以让您快速跟踪通常不会记录的错误(例如配置解析错误)。
回答by RouR
try to delete dovecot-postfix package and /etc/dovecot/conf.d/99-*.conf file it`s help for me
尝试删除 dovecot-postfix 包和 /etc/dovecot/conf.d/99-*.conf 文件,这对我有帮助
回答by mhsmith
If no relevant messages appear in syslog, and dovecot is running under Upstart, configuration errors may be found in /var/log/upstart/dovecot.log
.
如果syslog中没有出现相关信息,并且dovecot在Upstart下运行,可能是配置错误/var/log/upstart/dovecot.log
。
All credit to comment by CameronNemo.
全部归功于CameronNemo 的评论。