簡體   English   中英

Postfix/dovecot 電子郵件已發送但未收到

[英]Postfix/dovecot email sent but not received

請幫忙! 我正在嘗試使用 Postfix 和 Dovecot 在 LAN 上設置內部郵件服務器。 一切似乎都配置得很好,電子郵件已發送(並在我的 gmail 帳戶上接收),但從未在本地服務器上收到(使用 Squirrelmail 的 Webmail)。 我使用的是 Ubuntu Server 12.04 LTS,它向我發送有關我的新電子郵件的通知,但無法在 Squirrelmail 中閱讀(我看到已發送的郵件、垃圾郵件中的郵件,也許草稿 [未檢查],但收件箱文件夾中沒有收到的郵件) )。 雖然我用 Thunderbird 登錄會是一個配置錯誤的網絡郵件,但問題是一樣的。 看起來電子郵件已發送和接收,但 Dovecot 無法找到它。

這是我的 Postfix 配置文件 (main.cf): # 參見 /usr/share/postfix/main.cf.dist 以獲得更完整的注釋版本

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = <SERVERNAME>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = <SERVERNAME>, localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

...和我的 dovecot 配置文件 (dovecot.conf): ## Dovecot 配置文件

# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration

# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.

# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
# value inside quotes, eg.: key = "# char and trailing whitespace  "

# Default values are shown for each setting, it's not required to uncomment
# those. These are exceptions to this though: No sections (e.g. namespace {})
# or plugin settings are added by default, they're listed only as examples.
# Paths are also just examples with the real defaults being based on configure
# options. The paths listed here are for configure --prefix=/usr
# --sysconfdir=/etc --localstatedir=/var

# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol

# A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::

# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/

# Name of this instance. Used to prefix all Dovecot processes in ps output.
#instance_name = dovecot

# Greeting message for clients.
#login_greeting = Dovecot ready.

# Space separated list of trusted network ranges. Connections from these
# IPs are allowed to override their IP addresses and ports (for logging and
# for authentication checks). disable_plaintext_auth is also ignored for
# these networks. Typically you'd specify your IMAP proxy servers here.
#login_trusted_networks =

# Sepace separated list of login access check sockets (e.g. tcpwrap)
#login_access_sockets = 

# Show more verbose process titles (in ps). Currently shows user name and
# IP address. Useful for seeing who are actually using the IMAP processes
# (eg. shared mailboxes or if same uid is used for multiple accounts).
#verbose_proctitle = no

# Should all processes be killed when Dovecot master process shuts down.
# Setting this to "no" means that Dovecot can be upgraded without
# forcing existing client connections to close (although that could also be
# a problem if the upgrade is e.g. because of a security fix).
#shutdown_clients = yes

# If non-zero, run mail commands via this many connections to doveadm server,
# instead of running them directly in the same process.
#doveadm_worker_count = 0
# UNIX socket or host:port used for connecting to doveadm server
#doveadm_socket_path = doveadm-server

# Space separated list of environment variables that are preserved on Dovecot
# startup and passed down to all of its child processes. You can also give
# key=value pairs to always set specific settings.
#import_environment = TZ

##
## Dictionary server settings
##

# Dictionary can be used to store key=value lists. This is used by several
# plugins. The dictionary can be accessed either directly or though a
# dictionary server. The following dict block maps dictionary names to URIs
# when the server is used. These can then be referenced using URIs in format
# "proxy::<name>".

dict {
  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}

# Most of the actual configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
!include conf.d/*.conf

# A config file can also tried to be included without giving an error if
# it's not found:
!include_try local.conf

protocols = imap imaps pop3 pop3s
#disable_plaintext_auth = no
#default_mail_env = mbox:~/mail/
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_location = maildir:~/Maildir

我嘗試了所有方法來完成這項工作,但沒有成功。 一些論壇說我必須為郵件目錄創建命名空間,其他人說我必須告訴 procmail/sendmail 在哪里復制本地電子郵件,但沒有人告訴我應該在哪里配置這些。

我沒有想法,這讓我發瘋,我即將放棄。 根本沒有任何作用。 從未成功使用這些工具設置功能齊全的內部郵件服務器。

你能告訴我我做錯了什么嗎?

先感謝您。

更新:

dovecot -n 輸出以下內容:

# 2.0.19: /etc/dovecot/dovecot.conf
# OS: Linux 3.8.0-29-generic i686 Ubuntu 12.04.3 LTS 
mail_location = maildir:~/Maildir
passdb {
  driver = pam
}
protocols = imap pop3
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
userdb {
  driver = passwd
}

所以我設法讓它真正發送/接收需要一些調整,如果你按照這個教程來學習,你會得到它的工作,

http://www.samhobbs.co.uk/2013/12/raspberry-pi-email-server-part-1-postfix/

它適用於 raspberry pi,但應該在 ubuntu 上完美運行。

僅供參考.. 我注意到我為我的 postfix 郵件服務器使用了動態 ip 地址,並且由於使用了動態 ip,它們會自動路由到 gmails 垃圾郵件文件夾。 (至少根據萬維網)

#myhostname = <SERVERNAME>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $mydomain, localhost.$mydomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

1- 嘗試使用此配置。 2- 如果使用 cloudflare 添加指向您的域的 MX 記錄,鍵為 @

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM