Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!THUMPER.BELLCORE.COM!nsb From: nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) Newsgroups: comp.soft-sys.andrew Subject: Re: Adding a Header Message-ID: Date: 22 Apr 91 18:11:06 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 35 Excerpts from internet.info-andrew: 22-Apr-91 Re: Adding a Header Michael Urban@rand.org (608) > Unfortunately, `X-Face' data is full of intersting characters like > semicolons that are significant in .atkinit-ish files. Even when I > insert the data into a header line `by hand' (i.e. using the insert-file > menu option), Andrew scrambles my face--a blow to my vanity--by turning > a pair of `@' characters with a single `@' character. Yup, sounds like someone might want to add code to add the X-Face line automatically at a level lower than the ATK stuff. The "right" place to add it, in my opinion, would be ams/libs/ms/submsg.c. It should be pretty easy to fix: In MS_SubmitMessage, after the message is parsed (with ParseMessageFromRawBody), you can use AddHeader to add whatever you want. For example, if you were hardwiring your face in the code (not a good idea): AddHeader(Msg, "X-Face: lkjsfdlkjsfdlkjsdlkjsflk"); So all you'd really need is some code that gets the headers out of a configuration file of some sort and adds them on in this manner. You can add multiple headers with a single call (as long as the headers are separated by a single newline) so you could just use the contents of a file (~/.addheaders ?) in a single AddHeader call, but it might be smart to make sure that the .addheaders file doesn't contain two consecutive newlines, which would mess things up. IMPORTANT NOTE: You should make sure to add the headers right after the ParseMessage... call, BEFORE the authentication-related checks. This will mean, among other things, that people can't add forged From lines using this mechanism. If you make this change, it will affect messages sent with CUI & VUI in addition to Messages. I would encourage you to pass the changes back to the ITC in the form of a patch. Regards. -- Nathaniel