Xref: utzoo comp.unix.questions:30928 comp.mail.headers:693 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!uakari.primate.wisc.edu!aplcen!wb3ffv!oss670!tkevans From: tkevans@oss670.UUCP (Tim Evans) Newsgroups: comp.unix.questions,comp.mail.headers Subject: Eliminating Duplicate Mail Headers Message-ID: <13@oss670.UUCP> Date: 30 Apr 91 18:02:38 GMT Followup-To: poster Organization: Social Security Admin., Baltimore/Washington Lines: 28 My vendor's proprietary e-mail package, non-standard in almost every way (including not using sendmail), is generating duplicate headers. Generally, these are the Subject header and/or the From header, and they are always consecutive. That is, identical Subject headers are generated, and they occur consecutively. Since we are connected to the outside world via UUCP, this means we are doing Bad Things to other people's mail. Naturally, I'm anxious to fix this, but the vendor, whose contract doesn't require UUCP support or compliance with RFC-822, isn't. I'm not able to fix the mailer myself, but can pass its output through standard filters--awk, sed, etc.--before it goes out the door. My first thought was to pass things through 'uniq', but this would also delete consecutive identical lines in the body (the mailer doesn't distinguish between header and body). The probability of consecutive, identical lines in the body of mail messages seems low, but not low enough to chance this. So, can anyone provide a solution that would delete the second (and subsequent?) occurrences of identical lines that are RFC-822-style headers? I'd prefer not using 'perl' as I haven't installed it here yet (Real Soon Now). -- INTERNET tkevans%woodb@mimsy.umd.edu UUCP ...!{rutgers|ames|uunet}!mimsy!woodb!tkevans US MAIL 6401 Security Blvd, 2-Q-2 Operations, Baltimore, MD 21235 PHONE (301) 965-3286