Date: Thu, 3 Sep 1998 00:14:10 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: current@FreeBSD.ORG Subject: Vacation program utterly stupid; does not understand RFC822 Message-ID: <199809030014.RAA28929@usr07.primenet.com>
next in thread | raw e-mail | index | archive | help
The vacation program is utterly stupid.
It will attempt to reply to "<>".
It will attempt to reply to "<MAILER-DAEMON>" (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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809030014.RAA28929>
