Re: [exim-dev] Preliminary testing of a new Exim test suite

Etusivu
Poista viesti
Vastaa
Lähettäjä: Daniel Tiefnig
Päiväys:  
Vastaanottaja: exim-dev
Aihe: Re: [exim-dev] Preliminary testing of a new Exim test suite
Philip Hazel wrote:
[ gecos ]
> I will see if I can reduce the number of anomalies.


Sounds reasonable, as supporting empty gecos fields could be a lot of work.

>> First I thought I could fix that by forcing $parm_caller_name to
>> something, but obviously that doesn't work. I also can't see where
>> CALLER_NAME substitution is done, so I gave up on this.
>
> Line 338 of ./runtest (a grep for CALLER_NAME finds it).


Duh, I misunderstood that as something SSL specific, and didn't look
close enough...
Hmm. I tried some substitutions in case of an empty $parm_caller_name,
but these break some tests, specially with bounce/autoreply mails. It
might be possible to use a different domain for these, but I'm not sure
if all of this is a good idea. You'll have to deside whether you like
that or not, the substitutions are quite intrusive and somewhat
difficult to control in that environment.

I've attached a patch anyway, maybe you can make some use of it. (E.g.
just to see how to NOT solve this issue.)


lg,
daniel
--- runtest    2005-11-11 15:54:25.031814448 +0100
+++ runtest.patched    2005-11-11 15:44:37.109192272 +0100
@@ -335,8 +335,15 @@
   # CN information that OpenSSL verifies from the testing certificates.
   # But don't do anything if the caller's name is empty!


-  s/(?<!CN=)\b$parm_caller_name\b/CALLER_NAME/g
-    if $parm_caller_name ne "";
+  if($parm_caller_name eq '') {
+    s/(?<=From:)(\s*)CALLER\@((?:myhost\.)?(?:test\.)?ex)/${1}CALLER_NAME <CALLER\@${2}>/;
+    s/(?<=To:)(\s*)CALLER\@((?:myhost\.)?(?:test\.)?ex)/${1}CALLER_NAME <CALLER\@${2}>/;
+    s/(?<=Sender:)(?:\s*)<CALLER\@((?:myhost\.)?(?:test\.)?ex)>/ CALLER_NAME <CALLER\@${1}>/;
+    s/login=CALLER name=$/login=CALLER name=CALLER_NAME/;
+    s/-00 => >CALLER\@test.ex </-00 => >CALLER_NAME <CALLER\@test.ex> </;
+  } else {
+    s/(?<!CN=)\b$parm_caller_name\b/CALLER_NAME/g;
+  }


# When looking at spool files with -Mvh, we will find not only the caller
# name, but also the uid and gid. It seems that $) in some Perl's gives all