1

I need to change the "Received: (from pseudouser@localhost)" in the email header to "Received: (from pseudouser@company.com). My domain name has already been set in the sendmail.cf, and I've already set masquerade to "company.com." Any ideas on what I can do to reach my end goal?

Current Code

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

Email Header

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

Set Domain To...

$ 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
========================================================
caw04005
  • 23
  • 1
  • 4

2 Answers2

1

This can be done through the header information of the content text file. Script will be like follows.

Mail sending command

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

mail_content.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>

Here at the "from" attribute you can define the from address.

animuson
  • 53,861
  • 28
  • 137
  • 147
sugunan
  • 4,408
  • 6
  • 41
  • 66
1

Try edit /etc/mail/sendmail.mc

MASQUERADE_AS(`yourdomain.com')dnl

and run "service sendmail restart"

KamWebDev
  • 285
  • 3
  • 13