[comp.mail.elm] expanding reply address in 2.3

tjc@ecs.soton.ac.uk (Tim Chown) (06/05/90)

I posted recently asking why when generating a reply address elm 2.3
expanded a local to: recipient to recipient@fullhostname, when elm 2.2
didn't do this and direct mail (via 'm') to a local user didn't get
expanded either.  I got no reply on this group (though people mailed
me to say they had the same "problem").

The relevant code is in returnadd.c, at around line 330:

          /*
           * KLUDGE ALERT - DANGER WILL ROBINSON
           * We can't just leave a bare login name as the return address,
           * or it will be alias-expanded.
           * So we qualify it with the current host name (and, maybe, domain).
           * Sigh.
           */

          if (chloc(buffer, '@') < 0
           && chloc(buffer, '%') < 0
           && chloc(buffer, '!') < 0)
          {
#ifdef INTERNET
            sprintf(buffer + strlen(buffer), "@%s", hostfullname);
#else
            strcpy(buf, buffer);
            sprintf(buffer, "%s!%s", hostname, buf);
#endif
          }

I'm confused as to why a bare name can't be left, and if it can't,
then why isn't the bare name expanded when mailing using the 'm'
option for "direct" mail.  Is the kludge needed ?

Anyway, I've commented out the whole #ifdef .. #endif in the above
code and I seem to have the 2.2 functionality again.  Will I get
horrible side-effects ?

Cheers,
	Tim Chown
	T.Chown@ecs.soton.ac.uk

syd@DSI.COM (Syd Weinstein) (06/06/90)

tjc@ecs.soton.ac.uk (Tim Chown) writes:

>I posted recently asking why when generating a reply address elm 2.3
>expanded a local to: recipient to recipient@fullhostname, when elm 2.2
>didn't do this and direct mail (via 'm') to a local user didn't get
>expanded either.  I got no reply on this group (though people mailed
>me to say they had the same "problem").
I replied to this message, but I forget if I posted my reply or
just mailed it, but here goes again:

The reason the is exactly as stated in the kludge alert:

          /*
           * KLUDGE ALERT - DANGER WILL ROBINSON
           * We can't just leave a bare login name as the return address,
           * or it will be alias-expanded.
           * So we qualify it with the current host name (and, maybe, domain).
           * Sigh.
           */

The problem is that the mailing address during a later step goes
past the alias processing code.

Here is the problem:

You have an alias a, that expands to abc!a, where abc is some other
system.  There is also a user a on your local system.

User a on your local system sends you a message and it is
"From: a", you reply and the reply is now a "To: a".  If we left
it a plain "To: a" it would then turn into an alias expansion
and go to "abc!a" not the local a.

However, local!a does not expand to an alias, so all is well.

>I'm confused as to why a bare name can't be left, and if it can't,
>then why isn't the bare name expanded when mailing using the 'm'
>option for "direct" mail.  Is the kludge needed ?

The m command does not need to do this because you want the alias
expansion for newly generated mail.

>Anyway, I've commented out the whole #ifdef .. #endif in the above
>code and I seem to have the 2.2 functionality again.  Will I get
>horrible side-effects ?
Nope, just the effect stated above, that a 'local' reply might go to
one of your aliases.  Now if you are sure that no local user names
will ever match a user or system alias, then that block of code
could safely be commented out.

What I don't remember any more, was whether the local system name
was supposed to get taken back off before we handed the message
off the the MTA or not....
-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.                          Voice: (215) 947-9900
syd@DSI.COM or dsinc!syd                        FAX:   (215) 938-0235

tjc@ecs.soton.ac.uk (Tim Chown) (06/06/90)

In <1990Jun5.225613.15848@DSI.COM> syd@DSI.COM (Syd Weinstein) writes:

>tjc@ecs.soton.ac.uk (Tim Chown) writes:
>>Anyway, I've commented out the whole #ifdef .. #endif in the above
>>code and I seem to have the 2.2 functionality again.  Will I get
>>horrible side-effects ?
>Nope, just the effect stated above, that a 'local' reply might go to
>one of your aliases.  Now if you are sure that no local user names
>will ever match a user or system alias, then that block of code
>could safely be commented out.

OK, I see the problem arises where a user sets up an alias and
then gets mail from a true user with that alias as their mail ID.
So I guess the kludge *is* needed.  Having said that, we have
several hundered users, with Elm the prominent mail front-end,
and I've had no reports (as postmaster) of mail going astray
under 2.1/2.2 because of this aliasing problem.

>What I don't remember any more, was whether the local system name
>was supposed to get taken back off before we handed the message
>off the the MTA or not....

It would seem sensible to do so, though our sendmail configuration
handles it fine.  The crux of the problem is that our site is
"ecs.soton.ac.uk" and that that is the only nationally registered
domain we use.  We hide all our other machines beneath this.
When Joe User replies to local mail in 2.3, he may choose to
edit the header, then sees a To: line with the recipient with
hostname.domainname tacked on.  Joe can get confused by this. 

Perhaps Elm could tack the fullhostname info on invisibly to the user,
by not displaying local addresses in the header info.  This way you'd 
get the best of both worlds.

But a minor problem in an otherwise fab product !

Cheers,
	Tim Chown
	T.Chown@ecs.soton.ac.uk

rhoward@msd.gatech.edu (Robert L. Howard) (06/06/90)

In article <1990Jun5.225613.15848@DSI.COM> syd@DSI.COM writes:
=tjc@ecs.soton.ac.uk (Tim Chown) writes:

=>I posted recently asking why when generating a reply address elm 2.3
=>expanded a local to: recipient to recipient@fullhostname, when elm 2.2
=>didn't do this and direct mail (via 'm') to a local user didn't get
=>expanded either.  I got no reply on this group (though people mailed
=>me to say they had the same "problem").

=I replied to this message, but I forget if I posted my reply or
=just mailed it, but here goes again:
=
=The reason the is exactly as stated in the kludge alert:
=
=          /*
=           * KLUDGE ALERT - DANGER WILL ROBINSON
=           * We can't just leave a bare login name as the return address,
=           * or it will be alias-expanded.
=           * So we qualify it with the current host name (and, maybe, domain).
=           * Sigh.
=           */
=
=The problem is that the mailing address during a later step goes
=past the alias processing code.
=
=Here is the problem:
=
=You have an alias a, that expands to abc!a, where abc is some other
=system.  There is also a user a on your local system.
=
=User a on your local system sends you a message and it is
="From: a", you reply and the reply is now a "To: a".  If we left
=it a plain "To: a" it would then turn into an alias expansion
=and go to "abc!a" not the local a.
=
=However, local!a does not expand to an alias, so all is well.

Well, that sounds like a user problem to me.  What are you doing with
an alias for some remote site that is the same as a username for
the local machine?

=>I'm confused as to why a bare name can't be left, and if it can't,
=>then why isn't the bare name expanded when mailing using the 'm'
=>option for "direct" mail.  Is the kludge needed ?
=
=The m command does not need to do this because you want the alias
=expansion for newly generated mail.

Therefore, if the expansion works for the 'm' command _and_ I have
an alias that is equal to a local username I can never send any
mail to that user.  I think what we have here is a poor choice of
an alias.

Robert
--
Robert L. Howard  (GTRI/STL/MSD)             (404) 528-7165
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp:     ...!{allegra,amd,hplabs,ut-ngp}!gatech!msd!rhoward
Internet: rhoward@msd.gatech.edu

chip@tct.uucp (Chip Salzenberg) (06/07/90)

According to syd@DSI.COM:
>  * KLUDGE ALERT - DANGER WILL ROBINSON

As I am the author of the aforementioned kludge, I affirm that Syd's
description of the problem and its solution is accurate.

>What I don't remember any more, was whether the local system name
>was supposed to get taken back off before we handed the message
>off the the MTA or not....

The patch I submitted did include the removal of a leading "local!"
from the address.  However, if INTERNET is defined, then the
transformation is not prepending "local!", but instead, appending
"@local"; and the latter is NOT removed.
-- 
Chip Salzenberg at ComDev/TCT     <chip@tct.uucp>, <uunet!ateng!tct!chip>

chip@tct.uucp (Chip Salzenberg) (06/07/90)

According to rhoward@msd.gatech.edu (Robert L. Howard):
>What are you doing with an alias for some remote site that is the
>same as a username for the local machine?

We have two machines.  I have a login "chip" on each one.  However, I
always read my mail on one of them.  So the other machine aliases
"chip" (a local user) to "chip@otherhost".

>Therefore, if the expansion works for the 'm' command _and_ I have
>an alias that is equal to a local username I can never send any
>mail to that user.

Not so.  You can always mail to "user@localhost".
-- 
Chip, the new t.b answer man      <chip@tct.uucp>, <uunet!ateng!tct!chip>