home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.mail.sendmail
- Path: sparky!uunet!mcsun!sunic!aun.uninett.no!barsoom!barsoom!tih
- From: tih@barsoom.nhh.no (Tom Ivar Helbekkmo)
- Subject: Re: Removing msg body in IDA for postmaster
- Message-ID: <tih.715504703@barsoom>
- Sender: news@barsoom.nhh.no (USENET News System)
- Organization: Norwegian School of Economics
- References: <root.715272995@merlin> <1992Sep2.074845.9955@panix.com>
- Date: Thu, 3 Sep 1992 07:18:23 GMT
- Lines: 52
-
- alexis@panix.com (Alexis Rosen) writes:
-
- >2) Pipe it through a sed which chops it at the first blank line, then forwards
- > it to postmaster.
-
- The following is done in C, but performs basically the same function.
- I've been using this for a long time, as the alias expansion of
- MAIL-ERRORS, which is the CC address for bounces. What I do here is
- extract just the header of the failed message, so that I can quickly
- scan over it and see if it *should* have worked. If so, I contact the
- user in question to find out more.
-
- #include <stdio.h>
-
- int main(int argc, char **argv) {
- char linebuf[512];
- FILE *mpipe;
- int done = 0;
-
- mpipe = popen("/usr/ucb/mail -s \"Mailer Error Report\" Postmaster", "w");
-
- while ((!done) && (!feof(stdin))) {
- gets(linebuf);
- if (strstr(linebuf, "Unsent message follows")) {
- fprintf(mpipe,
- " ----- Header of unsent message follows -----\n");
- done = 1;
- } else {
- fprintf(mpipe, "%s\n", linebuf);
- }
- }
- done = 0;
- while ((!done) && (!feof(stdin))) {
- gets(linebuf);
- if (strlen(linebuf) == 0) {
- fprintf(mpipe,
- "\n ----- Message body removed for privacy -----\n");
- done = 1;
- } else {
- fprintf(mpipe, "%s\n", linebuf);
- }
- }
-
- fclose(mpipe);
-
- return(0);
- }
-
- -tih
- --
- Tom Ivar Helbekkmo, NHH, Bergen, Norway. Telephone: +47-5-959205
- Postmaster for domain nhh.no. Internet mail: tih@barsoom.nhh.no
-