Giter VIP home page Giter VIP logo

zdkimfilter's People

Contributors

alevesely avatar szepeviktor avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

alevesely

zdkimfilter's Issues

Segmentation fault

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;

How to define a database

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.

Test failure 069/testsuite.log

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)

format not a string literal and no format arguments

@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

Altered From header while calculating the signature

@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]>

Courier user detection

# 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")"

Have proper Debian package

  • Sort out sources: GitHub should mirror svn (not release tar-s)
  • +TravisCI should build the Debian package
  • Semver versioning
  • Dockerfile - builds directly from svn in Debian stretch
  • Debian formatted: NEWS (release-notes-* ?) README AUTHORS ChangeLog
  • Consider merging COPYING, LICENSE, LICENSE.Sendmail
  • Full config with defaults, at least the formatted output of dkimsign --config
  • Add longer extended-description in debian/control
  • There are two spec files in svn
  • zlib autoconf as below
AX_CHECK_ZLIB
AC_SUBST([ZLIB_LIB])
AC_SUBST([ZLIB_CFLAGS])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.