我有一个 Ubuntu 9.04 服务器安装,它托管了少量网站(目前有两个,并将保留为单个数字)。服务器的电子邮件要求非常有限 - 发送外发电子邮件并将所有传入电子邮件转发到另一台服务器上的邮箱 - 很可能是谷歌。
我已经安装了 postfix 并且外发邮件工作正常。如何配置 Postfix 以转发所有传入邮件?如果我将其发送到 googlemail 地址,是否有任何特殊注意事项?最后,将基本的垃圾邮件过滤纳入转发机制有多难?
我读到有一个选项可以使用 Gmail 作为您的主要邮件服务器。从某种意义上说,您可以添加 mx 记录等,而不必在自己的服务器上进行。
您认为这是安全方面的推荐设置吗?Gmail 会为您对抗病毒、垃圾邮件和暴力攻击吗?
[更新]
我看到这篇文章受到了一些人的关注。我必须说,在这篇文章之后,我将整个通信系统切换到了谷歌。通信是电子邮件、日历、文档等。我必须说,在我看来,这是我们迈出的最好的一步。
[切换虚拟主机]
我们是一家初创公司,由于配置/价格等原因,我不得不频繁切换虚拟主机和服务器。每次切换我都必须设置所有网站,每次电子邮件地址时,总是丢失另一台服务器上的电子邮件。让您的电子邮件“在云端”。您的电子邮件总是在一个地方,您只需在切换托管服务提供商时设置网站。
[服务器安全]
另一个大问题是安全性。我们不得不转移到一个专用的,具有更大的权力。更大的力量带来了更大的复杂性。我现在必须使用 linux,并构建自己的可靠服务器,对外界有很好的保护。我不得不说我对我们每天收到的攻击数量感到惊讶。作为蛮力黑客,嗅探等。经过几个月的工作,我终于建立了一个有点“安全”的系统。我认为唯一的弱点是电子邮件系统。获得良好的垃圾邮件保护,我不知道还有什么样的风险。现在这已成为过去,因为公司的所有电子邮件都已安全发送并防止垃圾邮件。
[服务器性能]
另一个小好处是电子邮件程序使用的资源。我现在没有在机器上运行任何垃圾邮件保护或防病毒软件,这肯定是一个小好处。
[结论]
最后服务很棒。有很多同步选项,也适用于移动设备。作为一家小公司,这对我们来说很难在我们的主服务器上进行设置,因此让所有这些工作都在云端进行是一件很棒的事情。
我正在配置 Postfix 以使用外部 smtp。为此,我使用了本教程
跟踪之后,在日志中发现/etc/postfix/sasl_passwd.db无法读取。该文件不存在。我使用 postmap hash:/etc/postfix/sasl_passwd ( http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html ) 作为 root,但我得到:
postmap: fatal: open database /etc/postfix/sasl_passwd.db: Permission denied
Run Code Online (Sandbox Code Playgroud)
为什么我会得到这个?
OS: Fedora 14
User "postfix" exists.
Run Code Online (Sandbox Code Playgroud)
更新:
sudo ls -l /etc/postfix/sasl_passwd.db ls:
cannot access /etc/postfix/sasl_passwd.db: No such file or directory
touch /etc/postfix/sasl_passwd.db
chmod 640 /etc/postfix/sasl_passwd.db
chown postfix:root /etc/postfix/sasl_passwd.db
sudo ls -l /etc/postfix/sasl_passwd.db
-rwxr--r--. 1 postfix root 0 Feb 19 04:16 /etc/postfix/sasl_passwd.db
-rw-r-----. 1 postfix root 0 Feb 19 04:16 /etc/postfix/sasl_passwd.db
postmap hash:/etc/postfix/sasl_passwd
postmap: fatal: cannot remove zero-length …Run Code Online (Sandbox Code Playgroud) 我有一封邮件被 Gmail 拒绝了,我不知道为什么。它通过了SPF。我们没有使用 DKIM。我需要设置 DKIM 吗?
我控制着“example.com”。我们的邮件服务器是“server.example.com”(托管在 bluehost)
我们的 SPF 记录是
v=spf1 +a +mx ?include:bluehost.com -all
Run Code Online (Sandbox Code Playgroud)
但是 Gmail 拒绝了一封邮件:
由于 550-5.7.1 域的 DMARC 政策,来自 example.com 的 550-5.7.1 未经身份验证的电子邮件不被接受。请联系example.com管理员...
消息标题:
Return-path: <sabrina@example.com>
Received: from [99.127.228.246] (port=61813 helo=[192.168.1.66])
by server.example.com with esmtpsa (TLSv1:AES128-SHA:128)
(Exim 4.80.1)
(envelope-from <sabrina@example.com>)
id 1VMLM8-0007ok-5c; Wed, 18 Sep 2013 17:16:03 +0000
From: Sabrina <sabrina@example.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_2FE0763D-B160-49C4-8202-B8258851AFAD"
Subject: positive self thoughts/talk
Date: Wed, 18 Sep 2013 10:15:24 -0700
Message-Id: <D85DC2BA-0E8A-4AF6-9C54-203C52E996F2@example.com>
To: Tanja Schulte-Irwin <tanjaschulte@gmail.com>,
Zachary Bloom <zbloom@sffriendsschool.org>
Mime-Version: …Run Code Online (Sandbox Code Playgroud) 我知道有一些关于此的帖子,我已经阅读了一段时间,但仍然无法解决我的问题。
我正在使用 postfix 运行 ISPconfig,但我不明白为什么我的外发电子邮件在 gmail 和 outlook.com 中被标记为垃圾邮件。
这是我向 check-auth@verifier.port25.com 发送邮件时的结果。
==========================================================
Summary of Results
==========================================================
SPF check: pass
DomainKeys check: neutral
DKIM check: pass
Sender-ID check: pass
SpamAssassin check: ham
Run Code Online (Sandbox Code Playgroud)
以下是发送给 gmail 的电子邮件的内容:
Delivered-To: xxxxx@gmail.com
Received: by 10.37.115.87 with SMTP id o84csp2701146ybc;
Wed, 14 Oct 2015 02:24:12 -0700 (PDT)
X-Received: by 10.180.23.231 with SMTP …Run Code Online (Sandbox Code Playgroud) 我以为我成功保护了我的 Postfix/Dovecot 电子邮件服务器。我有一个来自 LetsEncrypt 的签名证书,它对我的域有效。
发送和接收工作正常,但由于 Gmail 开始标记不安全的电子邮件,所有从我的服务器发送的邮件都被标记为未加密。
Gmail 用户会看到“此邮件未加密”,如下所示:
在 Postfix 中main.cf,除其他设置外,我有:
# SASL, for SMTP authentication
smtpd_sasl_type = dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_path = private/auth
# TLS, for encryption
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtpd_tls_CAfile = /etc/letsencrypt/live/mydomain.com/chain.pem
smtpd_tls_cert_file = /etc/letsencrypt/live/mydomain.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mydomain.com/privkey.pem
tls_random_source = dev:/dev/urandom
smtpd_client_new_tls_session_rate_limit = 10
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_exclude_ciphers =
EXP
EDH-RSA-DES-CBC-SHA
ADH-DES-CBC-SHA
DES-CBC-SHA
SEED-SHA
smtpd_tls_dh512_param_file = ${config_directory}/certs/dh_512.pem
smtpd_tls_dh1024_param_file = ${config_directory}/certs/dh_1024.pem
disable_vrfy_command = yes
smtpd_helo_required …Run Code Online (Sandbox Code Playgroud) 使用 Centos 5.4 和 Postfix。我可以做一个
mail foo@gmail.com
subject: blah
test
.
Cc:
Run Code Online (Sandbox Code Playgroud)
并且 msg 被发送到 gmail,但它驻留在垃圾邮件文件夹中,这是意料之中的。
我的目标是能够生成电子邮件消息,并让它们出现在常规收件箱中!据我了解 Postfix/Gmail,可以将 Postfix 配置为使用端口 587 通过经过身份验证的/有效用户发送/中继邮件,这样邮件将不再被视为垃圾邮件。
我已经尝试了许多基于来自“网络”的不同站点/文章的参数,但都没有成功。有些文章,居然好像和其他文章有冲突!我也查看了关于此的 stacflow 帖子,但我仍然缺少一些东西......还在 IRC(Centos/Postfix)上与一些人交谈过,但仍然有问题......
所以,我再次转向 Serverfault!
如果有人设法做到了这一点,您是否介意发布您的 main.cf、sasl-passwd 和任何其他用于使其工作的 conf 文件!如果我可以查看您的配置文件,我希望能看到我搞砸的地方,并找出如何解决问题的方法。
感谢您阅读本文以及您提供的任何帮助/指示!
ps,如果有我可能错过的堆栈流帖子说明了这一点,请随时向我指出!
-汤姆
每当我的域向另一个域上的 Google 群组发送消息时,DMARC 对齐都会失败。这适用于所有我批准的发件人,即使在我的域中使用 Gmail。好像是因为Return-Path(Envelope From)头被接收组的退回地址代替了,但是From头仍然是我的域,这是不正确的。
例如,我将邮件从我域中的 Gmail chris@mydomain.com 发送到您域中的群组 your-group@yourdomain.com。如果您查看收到的消息的标题,您会看到:
坏的
Return-Path: <your-group+bncBCA5XFGRYQLCBEHHVS5AKGQED3J2I7I@yourdomain.com>
Authentication-Results: mx.google.com;
dkim=pass header.i=@yourdomain.com;
spf=pass (google.com: domain of your-group+bncBCA5XFGRYQLCBEHHVS5AKGQED3J2I7I@yourdomain.com designates 2607:f8b0:400d:c04::246 as permitted sender)
smtp.mailfrom=your-group+bncBCA5XFGRYQLCBEHHVS5AKGQED3J2I7I@yourdomain.com;
dmarc=fail (p=NONE dis=NONE) header.from=mydomain.com
From: Chris <chris@mydomain.com>
X-Original-Sender: chris@mydomain.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@mydomain.com; spf=pass (google.com: domain of chris@mydomain.com
designates 2607:f8b0:400c:c05::233 as permitted sender)
smtp.mailfrom=chris@mydomain.com;
dmarc=pass (p=NONE dis=NONE) header.from=mydomain.com
Run Code Online (Sandbox Code Playgroud)
由于 From 域 (mydomain) 与 DKIM 和 SPF 域 (yourdomain) 之间的对齐不当,DMARC 失败。但是,当您(一个正确配置的 GApps 用户)从 Gmail 向 mydomain 中的群组发送邮件时,标头是不同的。
好的
Return-Path: <my-group+bncBCGJ3NF22YBRBTXIVS1RKGQEIWR5E6Q@mydomain.com>
Authentication-Results: mx.google.com; …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 monit,并使用 gmail 设置电子邮件服务器。配置文件是这样的:
set mailserver smtp.gmail.com port 587
username "someuser@gmail.com" password "password"
using tlsv1
with timeout 30 seconds
Run Code Online (Sandbox Code Playgroud)
我设置了一个警报来测试:
check file alerttest with path /.nonexistent
alert address@gmail.com with reminder on 500 cycles
Run Code Online (Sandbox Code Playgroud)
但是当我使用 monit validate 时,我得到的错误信息是这样的:
Sendmail: error receiving data from the mailserver 'smtp.gmail.com' -- Resource temporarily unavailable
Alert handler failed, retry scheduled for next cycle
'alerttest' file doesn't exist
Sendmail: error receiving data from the mailserver 'smtp.gmail.com' -- Resource temporarily unavailable
'alerttest' trying to restart
Run Code Online (Sandbox Code Playgroud)
任何人有任何想法?非常感谢
我收到一封电子邮件,我注意到Delivered-To:和To:字段不同。该To:字段不是我的实际电子邮件地址,但该Delivered-To:字段是。这是怎么发生的?
Delivered-To: mike.smith@work.com
To: "msmith@work.com" <msmith@work.com>
Run Code Online (Sandbox Code Playgroud)
除此之外 - 我认为我的办公室可能有一些自动转发设置,但我测试了发送一些东西,但msmith@work.com它没有传给我。