2011-11-29 82 views
4

我正在構建一個Web服務器來託管多個網站。除了郵件服務器,我得到了所有的工作。我使用linode來託管我的vps,我一直在關注他們的教程。僅供參考,我使用的是Ubuntu 11.10。如何啓動dovecot?

這是我一直在關注的鏈接http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.04-lucid。我起牀到它告訴我重新啓動dovecot的部分,所以我嘗試了「service dovecot restart」。但後來我得到這個「重啓:未知的實例:」。我以root身份登錄,所以我沒有使用sudo。

由於沒有工作,我嘗試「/etc/init.d/dovecot restart」,我得到「dovecot啓動/運行,進程4760」。所以我嘗試「/etc/init.d/dovecot status」,然後得到「dovecot stop/waiting」。

所以我嘗試「服務dovecot開始」,我得到「dovecot啓動/運行,進程4781」。所以我試圖獲得狀態,所以我累了「服務鴿舍狀態」,並得到「鴿舍停止/等待」

然後,我累「/etc/init.d/dovecot start」,我得到「dovecot啓動/運行,過程4794「。所以我厭倦了獲得狀態,所以我厭倦了「/etc/init.d/dovecot status」並且得到了「dovecot stop/waiting」

只是爲了踢腿和咯咯我累死了過程,我用了PID我得到了當我做「服務dovecot開始」,這是命令「kill -9 4444」,我得到這個「bash:kill:(4805) - 沒有這樣的進程」

我做錯了什麼?

--edit 1--

以下是在/ 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 

- 編輯2(在/ etc/dovecot的/ dovecot的。 CONF) -

以下是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 = [email protected][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

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 
+0

我跟着同一個教程,我有同樣的問題,你有沒有找到一個解決方案? – Allisone

+0

但我也想知道...在教程中,他們提到了dovecot-sql.conf,但只有一個dovecot-sql.conf.ext(這是一個示例文件還是放置配置行的新位置?) – Allisone

+0

這是怎麼回事?與編程? – tink

回答

3

這意味着它開始,試圖解析配置和失敗。在/ var/log中查找累積dovecot日誌記錄的日誌,以確定問題所在。它的日誌取決於你正在使用的Linux發行版。

- 編輯 -

狀態89意味着有在配置錯誤,涉及到語法分析器。請首先看看你是否已經終止了所有{}捲曲護腕。這將是我的第一個預感。

+0

我正在運行Ubuntu 11.10。日誌太大了,所以我添加了它的原始文章。 – samwell

+0

@ chudapati09:看我的編輯。 – favoretti

+0

我在原帖中添加了我的conf文件,它又太大了。從我所能看到的,我已經擁有了所有的括號。 – samwell

0

該教程是從5月9日,2010年
看着dovecots的changelog你看...
v1.2.6 2009-10-05最後dovecot的版本日期
v2.0.rc1 2010-07-02之前下的dovecot版本日期

所以後教程可能會使用1.x配置,而現在我們將使用dovecot 2.x.

現在我發現了這個http://wiki2.dovecot.org/Upgrading/2.0
除了其他一些信息,它提供了一種將配置從1.2轉換爲2.0的方法。

這裏有更多有關升級http://wiki2.dovecot.org/Upgrading

我沒有辦法,但(還)

編輯:(解決方案)

首先,你還需要安裝:

apt-get install dovecot-sieve 
apt-get install dovecot-managesieved 
apt-get install dovecot-mysql 

如果您願意,請閱讀升級舊版1.x配置的提示 http://wiki2.dovecot.org/Upgrading

我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 
} 

我的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'; 

還可以編輯/etc/postfix/master.cf所以它包括SMTPS(SMTP使用SSL/TLS 465) 。我必須激活它才能到達我家的smtp,因爲端口25被阻止從我的isp(這很常見)。另外我更喜歡傳輸層安全性的smtp。

smtps  inet n  -  -  -  -  smtpd 

和運行service postfix restart


來源:
我收集了這一切的相關信息通過谷歌搜索,不知道我是無處不在,但最後問題

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. 

我解讀了一些http://workaround.org/ispmail/lenny/configure-dovecot
基本上,我發現當你谷歌任何錯誤輸出,你到這裏來,你得到了良好的效果:

/home/vmail/dovecot-deliver.log 
/var/log/mail.log 
/var/log/mail.err 
/var/log/syslog 
18

作爲一般的提示,請嘗試直接在前臺運行的dovecot:

dovecot的-F

原因是前臺經常會直接向控制檯輸出loadup錯誤消息,這通常會讓您快速追蹤通常不會記錄的錯誤(如配置解析錯誤)。

+1

達夫科特只會死,不會在日誌中顯示任何東西,它幾乎讓我瘋狂!這個簡單的竅門讓它向控制檯吐出一個拼寫錯誤的證書路徑錯誤。 – Jujuba

+2

Upstart使用-F選項IIRC,所以你可以檢查/var/log/upstart/dovecot.log的內容 – CameronNemo

+1

這和@CameronNemo的評論對我來說很重要。它有助於查明出現問題的特定配置文件。謝謝。 – SidewaysGravity

-2

嘗試刪除dovecot的,後綴包和/etc/dovecot/conf.d/99-*.conf文件 它`我

0

幫助如果出現在系統日誌沒有相關的消息和Dovecot運行在Upstart下,配置錯誤可能在/var/log/upstart/dovecot.log中找到。

All credit to comment by CameronNemo