[clug] [PMX:#] Sendmail config - PLEASE help!!

Collins, Steve Steve.Collins at industry.gov.au
Fri Aug 27 08:40:10 GMT 2004

Based on all the feedback, I've tried a few things which have made some changes in my sendmail.cf.  The external relaying (to non @industry.gov.au addresses) still doesn't seem to work, but that may be an issue with the server I'm relaying to.

The command I'm using to send the mail is:

/usr/bin/printf %b "***** Nagios *****\n\nNotification Type: Test\nHost: Test\nState: Test\nAddress: Test\nInfo: Test\n\nDate/Time: 2004/08/27\n" | /bin/mail -s "Host Test alert for Test" steve.collins at industry.gov.au

The address rewriting still doesn't seem to occur.  The headers I can see in Outlook (forced to use) are:

Microsoft Mail Internet Headers Version 2.0
Received: from g5dicbr0gw01.in.industry.gov.au ([]) by g5dicbr0ms01.in.industry.gov.au with Microsoft SMTPSVC(5.0.2195.5329);
	 Fri, 27 Aug 2004 18:19:11 +1000
Received: from smtp.industry.gov.au ([]) by g5dicbr0gw01.in.industry.gov.au with Microsoft SMTPSVC(6.0.3790.0);
	 Fri, 27 Aug 2004 18:19:02 +1000
Received: from nagios_server.industry.gov.au (unverified) by smtp.industry.gov.au
 (Content Technologies SMTPRS 4.3.14) with ESMTP id <T6bade1f8b8c0c72d04b28 at smtp.industry.gov.au> for <steve.collins at industry.gov.au>;
 Fri, 27 Aug 2004 18:19:28 +1000
Received: (from root at localhost)
	by nagios_server.industry.gov.au (8.12.8/8.12.8/Submit) id i7R8ICBN021860
	for steve.collins at industry.gov.au; Fri, 27 Aug 2004 18:18:12 +1000
Date: Fri, 27 Aug 2004 18:18:12 +1000
From: root <root at nagios_server.industry.gov.au>
Message-Id: <200408270818.i7R8ICBN021860 at nagios_server.industry.gov.au>
To: steve.collins at industry.gov.au
Subject: Host Test alert for Test
Return-Path: root at nagios_server.industry.gov.au
X-OriginalArrivalTime: 27 Aug 2004 08:19:02.0766 (UTC) FILETIME=[82F3C0E0:01C48C0E]

You can see it's still setting the sender as root at localhost.  Entries from /var/log/maillog are:

Aug 27 18:27:43 nagios_server sendmail[21881]: i7R8RhkL021881: from=root, size=188, class=0, nrcpts=1, msgid=<200408270827.i7R8RhkL021881 at nagios_server.industry.gov.au>, relay=root at localhost
Aug 27 18:27:43 nagios_server sendmail[21881]: i7R8RhkL021881: to=steve.collins at industry.gov.au, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30069, relay=smtp.industry.gov.au. [], dsn=2.0.0, stat=Sent (Message received OK)

I've done the following:

1. Made the /etc/hosts changes as per Andrew S's advice, and then undone them as per Martijn's.  All this apparently did was change the from address (when testing from root or scollins) to <username>@<first entry in /etc/hosts>, e.g. scollins at localhost.localdomain became scollins at nagios_server@industry.gov.au.

2. Modified the sendmail.mc as per Andrew P's advice.  So my sendmail.mc has the line - 
in it.

None of this seems to have had any effect as far as rewriting mail addresses is concerned.  I have (reluctantly) attached my sendmail.mc for reference.  It's full of lines which apparently NEVER get written to the sendmail.cf (those beginning and ending in dnl).

Any more advice welcome.  Also happy to run postfix or some other with appropriate advice supplied (want to avoid starting again from scratch, so some config advice appreciated).


The information contained in this e-mail, and any attachments to it, is
intended for the use of the addressee and is confidential. If you are not the intended recipient you must not use, disclose, read, forward, copy or retain any of the information. If you have received this e-mail in
error, please delete it and notify the sender by return e-mail or telephone.
The Commonwealth does not warrant that any attachments are free from viruses or any other defects. You assume all liability for any loss, damage or other consequences which may arise from opening or using the attachments.

More information about the linux mailing list