b4b077fb16
- new switch WITH_POSTFIX_MILTER - assign a new user `dkfilter' to run the milter as a non-priviledged process PR: ports/103490 Submitted by: Hirohisa Yamaguchi <umq@ueo.co.jp> (maintainer)
108 lines
2.7 KiB
Text
108 lines
2.7 KiB
Text
--- dk-filter/dk-filter.c 19 May 2006 21:42:05 -0000 1.158
|
|
+++ dk-filter/dk-filter.c 31 Aug 2006 21:37:17 -0000
|
|
@@ -1582,15 +1582,7 @@
|
|
|
|
dfc->mctx_jobid = smfi_getsymval(ctx, "i");
|
|
if (dfc->mctx_jobid == NULL)
|
|
- {
|
|
- if (no_i_whine && dolog)
|
|
- {
|
|
- syslog(LOG_WARNING,
|
|
- "WARNING: sendmail symbol 'i' not available");
|
|
- no_i_whine = FALSE;
|
|
- }
|
|
dfc->mctx_jobid = JOBIDUNKNOWN;
|
|
- }
|
|
|
|
#if _FFR_REQUIRED_HEADERS
|
|
/* if requested, verify RFC2822-required headers */
|
|
@@ -1625,6 +1617,8 @@
|
|
}
|
|
#endif /* _FFR_REQUIRED_HEADERS */
|
|
|
|
+ msgsigned = (dkf_findheader(dfc, DK_SIGNHEADER, 0) != NULL);
|
|
+
|
|
/* find the Sender: or From: header */
|
|
memset(addr, '\0', sizeof addr);
|
|
from = dkf_findheader(dfc, "Sender", 0);
|
|
@@ -1639,7 +1633,8 @@
|
|
dfc->mctx_jobid);
|
|
}
|
|
|
|
- dfc->mctx_addheader = TRUE;
|
|
+ if (msgsigned)
|
|
+ dfc->mctx_addheader = TRUE;
|
|
dfc->mctx_headeronly = TRUE;
|
|
dfc->mctx_status = DKF_STATUS_BADFORMAT;
|
|
return SMFIS_CONTINUE;
|
|
@@ -1669,7 +1664,6 @@
|
|
originok = FALSE;
|
|
|
|
/* is it a domain we sign for? */
|
|
- msgsigned = (dkf_findheader(dfc, DK_SIGNHEADER, 0) != NULL);
|
|
if (!msgsigned && domains != NULL && dfc->mctx_domain != NULL)
|
|
{
|
|
int n;
|
|
@@ -2075,6 +2069,26 @@
|
|
assert(cc != NULL);
|
|
dfc = cc->cctx_msg;
|
|
assert(dfc != NULL);
|
|
+
|
|
+ /*
|
|
+ ** If necessary, try again to get the job ID in case it came down
|
|
+ ** later than expected (e.g. postfix).
|
|
+ */
|
|
+
|
|
+ if (dfc->mctx_jobid == JOBIDUNKNOWN)
|
|
+ {
|
|
+ dfc->mctx_jobid = smfi_getsymval(ctx, "i");
|
|
+ if (dfc->mctx_jobid == NULL)
|
|
+ {
|
|
+ if (no_i_whine && dolog)
|
|
+ {
|
|
+ syslog(LOG_WARNING,
|
|
+ "WARNING: sendmail symbol 'i' not available");
|
|
+ no_i_whine = FALSE;
|
|
+ }
|
|
+ dfc->mctx_jobid = JOBIDUNKNOWN;
|
|
+ }
|
|
+ }
|
|
|
|
/* get hostname; used in the X header and in new MIME boundaries */
|
|
hostname = smfi_getsymval(ctx, "j");
|
|
Index: libdk/dk.c
|
|
===================================================================
|
|
RCS file: /cvs/libdk/dk.c,v
|
|
retrieving revision 1.168
|
|
retrieving revision 1.169
|
|
diff -u -r1.168 -r1.169
|
|
--- libdk/dk.c 6 Jun 2006 23:22:45 -0000 1.168
|
|
+++ libdk/dk.c 26 Jun 2006 19:40:00 -0000 1.169
|
|
@@ -1890,8 +1890,6 @@
|
|
else
|
|
hdr = sender;
|
|
|
|
- /* if we found a signature but the sender doesn't match it, say so */
|
|
-
|
|
/* if verifying and no from/sender header was found, short-circuit */
|
|
if (hdr == NULL && dk->dk_mode == DK_MODE_VERIFY)
|
|
{
|
|
@@ -1924,6 +1922,7 @@
|
|
return DK_STAT_OK;
|
|
}
|
|
|
|
+ /* if we found a signature but the sender doesn't match it, say so */
|
|
if (hdr != NULL)
|
|
{
|
|
int status;
|
|
@@ -2418,7 +2417,7 @@
|
|
int status;
|
|
|
|
/* no sender header was found below the signature */
|
|
- if (dk->dk_skipbody)
|
|
+ if (dk->dk_skipbody && dk->dk_processing)
|
|
return DK_STAT_SYNTAX;
|
|
|
|
if (dk->dk_key == NULL)
|
|
|
|
|