AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 469233
Accepted
Alexander Farber
Alexander Farber
Asked: 2013-01-16 04:56:13 +0800 CST2013-01-16 04:56:13 +0800 CST 2013-01-16 04:56:13 +0800 CST

在 CentOS 6 中使用 postfix 将邮件转发到 [email protected]

  • 772

我在用着:

# cat /etc/*release
CentOS release 6.3 (Final)

# rpm -qa | grep post
postfix-2.6.6-2.2.el6_1.x86_64

在 2 个服务器上:preferans.de和(是的,有趣的名字)static.103.78.9.176.clients.your-server.de

我拥有多个域,并希望所有发往这些域的传入邮件都转发到我的 Gmail 地址。

所以我已经为我的域设置了 MX 记录:

# host videoskat.de
videoskat.de has address 176.9.40.169
videoskat.de mail is handled by 100 static.103.78.9.176.clients.your-server.de.
videoskat.de mail is handled by 10 preferans.de.

# host balkan-preferans.de
balkan-preferans.de has address 176.9.40.169
balkan-preferans.de mail is handled by 100
static.103.78.9.176.clients.your-server.de.
balkan-preferans.de mail is handled by 10 preferans.de.

在我添加的两台服务器上:

# head /etc/postfix/virtual
@balkan-preferans.de [email protected]
@videoskat.de [email protected]

# postmap /etc/postfix/virtual

# postmap -q "@videoskat.de" /etc/postfix/virtual
[email protected]

并在防火墙中打开了25端口:

# grep -w 25 /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 25,22 -j ACCEPT

但是现在,当我向[email protected]发送邮件时,在 postfix 日志中看不到任何内容:

# sudo tail /var/log/maillog
Jan 15 10:50:42 postfix/postfix-script[1401]: starting the Postfix mail system
Jan 15 10:50:42 postfix/master[1402]: daemon started -- version 2.6.6,
configuration /etc/postfix

所以我可能遗漏了一些小东西?

顺便说一句,每天从两个服务器收到的 logwatch 邮件在我的 Gmail 收件箱[email protected]中都很好

更新 2:

我已经将这两行添加到/etc/postfix/main.cf

inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, videoskat.de, balkan-preferans.de

现在我在 中看到传入连接/var/log/maillog,但它们被拒绝了:

postfix/smtpd[3209]: NOQUEUE: reject: RCPT from static.114.69.9.176.clients.your-server.de[176.9.69.114]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<www>
postfix/smtpd[3209]: disconnect from static.114.69.9.176.clients.your-server.de[176.9.69.114]

输出postconf -n如下

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, videoskat.de, balkan-preferans.de
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

本地收件人表中的用户未知在拒绝日志消息中意味着什么?

centos
  • 1 1 个回答
  • 470 Views

1 个回答

  • Voted
  1. Best Answer
    adaptr
    2013-01-16T05:01:30+08:002013-01-16T05:01:30+08:00

    如果邮件日志中没有任何内容,则没有邮件发送到您的服务器。

    您显示的 MX 记录意味着只要 preferans.de 正在回复邮件,就永远不会使用第二个 MX。

    请在postconf -n您的帖子中包含输出,以便我们知道您在说什么。

    本地收件人表中的用户未知在拒绝日志消息中意味着什么?

    如文档所述,postfix 默认拒绝未知本地收件人的邮件。您应该事先定义任何有效的收件人。

    由于您的 main.cf 缺少virtual_alias_maps条目,因此未使用您的虚拟文件;将以下内容添加到 main.cf 并重新加载:

    virtual_alias_maps = /etc/postfix/virtual
    
    • 1

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve