我使用dovecot+postfix+mysql配置了邮件服务器,并且它在服务器(Ubuntu 服务器)中运行良好。但在上周它停止正常工作。它不发送电子邮件。当我尝试telnet localhost smtp连接成功时,但当我连接mail from:<steve@example.com>并按 Enter 时,它挂起,什么也没有发生。
查看/var/log/mail.log文件后,我发现问题可能(99%)出在 postfix 尝试连接到 MySQL 服务器时。如果您看到下面给出的日志文件,您可以看到它说Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
Nov 14 21:54:36 ns1 dovecot: dovecot: Killed with signal 15 (by pid=7731 uid=0 code=kill)
Nov 14 21:54:36 ns1 dovecot: Dovecot v1.2.9 starting up (core dumps disabled)
Nov 14 21:54:36 ns1 dovecot: auth-worker(default): mysql: Connected to localhost (mailserver)
Nov 14 21:54:44 ns1 postfix/postfix-script[7753]: refreshing the Postfix mail system
Nov 14 …Run Code Online (Sandbox Code Playgroud) 我有一个开发 Ubuntu Server (12.04.1) VM,用于开发 php 站点和电子商务站点(如 Magento 等)。
因为这是出于开发目的,并且我需要使用我自己以外的电子邮件地址进行测试,所以我需要一种让 sendmail 命令接受邮件但不实际发送邮件的方法,而是存档是我可以查看的地方它。
安装邮件服务器以便 sendmail 命令将所有邮件路由到本地目录的最简单方法是什么?即我不希望任何邮件被传送到互联网。
我尝试了这个问题中讨论的步骤(SMTP 服务器将所有邮件发送到 user@localhost),但它似乎不起作用 - 我的(本地)邮箱中收到一条错误消息,告诉我它无法发送我的测试消息(例如,someone@gmail.com)
我运行 postfix 我的服务器以允许网站发送电子邮件。我将它用作sendmail适当的替代品。
发送电子邮件时,HELO 字符串似乎包含localhost. 这不会是一个问题,只是我的一个客户刚刚说垃圾邮件拦截器向他们返回了一封电子邮件,说该电子邮件localhost不能包含在 HELO 字符串中。惊人的。
所以我编辑/etc/mailname为我的主要域名。我进行了编辑,/etc/postfix/main.cf以便:
smtpd_banner = ESMTP $mail_name
Run Code Online (Sandbox Code Playgroud)
然而,这是我在已发送电子邮件的标题中看到的(重新启动 postfix 后):
Delivered-To: oli@example.com
Received: by 22.194.173.22 with SMTP id bi10csp117521wjc;
Tue, 2 Apr 2013 07:24:18 -0700 (PDT)
X-Received: by 10.68.22.168 with SMTP id pt8mr24540246pbb.10.1364912657736;
Tue, 02 Apr 2013 07:24:17 -0700 (PDT)
Return-Path: <oli@example.com>
Received: from localhost (example.com. [22.22.22.22])
by mx.google.com with ESMTP id l6si2328296pao.283.2013.04.02.07.24.16;
Tue, 02 Apr 2013 07:24:17 -0700 (PDT)
Run Code Online (Sandbox Code Playgroud)
我已将我的域替换为 example.com。
localhost …我在我所有的 MX 服务器(主要和 2 个备份)上使用 postgrey。从备份服务器接收邮件时,我需要在主服务器上禁用灰名单。怎么做?
当我将 IP/FQDN 添加到 时/etc/postgrey/whitelist_clients,它没有帮助。
指定POSTGREY_OPTS="--inet=10023 --whitelist-clients=/etc/postgrey/whitelist_clients"in/etc/default/postgrey也没有帮助。
我在 Ubuntu 服务器 18.04 上安装 Postfix
我修改了文件的配置/etc/postfix/main.cf
我犯了错误,我想恢复原始文件。所以我卸载了 Postfix :
$ sudo apt remove postfix && apt purge postfix
$ sudo autoremove
Run Code Online (Sandbox Code Playgroud)
当我再次安装 Postfix 时,安装不会像第一次安装时那样询问问题。我仍然保留着以前的配置。为什么我无法重置 Postfix 配置?
如果我重新配置 Postfix,我仍然有以前的配置:
sudo dpkg-reconfigure postfix
Run Code Online (Sandbox Code Playgroud) 我已将系统设置为通过 Gmail 发送电子邮件。
系统在我可以发送电子邮件的范围内工作,但是我收到有关安全证书的错误。
这是 mail.log 中的一个示例条目:
Oct 29 12:17:27 durban postfix/smtp[20742]: setting up TLS connection
to smtp.gmail.com[209.85.143.108]:587
Oct 29 12:17:27 durban postfix/smtp[20742]: certificate verification
failed for smtp.gmail.com[209.85.143.108]:587: untrusted issuer
/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Oct 29 12:17:27 durban postfix/smtp[20742]: Untrusted TLS connection
established to smtp.gmail.com[209.85.143.108]:587: TLSv1 with cipher
RC4-SHA (128/128 bits)
Oct 29 12:17:29 durban postfix/smtp[20742]: BA4852A1BFA:
to=<some@email.com>, relay=smtp.gmail.com[209.85.143.108]:587,
delay=2.9, delays=0.1/0.1/1.3/1.4, dsn=2.0.0, status=sent (250 2.0.0
OK 1319887049 l20sm20686943wbo.6)
Run Code Online (Sandbox Code Playgroud)
我在 google 上搜索了这个问题,并找到了其他有问题的人,他们可以通过更新 /etc/postfix 目录中名为 cacert.pem 的文件来解决它。
在我的 main.cf 我有以下行(除其他外):
smtpd_tls_CAfile=/etc/postfix/cacert.pem
Run Code Online (Sandbox Code Playgroud)
我有这个文件: …
在带有 Ubuntu 12.04 LTS 的 VPS 中,我安装了 postfix。域名是example.com,VPS 主机名是server.example.com。对于域,example.com我创建了一个 MX 记录。之后,邮件服务器mail.example.com启动并运行。
如何在后缀配置main.cf集myhostname?
myhostname=server.example.com
Run Code Online (Sandbox Code Playgroud)
或者
myhostname=mail.example.com
Run Code Online (Sandbox Code Playgroud) 我收到此错误:必须首先对所有已发送邮件发出 STARTTLS 命令。
谁能看出为什么?
主要.cf:
relayhost=[smtp.gmail.com]:587
smtp_connection_cache_destinations= [smtp.gmail.com]:587
#TLS parameters
smtpd_use_tls = yes
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_note_starttls_offer = yes
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_tls_security_level = encrypt
# SASL Configuration
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_enforce_tls = no
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_sasl_tls_security_options = noanonymous
Run Code Online (Sandbox Code Playgroud)
tls_policy
[smtp.gmail.com]:587 encrypt
Run Code Online (Sandbox Code Playgroud)
sasl_passwd
smtp.gmail.com:587 name@gmail.com:password
Run Code Online (Sandbox Code Playgroud)
而且,是的,我已经在所有数据文件上运行了 postmap 并在进行更改后重新加载了 postfix。
TIA
在 Ubuntu 17.04 中安装 TLP 时遇到问题。它带来了像 postfix 这样的新依赖项,我不想将其安装在家用笔记本电脑中。早期版本的 ubuntu 不要求 postfix。