[comp.mail.sendmail] who rewrites CC addresses in uucp mail?

knight@hall.cray.com (Steve Knight) (10/31/88)

/*
 * I originally posted this a few weeks ago, at a time when we were 
 * having some problems with our news feed.  As I've seen neither 
 * followup articles nor mail on the subject, I'm assuming that the 
 * original never got to the outside world and am thus reposting.  If 
 * you're actually seeing this a second time, my apologies.  (And please 
 * let me know you saw the original--I just find it hard to believe I 
 * found a subject on which no out there has any opinions...  :-) 
 */

Okay, I'm sure this has been dealt with before, but I'm getting
really confused (not a new phenomenon), so I'll ask.  

Summary question:  who's supposed to do rewriting of CC: recipients for 
uucp mail (sendmail?  rmail?  binmail?  something else?), and how is it 
supposed to rewrite such addresses?  

Situation which illustrates why I'm confused:

We were traipsing along just fine with our uucp transfers until 
someone at a remote site complained that local addresses in our CC: 
lines weren't getting rewritten so that they could reply to all 
recipients.  Just to be real clear about this in an example, say I'm at 
site A, this person is at site C and receives the mail through site B. 
I'd send: 

	To: B!C!user1
	CC: localuser

and the CC recipient would *not* show up as the expected, correct 
"B!A!localuser" (so user1 could reply), but would show up as 
"B!localuser", and upon receiving the reply site B would, as expected, 
spit up at not finding a user on its system named "localuser".  

So upon receiving report of this from user1 along with an entreaty to 
please have our sendmail.cf take care of CC: addresses (and after 
stupidly *not* thinking through the possible dangers), I modified our 
uucp mailer recipient rewrite rule to stick A!  on the front of any 
local recipient user names ($- => A!$1). All well and good with the 
CC: addresses; the above example would get rewritten as 
"B!A!localuser" and user1 was able to type 'R' and respond correctly, 
everybody's happy, right?  Not exactly.  

What I overlooked is that when trying to send a single-hop uucp 
message, the recipient that's going to be passed to rmail on the 
remote machine ends up looking to my rewrite rule like a local user 
(e.g., when I'm mailing to D!user2, I'm going to uux an "rmail 
user2"), and I'm thus going to end up sticking A!  on the front 
("rmail A!user") leading to a furious loop when the remote rmail 
determines that it's supposed to send the message right back to my 
system.  Or at least this is the case with the way I have our ruleset 0 
currently written to pass info to the uucp mailer, in that it resolves 
to the uucp mailer and specifies as the user (i.e., the $: portion of 
the resolution rule) just the remote user name, which is how I've seen 
it handled in all the sendmail.cf files on which I've based my work 
(Erik Fair's, Sun's, etc.).  

I thought of trying to fix this by having ruleset 0 include some 
additional info with the user when resolving to the uucp mailer (and 
then the uucp mail rewrite rule keys on that to *not* tack on the A!), 
but this feels incredibly hacky to me, plus I'm not sure it really 
addresses the issue effectively.  It seems to me that part of the 
problem here is that CC: addresses are recipients from the sender's 
point of view (we're sending mail to them, after all), but from the 
recipient's point of view they should be treated somewhat as senders 
(so that Replying will work, as in the above case).  

So can someone with a reasonably authoritative point of view clear the 
fog in my head over this?  Am I correct in thinking that I really want 
to rewrite two different kinds of recipient addresses (To: and CC:) 
differently?  Should sendmail not be worrying about this?  If not, who 
should (and would that imply that machine B above is the broken one in 
the chain)?
-- 
	Steve Knight
	uunet!bungia!cray!knight
	knight%hall.cray.com@uc.msc.umn.edu