]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve logging logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Feb 2022 20:42:31 +0000 (20:42 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Feb 2022 20:42:31 +0000 (20:42 +0000)
src/libmime/archives.c

index 1673c24b4ec03132d0de3c83092f28b4bd0d5155..45fca12f2e940f00e0584b4b08f36f82408b1b0d 100644 (file)
@@ -146,11 +146,14 @@ rspamd_archive_file_try_utf (struct rspamd_task *task,
                        }
                        else {
                                g_string_append_c (res, '?');
-                               msg_info_task("non graph character in archive file name found: 0x%02xd "
-                                                         "(filename=%T)", (int)*p, arch->archive_name);
 
                                if (*p < 0x7f && (g_ascii_iscntrl(*p) || *p == '\0')) {
-                                       fentry->flags |= RSPAMD_ARCHIVE_FILE_OBFUSCATED;
+                                       if (!(fentry->flags & RSPAMD_ARCHIVE_FILE_OBFUSCATED)) {
+                                               msg_info_task("suspicious character in archive file name found: 0x%02xd "
+                                                                         "(filename=%T)",
+                                                                         (int) *p, arch->archive_name);
+                                               fentry->flags |= RSPAMD_ARCHIVE_FILE_OBFUSCATED;
+                                       }
                                }
                        }