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
    • 最新
    • 标签
主页 / user-268047

Aaron's questions

Martin Hope
Aaron
Asked: 2017-12-30 10:18:46 +0800 CST

后缀根电子邮件仅作为密件抄送转发到外部地址

  • 0

我已经设置了 postfix 来通过我的 gmail 帐户中继 proxmox 消息,并使用别名将我所有的根电子邮件转发到外部地址。使用 sendmail 命令时,可以在 gmail 的已发送文件夹中看到电子邮件,收件人:字段为空,密件抄送:是我的外部地址。使用 mail -s 时,可以在 gmail 发送的文件夹中看到电子邮件,其中 To: 字段作为原始根电子邮件,Bcc: 是我的外部地址。

我的转发地址不应该在 To: 字段中替换 root@pve.home.com 而不是 Bcc: 并完全停止发送到 root@pve.home.com 吗?

根电子邮件的测试命令

# echo -e "Subject:Hello World \n\n Testing email\n" | sendmail root
# echo "testing" | mail -s "test message" root

日志文件

Dec 29 12:56:13 pve postfix/pickup[32080]: DB1E662DFA: uid=0 from=<root>
Dec 29 12:56:13 pve postfix/cleanup[32097]: DB1E662DFA: message-id=<20171229175613.DB1E662DFA@pve.home.com>
Dec 29 12:56:13 pve postfix/qmgr[32081]: DB1E662DFA: from=<root@pve.home.com>, size=390, nrcpt=1 (queue active)
Dec 29 12:56:13 pve postfix/cleanup[32097]: E13A162DF8: message-id=<20171229175613.DB1E662DFA@pve.home.com>
Dec 29 12:56:13 pve postfix/local[32099]: DB1E662DFA: to=<root@pve.home.com>, orig_to=<root>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (forwarded as E13A162DF8)
Dec 29 12:56:13 pve postfix/qmgr[32081]: E13A162DF8: from=<root@pve.home.com>, size=515, nrcpt=1 (queue active)
Dec 29 12:56:13 pve postfix/qmgr[32081]: DB1E662DFA: removed
Dec 29 12:56:13 pve postfix/smtp[32100]: connect to smtp.gmail.com[2607:f8b0:4001:c1d::6c]:587: Network is unreachable
Dec 29 12:56:14 pve postfix/smtp[32100]: E13A162DF8: to=<someone@icloud.com>, orig_to=<root>, relay=smtp.gmail.com[74.125.126.109]:587, delay=0.85, delays=0/0.03/0.37/0.45, dsn=2.0.0, status=sent (250 2.0.0 OK 1514570174 f126sm11045770ioa.84 - gsmtp)
Dec 29 12:56:14 pve postfix/qmgr[32081]: E13A162DF8: removed

Dec 29 12:59:40 pve postfix/pickup[32080]: D6C9362DFA: uid=0 from=<root>
Dec 29 12:59:40 pve postfix/cleanup[32429]: D6C9362DFA: message-id=<20171229175940.D6C9362DFA@pve.home.com>
Dec 29 12:59:40 pve postfix/qmgr[32081]: D6C9362DFA: from=<root@pve.home.com>, size=280, nrcpt=1 (queue active)
Dec 29 12:59:40 pve postfix/cleanup[32429]: DDD4D62DF8: message-id=<20171229175940.D6C9362DFA@pve.home.com>
Dec 29 12:59:40 pve postfix/local[32431]: D6C9362DFA: to=<root@pve.home.com>, orig_to=<root>, relay=local, delay=0.05, delays=0.03/0.01/0/0.01, dsn=2.0.0, status=sent (forwarded as DDD4D62DF8)
Dec 29 12:59:40 pve postfix/qmgr[32081]: DDD4D62DF8: from=<root@pve.home.com>, size=405, nrcpt=1 (queue active)
Dec 29 12:59:40 pve postfix/qmgr[32081]: D6C9362DFA: removed
Dec 29 12:59:41 pve postfix/smtp[32432]: connect to smtp.gmail.com[2607:f8b0:4001:c1d::6c]:587: Network is unreachable
Dec 29 12:59:41 pve postfix/smtp[32432]: DDD4D62DF8: to=<someone@icloud.com>, orig_to=<root>, relay=smtp.gmail.com[74.125.126.109]:587, delay=0.93, delays=0.01/0.02/0.52/0.38, dsn=2.0.0, status=sent (250 2.0.0 OK 1514570381 a69sm13573861itc.18 - gsmtp)
Dec 29 12:59:41 pve postfix/qmgr[32081]: DDD4D62DF8: removed

别名

root: someone@icloud.com

postmaster: root
nobody: root
hostmaster: root
webmaster: root
www:root

主文件

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

myhostname=pve.home.com

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
#relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
inet_interfaces = loopback-only
recipient_delimiter = +

# sets gmail as relay
relayhost = [smtp.gmail.com]:587

#  use tls
smtp_use_tls=yes

# use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes

# path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# list of CAs to trust when verifying server certificate
smtp_tls_CAfile = /etc/ssl/certs/Equifax_Secure_CA.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s

# eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options =

主机

127.0.0.1 localhost.localdomain localhost
127.0.1.1 pve.home.com pve pvelocalhost

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

邮件名

pve.home.com
postfix
  • 1 个回答
  • 2799 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve