[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewriting headers



> The normal behaviour of the Zmailer is to rewrite things in the header
> section of the messages when it recognices the domain in the "From"
> header as a localname. I want that the behaviour of the Zmailer with
> these kind of messages was the same as domains listed as "allow relay"
> in the policy rules.
> That is, no rewrite at all, and log them in the maillog with the original
> domain, not with the domain of the Zmailer relay machine. But we want to
> continue accepting mail for these domains...
> 
> I don't know if this is possible hacking the configuration files.

	That is where the hacking needs to happen, but now I can't
	find the place where the envelope from is rewritten, while
	header From: is not touched.
 
	I will try to have a deeper look at it.
...
	while testing it at my workstation and claiming "false"
	source identity I see following result from router:

$ /usr/lib/sendmail -v -fmea@mea.utu.fi mea@mea.tmt.tele.fi
From: mea@mea.utu.fi 
To: mea@mea.tmt.tele.fi
Subject: test

test
<EOF>
$ router processed message 92176-21431
l <19980216084332Z92176-21431+2@mea.tmt.tele.fi>
e mea@mea.utu.fi
e mea@mea.tmt.tele.fi
s local mea@mea.utu.fi mea@mea.tmt.tele.fi 2
r       local mea@mea.tmt.tele.fi mea 99
N ORCPT=rfc822;mea@mea.tmt.tele.fi
headers rewritten using 'internet' function:
Received: by mea.tmt.tele.fi id <92176-21431>; Mon, 16 Feb 1998 10:43:27 +0200
From:   mea@mea.utu.fi
To:     mea@mea.tmt.tele.fi
Subject: test
Message-Id: <19980216084332Z92176-21431+2@mea.tmt.tele.fi>
Date:   Mon, 16 Feb 1998 10:43:27 +0200

router done processing 92176-21431

	Ok, so why the sender address is as it is ?

	Turns out, the problem is in  crossbar.cf  file,
	in location where it starts address rewriting
	by extracting $from address..  Altering that by
	following way will help on this problem:

	......
	smtp|smtpx|local|bsmtp3*)
-		tmp="$(smtproute "$(user $from)")"
+		case "$(channel $from)" in
+		local)
+			# This looks weird, doesn't it ?
+			# the 'host' component contains FQDN form of
+			# address on 'local' channels, others have it
+			# also in the 'user' part.
+			tmp="$(smtproute "$(host $from)")"
+			;;
+		*)
+			tmp="$(smtproute "$(user $from)")"
+			;;
+		esac
	......


	The source address was 4-tuple:

		local	mea@mea.utu.fi	mea	...

	in which the components are referred as:
		channel host user attributes


/Matti Aarnio <mea@nic.funet.fi>