1
From ef4a9a712e15ffb2bb983cd8f337a7a4954332c6 Mon Sep 17 00:00:00 2001
2
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3
Date: Sun, 26 Oct 2014 12:11:09 +0100
4
Subject: clamav-milter: add additinal SMFIF_* flags before invoking
7
unfortunately after the shifting of the code (so that the socket could
8
be part of a group which is not part of the clamav user) I forgot (or
9
did not see it) to have the header flags added before the
10
smfi_register() was invoked. As a result the socket was working but it
11
was unable to add the X-Virus-Scanned & X-Virus-Status flags. This
12
patch fixes the issue.
14
https://bugzilla.clamav.net/show_bug.cgi?id=10731
16
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
18
clamav-milter/clamav-milter.c | 48 ++++++++++++++++++++++++-------------------
19
1 file changed, 27 insertions(+), 21 deletions(-)
21
diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c
22
index 99e7fe7..22db98a 100644
23
--- a/clamav-milter/clamav-milter.c
24
+++ b/clamav-milter/clamav-milter.c
25
@@ -116,6 +116,33 @@ int main(int argc, char **argv) {
29
+ pt = optget(opts, "AddHeader")->strarg;
30
+ if (strcasecmp(pt, "No")) {
33
+ if (((opt = optget(opts, "ReportHostname"))->enabled &&
34
+ strncpy(myname, opt->strarg, sizeof(myname))) ||
35
+ !gethostname(myname, sizeof(myname))) {
37
+ myname[sizeof(myname)-1] = '\0';
38
+ snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s",
39
+ get_version(), myname);
41
+ snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s",
44
+ xvirushdr[sizeof(xvirushdr)-1] = '\0';
46
+ descr.xxfi_flags |= SMFIF_ADDHDRS;
48
+ if (strcasecmp(pt, "Add")) { /* Replace or Yes */
49
+ descr.xxfi_flags |= SMFIF_CHGHDRS;
56
if(!(my_socket = optget(opts, "MilterSocket")->strarg)) {
57
logg("!Please configure the MilterSocket directive\n");
59
@@ -323,27 +350,6 @@ int main(int argc, char **argv) {
63
- pt = optget(opts, "AddHeader")->strarg;
64
- if(strcasecmp(pt, "No")) {
67
- if(((opt = optget(opts, "ReportHostname"))->enabled && strncpy(myname, opt->strarg, sizeof(myname))) || !gethostname(myname, sizeof(myname))) {
68
- myname[sizeof(myname)-1] = '\0';
69
- snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s", get_version(), myname);
71
- snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s", get_version());
72
- xvirushdr[sizeof(xvirushdr)-1] = '\0';
74
- descr.xxfi_flags |= SMFIF_ADDHDRS;
76
- if(strcasecmp(pt, "Add")) { /* Replace or Yes */
77
- descr.xxfi_flags |= SMFIF_CHGHDRS;
84
multircpt = optget(opts, "SupportMultipleRecipients")->enabled;
86
if(!optget(opts, "Foreground")->enabled) {