5 #include "date822fmt.h"
8 static int issafe(ch
) char ch
;
10 if (ch
== '.') return 1;
11 if (ch
== '@') return 1;
12 if (ch
== '%') return 1;
13 if (ch
== '+') return 1;
14 if (ch
== '/') return 1;
15 if (ch
== '=') return 1;
16 if (ch
== ':') return 1;
17 if (ch
== '-') return 1;
18 if ((ch
>= 'a') && (ch
<= 'z')) return 1;
19 if ((ch
>= 'A') && (ch
<= 'Z')) return 1;
20 if ((ch
>= '0') && (ch
<= '9')) return 1;
30 if (!issafe(ch
)) ch
= '?';
35 static char buf
[DATE822FMT
];
37 /* "Received: from relay1.uu.net (HELO uunet.uu.net) (7@192.48.96.5)\n" */
38 /* " by silverton.berkeley.edu with SMTP; 26 Sep 1995 04:46:54 -0000\n" */
40 void received(qqt
,protocol
,local
,remoteip
,remotehost
,remoteinfo
,helo
)
51 qmail_puts(qqt
,"Received: from ");
52 safeput(qqt
,remotehost
);
54 qmail_puts(qqt
," (HELO ");
60 safeput(qqt
,remoteinfo
);
63 safeput(qqt
,remoteip
);
64 qmail_puts(qqt
,")\n by ");
66 qmail_puts(qqt
," with ");
67 qmail_puts(qqt
,protocol
);
69 datetime_tai(&dt
,now());
70 qmail_put(qqt
,buf
,date822fmt(buf
,&dt
));