From owner-freebsd-current Wed Sep 2 17:15:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA04666 for freebsd-current-outgoing; Wed, 2 Sep 1998 17:15:18 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA04660 for ; Wed, 2 Sep 1998 17:15:17 -0700 (PDT) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id RAA28660 for ; Wed, 2 Sep 1998 17:14:15 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp04.primenet.com, id smtpd028620; Wed Sep 2 17:14:11 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id RAA28929 for current@freebsd.org; Wed, 2 Sep 1998 17:14:11 -0700 (MST) From: Terry Lambert Message-Id: <199809030014.RAA28929@usr07.primenet.com> Subject: Vacation program utterly stupid; does not understand RFC822 To: current@FreeBSD.ORG Date: Thu, 3 Sep 1998 00:14:10 +0000 (GMT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The vacation program is utterly stupid. It will attempt to reply to "<>". It will attempt to reply to "" (some stupid hosts don't put in the "@domain" in the brokets, as they are required to by RFC822 -- I leave it to your imagination to determine which ones). If it's not a UNIX mailbox delivery (i.e., there is no "From "), it ignores the header "From: ". Here are my patches to fix this, since it has recently become obnoxious (patches follow .sig). !@#@$@! Frigging ancient piece of code... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. ----------------------------------------------------------------------------- Index: vacation.c =================================================================== RCS file: /cvs/mod/whistle/ia/bin/vacation/vacation.c,v retrieving revision 1.5.2.2 diff -c -r1.5.2.2 vacation.c *** vacation.c 1998/09/02 21:54:37 1.5.2.2 --- vacation.c 1998/09/02 23:55:59 *************** *** 216,221 **** --- 216,231 ---- if (junkmail()) exit(0); } + /* "From: " */ + if (!strncmp(buf, "From: ", 6)) { + for (p = buf + 6; *p && *p != ' '; ++p); + *p = '\0'; + (void)strcpy(from, buf + 6); + if (p = index(from, '\n')) + *p = '\0'; + if (junkmail()) + exit(0); + } break; case 'P': /* "Precedence:" */ cont = 0; *************** *** 285,290 **** --- 295,301 ---- } ignore[] = { "-request", 8, "postmaster", 10, "uucp", 4, "mailer-daemon", 13, "mailer", 6, "-relay", 6, + "<", 1, "cyrus", 5, NULL, NULL, }; register struct ignore *cur; *************** *** 297,311 **** * will be some variant of: * * From site!site!SENDER%site.domain%site.domain@site.domain */ ! if (!(p = index(from, '%'))) ! if (!(p = index(from, '@'))) { ! if (p = rindex(from, '!')) ! ++p; ! else ! p = from; ! for (; *p; ++p); } len = p - from; for (cur = ignore; cur->name; ++cur) if (len >= cur->len && --- 308,336 ---- * will be some variant of: * * From site!site!SENDER%site.domain%site.domain@site.domain + * + * OR + * + * From <@site.domain@site.domain:SENDER@site> */ ! if (!(p = index(from, '%'))) { ! /* no '%'; look for '@'... */ ! if (!(p = rindex(from, '@'))) { ! /* no '@'; look for '>'... */ ! if (!(p = index(from, '>'))) { ! /* ! * no '>'; back up from end of line. Note ! * use of pre-increment, leaving p one past ! * the end of line for option base 1 ! * subtraction (p - cur->len)... ! */ ! for ( p = from; *p; ++p); ! } ! /* else back up from character before '>' */ } + /* else back up from character before '@' */ + } + /* else back up from character before '%' */ len = p - from; for (cur = ignore; cur->name; ++cur) if (len >= cur->len && ----------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message