Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!edcogsci!cogsci!miles From: miles@cogsci.ed.ac.uk (Miles Bader) Newsgroups: comp.soft-sys.andrew Subject: Re: Adding a Header Message-ID: Date: 23 Apr 91 16:18:41 GMT References: Sender: miles@cogsci.ed.ac.uk Organization: HCRC, University of Edinburgh Lines: 36 In-reply-to: nsb@THUMPER.BELLCORE.COM's message of 22 Apr 91 18:11:06 GMT nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) writes: > 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. This is the wrong way to do it: as the huge numbers of multiple signatures posted to usenet shows, silently adding junk to outgoing messages just confuses people, even if they specifically want it to be added. It's obviously also less flexible, since you don't have the ability to delete it / modify while composing the message. Just *fix* the current code not to fuck with headers it doesn't know about. Having headers automatically inserted from a file-- into the editable composition buffer-- *is* a good idea in my opinion (batmail does it with the file "~/.headers"). -Miles -- -- Miles Bader -- HCRC, University of Edinburgh -- Miles.Bader@ed.ac.uk