Ubuntu

Dovecot 沒有監聽 imap 和 pop3 埠

  • April 7, 2020

在我繼續之前,我在網上查看了大量關於協議未設置的文章,並嘗試了他們提供的內容,但所有這些都無濟於事,似乎也無法解決問題。

我在設置 dovecot 時遇到了一些問題。我一直在遵循本指南:http ://www.krizna.com/ubuntu/setup-mail-server-ubuntu-14-04/來設置郵件伺服器,一切正常。Postfix 已正確安裝和配置。在我進行 Dovecot 安裝時,它詢問我有關使用 telnet 連接並驗證連接是否正常工作(在指南中)以及埠:110,995,993,143是否工作。但是只有埠995993允許我連接,但它們沒有顯示任何類型的資訊:“+OK Dovecot (Ubuntu) ready。” 在他們。

我在 /var/log/mail.log 中看到了這個:

Jun 26 09:05:07 master: Info: Dovecot v2.2.9 starting up (core dumps disabled)
Jun 26 09:05:07 config: Warning: service auth { client_limit=1000 } is lower than required under max. load (6000)
Jun 26 09:05:07 config: Warning: service anvil { client_limit=1000 } is lower than required under max. load (6003)

即使我連接到993995埠。當我嘗試其他的時,我得到:

telnet: Unable to connect to remote host: Connection refused

該過程正在執行,我看不到任何錯誤。這是dovecot -n的輸出

# 2.2.9: /etc/dovecot/dovecot.conf
doveconf: Warning: service auth { client_limit=1000 } is lower than required under max. load (6000)
doveconf: Warning: service anvil { client_limit=1000 } is lower than required under max. load (6003)
# OS: Linux 3.14.32-xxxx-grs-ipv6-64 x86_64 Ubuntu 14.04.5 LTS 
auth_mechanisms = plain login
default_process_limit = 2000
first_valid_uid = 0
imap_idle_notify_interval = 4 mins
listen = * ::
log_path = /var/log/mail.log
mail_access_groups = spampd
mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
 inbox = yes
 location = 
 mailbox Archive {
   auto = subscribe
   special_use = \Archive
 }
 mailbox Drafts {
   auto = subscribe
   special_use = \Drafts
 }
 mailbox INBOX {
   auto = subscribe
 }
 mailbox Junk {
   special_use = \Junk
 }
 mailbox Sent {
   auto = subscribe
   special_use = \Sent
 }
 mailbox "Sent Messages" {
   special_use = \Sent
 }
 mailbox Spam {
   auto = subscribe
   special_use = \Junk
 }
 mailbox Trash {
   auto = subscribe
   special_use = \Trash
 }
 prefix = 
}
passdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
plugin {
 antispam_allow_append_to_spam = yes
 antispam_backend = pipe
 antispam_pipe_program = /bin/bash
 antispam_pipe_program_notspam_args = /usr/local/bin/sa-learn-pipe.sh;--ham
 antispam_pipe_program_spam_args = /usr/local/bin/sa-learn-pipe.sh;--spam
 antispam_spam_pattern_ignorecase = SPAM
 antispam_trash_pattern_ignorecase = trash;Deleted *
 fts = lucene
 fts_lucene = whitespace_chars=@.
 sieve = /home/user-data/mail/sieve/%d/%n.sieve
 sieve_after = /home/user-data/mail/sieve/global_after
 sieve_before = /etc/dovecot/sieve-spam.sieve
 sieve_before2 = /home/user-data/mail/sieve/global_before
 sieve_dir = /home/user-data/mail/sieve/%d/%n
}
postmaster_address = postmaster@mail.dannysmc.com
protocols = imap pop3 imap pop3
service auth {
 unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0666
   user = postfix
 }
}
service imap-login {
 inet_listener imap {
   port = 0
 }
}
service lmtp {
 inet_listener lmtp {
   address = 127.0.0.1
   port = 10026
 }
}
service pop3-login {
 inet_listener pop3 {
   port = 0
 }
}
ssl = required
ssl_cert = </home/user-data/ssl/ssl_certificate.pem
ssl_cipher_list = TLSv1+HIGH !SSLv2 !RC4 !aNULL !eNULL !3DES @STRENGTH
ssl_key = </home/user-data/ssl/ssl_private_key.pem
ssl_protocols = !SSLv3 !SSLv2
userdb {
 args = /etc/dovecot/dovecot-sql.conf.ext
 driver = sql
}
protocol lmtp {
 mail_plugins = " sieve"
}
protocol imap {
 mail_max_userip_connections = 20
 mail_plugins = " antispam"
}
protocol pop3 {
 mail_plugins = " antispam"
}

如果您需要更多資訊,請直接說,感謝您的幫助。因為我試圖配置這個東西已經走到了盡頭。

提前致謝。

  1. 埠 993 和 995 需要 SSL/TLS,您不能簡單地 telnet 到它們並期望以明文形式列印內容。使用類似openssl s_client -quiet -connect youdomain.tld:993openssl s_client -quiet -connect youdomain.tld:995
  2. protocols = imap pop3 imap pop3<- 為什麼要列出兩次?
  3. inet_listener imap { port = 0 }<- 您在埠 143 上禁用了 IMAP,這就是您無法遠端登錄到該埠的原因。不要禁用 IMAP,disable_plaintext_authentication=yes如果您想要 TLS 安全登錄,只需使用。
  4. inet_listener pop3 { port = 0 }<- 您在埠 110 上禁用了 POP3,這就是您無法遠端登錄到該埠的原因。不要禁用 POP3,disable_plaintext_authentication=yes如果您想要 TLS 安全登錄,只需使用。

順便說一句,您啟用了 imap 和 pop3 協議並為 lmtp 進行了一些配置,但您沒有啟用 lmtp 協議。

引用自:https://unix.stackexchange.com/questions/373394