- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Changing the from line in sendmail.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 04:34 AM
10-13-2005 04:34 AM
Here's the challenge, I want my email notifications from my Red Hat Enterprise Linux 4ES nodes to look just like my HP-UX nodes.
By default, the HP-UX nodes have a from both displayed and the actual address of:
username@hostname.domain.com
Such as root@banana.hp.com
When I receive a message from a Linux node, it shows a displayed name as the username and the email address as the full address.
So, in your email you see a message from:
root
Who has an address of:
root@linuxnode.domain.com
I'd like it to look just like HP-UX.
Does anyone have any ideas where I should start? I've tried comparing the sendmail.cf files, but, well, they're brutal.
Another quick one. Why is it that some documentation says you should make changes to the sendmail.mc file and run m4 to generate the sendmail.cf file, and others say just to edit the sendmail.cf.
From what I've seen, both files are awful to work with, so I don't see any benefit in workin with the .mc then having to deal with a script tool as well. Am I wrong here?
Thanks,
Don
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 05:08 AM
10-13-2005 05:08 AM
Re: Changing the from line in sendmail.
You'll need to do this on each machine.
Don't have to touch sendmail.cf sendmail.mc or even restart the sendmail daemon.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 07:18 AM
10-13-2005 07:18 AM
Re: Changing the from line in sendmail.
The sendmail.mc is a macro file that allows you to generate a sendmail.cf file. It's popular because it's really easy configure sendmail with that, but also, you can edit directly the sendmail.cf file.
The good thing of sendmail.mc is that, when you upgrade the version of sendmail, you can quickly generate a new .cf file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 07:30 AM
10-13-2005 07:30 AM
Re: Changing the from line in sendmail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 12:47 PM
10-13-2005 12:47 PM
Re: Changing the from line in sendmail.
If I log into an HP-UX 11.11 box and enter the following:
echo done | mailx -s "testing" username@domain.ca
I get the following message header in my email:
Received: from hpux.domain.ca ([192.168.1.32]) by smtphost.domain.ca with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
id 4KNAG76Z; Thu, 13 Oct 2005 20:15:04 -0400
Received: (from root@localhost)
by hpux.domain.ca (8.9.3 (PHNE_29774)/8.9.3) id UAA17263
for username@domain.ca; Thu, 13 Oct 2005 20:15:17 -0400 (EDT)
Date: Thu, 13 Oct 2005 20:15:17 -0400 (EDT)
From: root@hpux.domain.ca
Message-Id: <200510140015.UAA17263@hpux.domain.ca>
To: username@domain.ca
Subject: testing
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
If I log into a Red Hat Enterprise Linux 4ES box and enter:
echo testing | mail -s "testing" username@domain.ca
I get this header:
Received: from linux.domain.ca ([192.168.1.34]) by smtphost.domain.ca with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
id 4KNAG76R; Thu, 13 Oct 2005 20:14:28 -0400
Received: (from root@localhost)
by linux.domain.ca (8.13.1/8.13.1/Submit) id j9E0ER80003318
for username@domain.ca; Thu, 13 Oct 2005 20:14:27 -0400
Date: Thu, 13 Oct 2005 20:14:27 -0400
From: root
Message-Id: <200510140014.j9E0ER80003318@linux.domain.ca>
To: username@domain.ca
Subject: testing
How do I make the Linux one be just like the HP-UX one?
SEP: Since I've read many sendmail responses from you, I don't doubt that what you are suggesting will solve the problem.. (what can I say, you seem to be a sendmail god.. ;-) The thing is, my HP-UX boxes don't have either of those files, and they work just fine...
I'm going to attach the sendmail.cf from one of each of my linux and hpux nodes so you can see what I see...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 12:48 PM
10-13-2005 12:48 PM
Re: Changing the from line in sendmail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 04:57 PM
10-13-2005 04:57 PM
Re: Changing the from line in sendmail.
# Masquerade as (DM): #
# #
# If you wish to have mail appear to be from some host or location #
# other than the local host, set macro M to the name you wish to #
# masquerade as. This is also know as site hiding and was set using #
# the DY macro in previous releases of hp-ux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 08:07 PM
10-13-2005 08:07 PM
Re: Changing the from line in sendmail.
O MaxHeadersLength=32768
Enable this in linux and restart sendmail.
Try it and post results.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 04:39 AM
10-18-2005 04:39 AM
Re: Changing the from line in sendmail.
The -f specifies the from address to be user@host.com
Thanks,
Tom Callahan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 09:05 AM
10-18-2005 09:05 AM
Re: Changing the from line in sendmail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2005 06:39 PM
10-18-2005 06:39 PM
SolutionIn this file you will find the following line (in the "Format of headers" section)
H?F?From: $?x$x <$g>$|$g$.
This is where your From header is set and it is sendmail's equivalent of if statement.
if ($x is set)
then
set From: to $x <$g>
else
set From: to $g
$x is full name of the sender (gecos field from the /etc/passwd).
$g is sender's address
SO one way to transform "root
i.e.
change
root:x:0:0:root:/root:/bin/bash
to
root:x:0:0::/root:/bin/bash
Hope that makes sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 01:01 PM
10-19-2005 01:01 PM
Re: Changing the from line in sendmail.
I changed:
#H?F?From: $?x$x <$g>$|$g$.
To:
H?F?From: $g$
And it does exactly what I'm looking for.
Thanks a lot!
Don