szepeviktor / zdkimfilter Goto Github PK
View Code? Open in Web Editor NEW"z" DKIM filter for Courier-MTA using the OpenDKIM Project's library
Home Page: http://www.tana.it/sw/zdkimfilter/
License: Other
"z" DKIM filter for Courier-MTA using the OpenDKIM Project's library
Home Page: http://www.tana.it/sw/zdkimfilter/
License: Other
Hi,
There is an issue in zdkimfilter.c code. When running on my machine I get Segmentation fault error. The reason is strdup function with NULL argument. Bellow patch that fixes the issue.
diff -Nur old/src/zdkimfilter.c new/src/zdkimfilter.c
--- old/src/zdkimfilter.c 2016-03-16 22:38:54.760142821 +0100
+++ new/src/zdkimfilter.c 2016-03-16 23:29:41.851456220 +0100
@@ -772,7 +772,7 @@
choice[i].key = parm->dyn.key;
choice[i].selector = parm->dyn.selector;
- if ((choice[i].domain = strdup(parm->dyn.domain)) == NULL)
+ if (parm->dyn.domain && (choice[i].domain = strdup(parm->dyn.domain)) == NULL)
rtc = parm->dyn.rtc = -1;
parm->dyn.key = NULL;
It can be any ODBX-compatible backend (man zfilter_db) where users can add tables and fields as needed.
This topic deserves its own issue, but let it bake for the time being.
We may add Suggests: libopendbx1-*
to the control file.
No keyfile in /tests on Debian testing
# -*- compilation -*-
69. testsuite.at:1938: testing Dkimsign copies pipe to tmp ...
./testsuite.at:1941: cat mail | $VALGRIND_AND_OPTS dkimsign -f zftest.conf --filter --domain example.com -- --batch-test >mailsig.
--- -<->2016-12-04 20:56:18.962699790 +0000
+++ /opt/zdkimfilter-1.5.1/zdkimfilter-1.5/tests/testsuite.dir/at-groups/69/stderr<---->2016-12-04 20:56:18.956000000 +0000
@@ -1,5 +1 @@
-INFO: zfilter: zdkimfilter: running for dkimsign on 1 ctl + 1 mail files
-INFO: zfilter: zdkimfilter[0]:id=dkimsign: not signing for [email protected]: no key
-INFO: zfilter: zdkimfilter[0]:id=dkimsign: response: 250 not filtered.
-INFO: zfilter: 250 not filtered.
.
69. testsuite.at:1938: 69. Dkimsign copies pipe to tmp (testsuite.at:1938): FAILED (testsuite.at:1941)
@alevesely Debian testing adds -Werror=format-security
gcc -DHAVE_CONFIG_H -I. -I.. -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -I.. -g -O2 -fdebug-prefix-map=/opt/zdkimfilter-1.5.1/zdkimfilter-1.5=. -fstack-protector-strong -Wformat -Werror=format-security -c dkimsign.c
dkimsign.c: In function 'run_zdkimfilter':
dkimsign.c:268:7: error: format not a string literal and no format arguments [-Werror=format-security]
if (*p) (*do_report)(level, p);
^~
dkimsign.c:343:5: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
dup(io_pipe[0]);
^~~~~~~~~~~~~~~
dkimsign.c:356:4: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
dup(io_pipe[1]);
^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
@alevesely When calculating the signature zdkim alters the From and Reply-to headers. Could it be that the utf8 quoted printable encoding is misunderstood?
Somehow these changes do not get into the sent message but surely into the signature (because adding back these linebreaks fixes DKIM), or Courier removes the line breaks later on.
dkimsign --domain munkaugyiforum.hu --sender [email protected] --filter < received-unsigned > received-resigned
$ diff received-unsigned received-resigned
0a1,8
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=munkaugyiforum.hu;
> s=muf1208; t=1480704719;
> bh=/XGVVl/3+m8oFIq2H1Y822Zj8KkuYaLXzGOJwgfpmRU=; l=19;
> h=Date:To:From:Subject;
> b=DuREif53nqi9oinNzeaBxqeE58LTIrKrUznzdAkINSabsMLqyu7ewIuSUrATpi44a
> 9hxVjpFznKu9HKNeA7HLe/9aHcgLRiJ/zBDEaBIzGN6jrDhXWKbZjTnJjyMNTLBzQ3
> PDcgJNGSvQlz6xmM2M9zA5Wn21/icL6/94Yszpf8=
> Authentication-Results: munkaugyiforum.hu; auth=pass (details omitted)
7c15,16
< From: =?utf-8?Q?Munka=C3=BCgyi_F=C3=B3rum_Kft?= <[email protected]>
---
> From:
> =?utf-8?Q?Munka=C3=BCgyi_F=C3=B3rum_Kft?= <[email protected]>
# mail user and group (should use courier-config?)
mailuser=$(stat --printf=%U /usr/bin/mailq)
mailgroup=$(stat --printf=%G /usr/bin/mailq)
Would you mind doing it this way?
MAILUSER="$(source /etc/courier/esmtpd; echo "$MAILUSER")"
MAILGROUP="$(source /etc/courier/esmtpd; echo "$MAILGROUP")"
Hello Ale!
I've found that your filter inserts e.g. Dkim-Signature:
so filed names with sentence case.
Please see https://tools.ietf.org/html/rfc6376#section-3.5 and fix field names. (maybe other field names should be in UPPER-Case too)
Thanks.
release-notes-*
?) README AUTHORS ChangeLogdkimsign --config
debian/control
AX_CHECK_ZLIB
AC_SUBST([ZLIB_LIB])
AC_SUBST([ZLIB_CFLAGS])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.