Great Circle Associates Majordomo-Workers
(November 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: patch 1.94.1, try #2
From: Jason L Tibbitts III <tibbs @ hpc . uh . edu>
Date: 28 Nov 1996 12:58:08 -0600
To: majordomo-workers @ greatcircle . com
In-reply-to: Ajay Kochhar's message of Thu, 28 Nov 1996 12:17:19 -0500 (EST)
References: <Pine.SGI.3.95.961128110504.3352B-100000@ari.ari.net>

>>>>> "AK" == Ajay Kochhar <kochhar@ari.net> writes:

Before I comment, you must realize that I was only concerned with the
single line of the patch that attempted to rewrite the To: header.  The
rest of the virtual stuff, which involves making sure that Majordomo sticks
the proper domain on its addresses, is definitely a good idea.

AK> Sendmail is not rewriting the To: header which Majordomo sends to it
AK> for delivery.

I never said that it was.

AK> The To: header only gets rewritten on some systems, *before* the
AK> message is received by Majordomo.

I understand that.  This is very arguably an issue that needs to be solved
at the MTA level, but anyway...

AK> Those familiar with their MTA or lucky enough have their systems
AK> configured to leave the header alone (and as such the incoming domain
AK> is preserved in its original form and not translated into the
AK> localhost's name).

If someone is doing a virtual domain setup, I have no sympathy for them if
they can't be bothered to either learn their MTA or hire a consultant who
can handle it.  Really, it's completely foolish.

AK> An earlier follow-up of mine on this issue suggested use of the
AK> following, "smarter", expression which is applied to only those
AK> addresses in the To: header in one of two forms:

Outside of the typos (square brackets around $locdom) this fails miserably:

#!/usr/local/bin/perl5
$whereami="virtual.com";
$opt_l="fvwm";
$a="To: fvwm\@sina.hpc.uh.edu mailing list <fvwm\@sina.hpc.uh.edu>";
$locdom = '@sina.hpc.uh.edu';
print "$a\n";
$a =~ s/^to:(.*[,\s])\b$opt_l($locdom)?([,\s].*)$/To:$1 $opt_l\@$whereami $2/i ;
$a =~ s/^cc:(.*[,\s])\b$opt_l($locdom)?([,\s].*)$/Cc:$1 $opt_l\@$whereami $2/i ;
print "$a\n";

XYX:sina:~/mj/majordomo-1.94.1> ./blah.pl  
To: fvwm@sina.hpc.uh.edu mailing list <fvwm@sina.hpc.uh.edu>
To:  fvwm@virtual.com @sina.hpc.uh.edu

Like I said, this is harder than it looks.  I am not convinced that it can
even be done at all without a full address parser.

AK> Allowing this to be toggled on or off by a list config variable is
AK> still a good idea.

Well, I'll fight tooth and nail against any release which doesn't let me
turn it off, especially if it isn't any better thought out than the two
options we've seen so far.

I went ahead and looked through Chael Hall's patch for this.  Hopefully he
doesn't mind me adapting two lines from there:

XYX:sina:~/mj/majordomo-1.94.1> cat blah.pl 
#!/usr/local/bin/perl5
$whereami="virtual.com";
$opt_l="fvwm";
$a="To: fvwm\@sina.hpc.uh.edu mailing list <fvwm\@sina.hpc.uh.edu>";
print "$a\n";
$locdom = 'sina.hpc.uh.edu';
$a =~ s/^to:(.*)\b$opt_l\b\@[-\w\d_\.]*$locdom(.*)$/To:$1$opt_l\@$whereami$2/i ; 
$a =~ s/^cc:(.*)\b$opt_l\b\@[-\w\d_\.]*$locdom(.*)$/Cc:$1$opt_l\@$whereami$2/i ; 
print "$a\n";

XYX:sina:~/mj/majordomo-1.94.1> ./blah.pl   
To: fvwm@sina.hpc.uh.edu mailing list <fvwm@sina.hpc.uh.edu>
To: fvwm@sina.hpc.uh.edu mailing list <fvwm@virtual.com>

Don't construe this to be an extensive test.  In fact:

XYX:sina:~/mj/majordomo-1.94.1> ./blah.pl  
To: fvwm@sina.hpc.uh.edu (fvwm@sina.hpc.uh.edu mailing list)
To: fvwm@sina.hpc.uh.edu (fvwm@virtual.com mailing list)

However:

XYX:sina:~/mj/majordomo-1.94.1> cat blah.pl 
#!/usr/local/bin/perl5
$whereami="virtual.com";
$opt_l="fvwm";
$a="To: fvwm\@sina.hpc.uh.edu (fvwm\@sina.hpc.uh.edu mailing list)";
print "$a\n";
$locdom = 'sina.hpc.uh.edu';
1 while $a =~ s/^to:(.*)\b$opt_l\b\@[-\w\d_\.]*$locdom(.*)$/To:$1$opt_l\@$whereami$2/i ; 
1 while $a =~ s/^cc:(.*)\b$opt_l\b\@[-\w\d_\.]*$locdom(.*)$/Cc:$1$opt_l\@$whereami$2/i ; 
print "$a\n";

XYX:sina:~/mj/majordomo-1.94.1> ./blah.pl 
To: fvwm@sina.hpc.uh.edu (fvwm@sina.hpc.uh.edu mailing list)
To: fvwm@virtual.com (fvwm@virtual.com mailing list)

(Maybe I should start a "Development Live" show where I write code while
answering call in questions.)

Which is still a bit iffy to me because it rewrites the comments.  Of
course, some people might like that.  If we're going to do this, instead of
$locdom we need a regular expression of hostnames which will be rewritten
if they match, and the final hostname must not match (else you infloop).
I'll work up a patch sometime today.

I'm hungry too.

 - J<


Follow-Ups:
References:
Indexed By Date Previous: New makefile in 1.94.1 patch#2
From: "Shane P. McCarron" <ahby@themacs.com>
Next: Re: New makefile in 1.94.1 patch#2
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Indexed By Thread Previous: Re: patch 1.94.1, try #2
From: Ajay Kochhar <kochhar@ari.ari.net>
Next: Re: patch 1.94.1, try #2
From: Ajay Kochhar <kochhar@ari.ari.net>

Google
 
Search Internet Search www.greatcircle.com