Path: utzoo!attcan!uunet!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: comp.mail.sendmail Subject: Re: Token separators Message-ID: <1990Sep18.134651.30682@mp.cs.niu.edu> Date: 18 Sep 90 13:46:51 GMT References: <5107@hemuli.tik.vtt.fi> Organization: Northern Illinois University Lines: 45 In article <5107@hemuli.tik.vtt.fi> keijo@vttux1.vtt.fi (keijo tuominen) writes: > >I wonder it this kind of rewriting is possible in sendmail: > >Adddress which comes to sendmail: > >keijo.tuominen.mailnet.vtt@vtt.fi > >would be rewrite to this format : > >"given_name=keijo%surname=tuominen%admin_domain=mailnet%private_domain=vtt"@ >mailnet.vtt.umc > This is quite difficult to do. I just finished experimentally designing a ruleset which produces a quoted output address. Here is what I learned. 1. Because of the special way 'sendmail' treats quotes, it is almost impossible to do this with a standard Berkeley sendmail. I was successful only because of the IDA enhancements. I don't believe I could have succeeded with vanilla sendmail. It took some time examining code to find out what would work. 2. To build such an address you will start with a tokenized address. The result will remain tokenized in 'sendmail' until after it leaves ruleset 4, and is converted to a character string by cataddr(). Thereafter it is not again processed by 'sendmail'. In other words, treatment of the quoted part as a single token may happen in the next mailer the mail is transferred to, but not in this sendmail. 3. The reverse direction is impossible with current code. That is, given an address in quotes it will always be a single token, and there is no way to break it up into multiple tokens. An address only passes through prescan() once, and that is where it is tokenized. If all works well some enhance version of my experimental quoting rules will probably appear in the sendmail/IDA package at uxc.cso.uiuc.edu. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115. +1-815-753-6940