1

我需要将邮件标题中的“Received: (from pseudouser@ localhost )”更改为“Received: (from pseudouser@company.com )。我的域名已经在 sendmail.cf 中设置了,而且我已经将伪装设置为“company.com”。关于我可以做些什么来达到我的最终目标的任何想法?

当前代码

cat body.txt | sendmail -s "Request" user@company.com

电子邮件标题

Received: (from pseudouser@localhost)    by servername.corp.company.net (@(#)Sendmail
version 8.13.3 - Revision 1.007 - 3 February 2010/8.11.1) id ####
            for user@company.com; Tue, 23 Jul 2013 14:36:15 -0500 (CDT)
Date: Tue, 23 Jul 2013 14:36:15 -0500
From: pseudouser@company.com
Message-ID: <201307231936.####@servername.corp.company.net>
To: <user@company.com>
Subject: Request
Return-Path: pseudouser@company.com

将域设置为...

$ sendmail -d0.1 -bv root

Version @(#)Sendmail version 8.13.3 - Revision 1.007 - 3 February 2010

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = servername
  (canonical domain name) $j = $w.corp.company.net
         (subdomain name) $m = corp.company.net
              (node name) $k = servername
========================================================
4

2 回答 2

1

这可以通过内容文本文件的标题信息来完成。脚本将如下所示。

邮件发送命令

cat mail_content.html | /usr/lib/sendmail -t

邮件内容.html

From: donotreply@sample.com
To: info@sample.com
Subject: Subject of the mail
Mime-Version: 1.0
Content-Type: text/html

<h1>Sample html body</h1>

在“发件人”属性中,您可以定义发件人地址。

于 2014-08-04T03:13:41.080 回答
0

尝试编辑 /etc/mail/sendmail.mc

MASQUERADE_AS(`yourdomain.com')dnl

并运行“服务 sendmail 重启”

于 2019-01-15T15:57:44.013 回答