├── .gitattributes ├── .gitignore ├── BRANCHES ├── FEATURES ├── HowToRelease ├── INSTALL ├── KNOWNBUGS ├── LICENSE ├── LICENSE.Sendmail ├── Makefile.am ├── ProjectGuide ├── README ├── README.ERLANG ├── RELEASE_NOTES ├── RELEASE_NOTES.Sendmail ├── announcement ├── autobuild ├── .gitignore ├── Makefile.am ├── autobuild.8 ├── autobuild.c └── autobuild.conf.sample ├── build-aux ├── .gitignore └── README ├── buildtest ├── configure.ac ├── contrib ├── .gitignore ├── Makefile.am ├── README ├── convert │ ├── Makefile.am │ ├── README │ └── convert_keylist.sh ├── docs │ ├── Makefile.am │ ├── README │ └── chroot ├── init │ ├── Makefile.am │ ├── README │ ├── generic │ │ ├── Makefile.am │ │ ├── README │ │ └── opendkim │ ├── redhat │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── opendkim-default-keygen.in │ │ └── opendkim.in │ └── solaris │ │ ├── Makefile.am │ │ ├── opendkim │ │ └── opendkim.xml ├── ldap │ ├── Makefile.am │ ├── README.LDAP │ ├── example.com.ldif │ ├── opendkim.ldif │ └── opendkim.schema ├── lua │ ├── Makefile.am │ ├── README │ └── authheaders-check-setup-hook.lua ├── patches │ ├── Makefile.am │ ├── README │ └── opendkim-spam-ignore-cmdswitch.patch ├── repute │ ├── Makefile.am │ └── repute.py ├── spec │ ├── Makefile.am │ ├── README │ └── opendkim.spec.in ├── stats │ ├── Makefile.am │ ├── README │ ├── opendkim-fixipaddrs.pl │ └── stats.lua └── systemd │ ├── .gitignore │ ├── Makefile.am │ ├── README │ └── opendkim.service.in ├── copyright-check ├── docs ├── .gitignore ├── Makefile.am └── README.specs.html ├── libopendkim ├── .gitignore ├── Makefile.am ├── README ├── base32.c ├── base64.c ├── base64.h ├── dkim-atps.c ├── dkim-cache.c ├── dkim-cache.h ├── dkim-canon.c ├── dkim-canon.h ├── dkim-dns.c ├── dkim-dns.h ├── dkim-internal.h ├── dkim-keys.c ├── dkim-keys.h ├── dkim-mailparse.c ├── dkim-mailparse.h ├── dkim-report.c ├── dkim-report.h ├── dkim-tables.c ├── dkim-tables.h ├── dkim-test.c ├── dkim-test.h ├── dkim-types.h ├── dkim-util.c ├── dkim-util.h ├── dkim.c ├── dkim.h ├── docs │ ├── .gitignore │ ├── Makefile.am │ ├── dkim.html │ ├── dkim_add_querymethod.html │ ├── dkim_add_xtag.html │ ├── dkim_alg_t.html │ ├── dkim_atps_check.html │ ├── dkim_atps_t.html │ ├── dkim_body.html │ ├── dkim_canon_t.html │ ├── dkim_cbstat.html │ ├── dkim_chunk.html │ ├── dkim_close.html │ ├── dkim_diffheaders.html │ ├── dkim_dns_close.html │ ├── dkim_dns_config.html │ ├── dkim_dns_init.html │ ├── dkim_dns_nslist.html │ ├── dkim_dns_set_close.html │ ├── dkim_dns_set_config.html │ ├── dkim_dns_set_init.html │ ├── dkim_dns_set_nslist.html │ ├── dkim_dns_set_query_cancel.html │ ├── dkim_dns_set_query_service.html │ ├── dkim_dns_set_query_start.html │ ├── dkim_dns_set_query_waitreply.html │ ├── dkim_dns_set_trustanchor.html │ ├── dkim_dns_trustanchor.html │ ├── dkim_dnssec.html │ ├── dkim_eoh.html │ ├── dkim_eom.html │ ├── dkim_flush_cache.html │ ├── dkim_free.html │ ├── dkim_get_msgdate.html │ ├── dkim_get_reputation.html │ ├── dkim_get_signer.html │ ├── dkim_get_sigsubstring.html │ ├── dkim_get_user_context.html │ ├── dkim_getcachestats.html │ ├── dkim_getdomain.html │ ├── dkim_geterror.html │ ├── dkim_getid.html │ ├── dkim_getmode.html │ ├── dkim_getpartial.html │ ├── dkim_getresultstr.html │ ├── dkim_getsighdr.html │ ├── dkim_getsighdr_d.html │ ├── dkim_getsiglist.html │ ├── dkim_getsignature.html │ ├── dkim_getsslbuf.html │ ├── dkim_getuser.html │ ├── dkim_header.html │ ├── dkim_init.html │ ├── dkim_key_syntax.html │ ├── dkim_lib.html │ ├── dkim_libfeature.html │ ├── dkim_libversion.html │ ├── dkim_mail_parse.html │ ├── dkim_mail_parse_multi.html │ ├── dkim_minbody.html │ ├── dkim_ohdrs.html │ ├── dkim_options.html │ ├── dkim_param_t.html │ ├── dkim_privkey_load.html │ ├── dkim_qi_getname.html │ ├── dkim_qi_gettype.html │ ├── dkim_query_t.html │ ├── dkim_queryinfo.html │ ├── dkim_resign.html │ ├── dkim_set_dns_callback.html │ ├── dkim_set_final.html │ ├── dkim_set_key_lookup.html │ ├── dkim_set_margin.html │ ├── dkim_set_prescreen.html │ ├── dkim_set_signature_handle.html │ ├── dkim_set_signature_handle_free.html │ ├── dkim_set_signature_tagvalues.html │ ├── dkim_set_signer.html │ ├── dkim_set_trust_anchor.html │ ├── dkim_set_user_context.html │ ├── dkim_setpartial.html │ ├── dkim_sig_getbh.html │ ├── dkim_sig_getcanonlen.html │ ├── dkim_sig_getcanons.html │ ├── dkim_sig_getcontext.html │ ├── dkim_sig_getdnssec.html │ ├── dkim_sig_getdomain.html │ ├── dkim_sig_geterror.html │ ├── dkim_sig_geterrorstr.html │ ├── dkim_sig_getflags.html │ ├── dkim_sig_gethashes.html │ ├── dkim_sig_getidentity.html │ ├── dkim_sig_getkeysize.html │ ├── dkim_sig_getqueries.html │ ├── dkim_sig_getreportinfo.html │ ├── dkim_sig_getselector.html │ ├── dkim_sig_getsignalg.html │ ├── dkim_sig_getsignedhdrs.html │ ├── dkim_sig_getsigntime.html │ ├── dkim_sig_getsslbuf.html │ ├── dkim_sig_gettagvalue.html │ ├── dkim_sig_hdrsigned.html │ ├── dkim_sig_ignore.html │ ├── dkim_sig_process.html │ ├── dkim_sig_setdnssec.html │ ├── dkim_sig_seterror.html │ ├── dkim_sig_syntax.html │ ├── dkim_sigerror.html │ ├── dkim_siginfo.html │ ├── dkim_sigkey_t.html │ ├── dkim_sign.html │ ├── dkim_signhdrs.html │ ├── dkim_ssl_version.html │ ├── dkim_stat.html │ ├── dkim_verify.html │ ├── dns.html │ ├── index.html │ └── overview.html ├── opendkim.pc.in ├── tests │ ├── .gitignore │ ├── Makefile.am │ ├── gcov-helper.sh │ ├── lcov-helper.sh │ ├── lcov │ │ ├── .gitignore │ │ └── README │ ├── t-cleanup.c │ ├── t-setup.c │ ├── t-signperf-relaxed-relaxed │ ├── t-signperf-sha1 │ ├── t-signperf-simple-simple │ ├── t-signperf.c │ ├── t-test00.c │ ├── t-test01.c │ ├── t-test02.c │ ├── t-test03.c │ ├── t-test04.c │ ├── t-test05.c │ ├── t-test06.c │ ├── t-test07.c │ ├── t-test08.c │ ├── t-test09.c │ ├── t-test10.c │ ├── t-test100.c │ ├── t-test101.c │ ├── t-test102.c │ ├── t-test103.c │ ├── t-test104.c │ ├── t-test105.c │ ├── t-test106.c │ ├── t-test107.c │ ├── t-test108.c │ ├── t-test109.c │ ├── t-test11.c │ ├── t-test110.c │ ├── t-test111.c │ ├── t-test112.c │ ├── t-test113.c │ ├── t-test114.c │ ├── t-test115.c │ ├── t-test116.c │ ├── t-test117.c │ ├── t-test118.c │ ├── t-test119.c │ ├── t-test12.c │ ├── t-test120.c │ ├── t-test121.c │ ├── t-test122.c │ ├── t-test123.c │ ├── t-test125.c │ ├── t-test126.c │ ├── t-test127.c │ ├── t-test128.c │ ├── t-test129.c │ ├── t-test13.c │ ├── t-test130.c │ ├── t-test131.c │ ├── t-test132.c │ ├── t-test133.c │ ├── t-test134.c │ ├── t-test135.c │ ├── t-test136.c │ ├── t-test137.c │ ├── t-test138.c │ ├── t-test139.c │ ├── t-test14.c │ ├── t-test140.c │ ├── t-test141.c │ ├── t-test142.c │ ├── t-test143.c │ ├── t-test144.c │ ├── t-test145.c │ ├── t-test146.c │ ├── t-test147.c │ ├── t-test148.c │ ├── t-test149.c │ ├── t-test15.c │ ├── t-test150.c │ ├── t-test151.c │ ├── t-test152.c │ ├── t-test153.c │ ├── t-test154.c │ ├── t-test16.c │ ├── t-test17.c │ ├── t-test18.c │ ├── t-test19.c │ ├── t-test20.c │ ├── t-test21.c │ ├── t-test22.c │ ├── t-test23.c │ ├── t-test24.c │ ├── t-test25.c │ ├── t-test26.c │ ├── t-test27.c │ ├── t-test28.c │ ├── t-test29.c │ ├── t-test30.c │ ├── t-test31.c │ ├── t-test32.c │ ├── t-test33.c │ ├── t-test34.c │ ├── t-test35.c │ ├── t-test36.c │ ├── t-test37.c │ ├── t-test38.c │ ├── t-test39.c │ ├── t-test40.c │ ├── t-test41.c │ ├── t-test42.c │ ├── t-test43.c │ ├── t-test44.c │ ├── t-test45.c │ ├── t-test46.c │ ├── t-test47.c │ ├── t-test48.c │ ├── t-test49.c │ ├── t-test50.c │ ├── t-test51.c │ ├── t-test52.c │ ├── t-test53.c │ ├── t-test54.c │ ├── t-test55.c │ ├── t-test56.c │ ├── t-test57.c │ ├── t-test58.c │ ├── t-test59.c │ ├── t-test60.c │ ├── t-test61.c │ ├── t-test62.c │ ├── t-test63.c │ ├── t-test64.c │ ├── t-test65.c │ ├── t-test66.c │ ├── t-test67.c │ ├── t-test68.c │ ├── t-test69.c │ ├── t-test70.c │ ├── t-test71.c │ ├── t-test72.c │ ├── t-test73.c │ ├── t-test74.c │ ├── t-test75.c │ ├── t-test76.c │ ├── t-test77.c │ ├── t-test78.c │ ├── t-test79.c │ ├── t-test80.c │ ├── t-test81.c │ ├── t-test82.c │ ├── t-test83.c │ ├── t-test84.c │ ├── t-test85.c │ ├── t-test86.c │ ├── t-test87.c │ ├── t-test88.c │ ├── t-test89.c │ ├── t-test90.c │ ├── t-test91.c │ ├── t-test92.c │ ├── t-test93.c │ ├── t-test94.c │ ├── t-test95.c │ ├── t-test96.c │ ├── t-test97.c │ ├── t-test98.c │ ├── t-test99.c │ ├── t-testdata.h │ └── t-verifyperf.c ├── util.c └── util.h ├── librbl ├── Makefile.am ├── rbl.3 ├── rbl.c ├── rbl.h └── rbl.pc.in ├── libut ├── .gitignore ├── Makefile.am ├── ut.3 ├── ut.c ├── ut.h └── ut.pc.in ├── libvbr ├── .gitignore ├── Makefile.am ├── vbr.3 ├── vbr.c ├── vbr.h └── vbr.pc.in ├── m4 ├── .gitignore └── ac_pthread.m4 ├── miltertest ├── .gitignore ├── Makefile.am ├── miltertest.8 └── miltertest.c ├── opendkim ├── .gitignore ├── Makefile.am ├── README ├── README.SQL ├── autorespond.csh ├── config.c ├── config.h ├── final.lua.sample ├── flowrate.c ├── flowrate.h ├── opendkim-ar.c ├── opendkim-ar.h ├── opendkim-arf.c ├── opendkim-arf.h ├── opendkim-atpszone.8.in ├── opendkim-atpszone.c ├── opendkim-config.h ├── opendkim-crypto.c ├── opendkim-crypto.h ├── opendkim-db.c ├── opendkim-db.h ├── opendkim-dns.c ├── opendkim-dns.h ├── opendkim-genkey.8.in ├── opendkim-genkey.in ├── opendkim-genzone.8.in ├── opendkim-genzone.c ├── opendkim-lua.3.in ├── opendkim-lua.c ├── opendkim-lua.h ├── opendkim-spam.1.in ├── opendkim-spam.c ├── opendkim-stats.8.in ├── opendkim-stats.c ├── opendkim-testkey.8.in ├── opendkim-testkey.c ├── opendkim-testmsg.8.in ├── opendkim-testmsg.c ├── opendkim.8.in ├── opendkim.c ├── opendkim.conf.5.in ├── opendkim.conf.sample ├── opendkim.conf.simple-verify.in ├── opendkim.conf.simple.in ├── opendkim.h ├── reputation.c ├── reputation.h ├── screen.lua.sample ├── setup.lua.sample ├── stats.c ├── stats.h ├── test.c ├── test.h ├── tests │ ├── .gitignore │ ├── Makefile.am │ ├── README │ ├── cp-test │ ├── gcov-helper.sh │ ├── lcov-helper.sh │ ├── lcov │ │ ├── .gitignore │ │ └── README │ ├── pubkeys │ ├── t-conf-check │ ├── t-conf-check.conf │ ├── t-conf-check.keytable │ ├── t-conf-check.lua │ ├── t-conf-check.signtable │ ├── t-conf-check2.conf │ ├── t-conf-check2.keytable │ ├── t-conf-check2.lua │ ├── t-conf-check2.signtable │ ├── t-dontsign │ ├── t-dontsign.conf │ ├── t-dontsign.lua │ ├── t-largecomment.conf │ ├── t-lua-rbl │ ├── t-lua-rbl.conf │ ├── t-lua-rbl.lua │ ├── t-lua-rbl.lua-final │ ├── t-lua-speed │ ├── t-lua-speed-lua.conf │ ├── t-lua-speed-lua.lua │ ├── t-lua-speed-lua.lua-setup │ ├── t-lua-speed-nolua.conf │ ├── t-lua-speed-nolua.lua │ ├── t-lua-verify-tests │ ├── t-lua-verify-tests.conf │ ├── t-lua-verify-tests.lua │ ├── t-lua-verify-tests.lua-setup │ ├── t-peer │ ├── t-peer.conf │ ├── t-peer.list │ ├── t-peer.lua │ ├── t-sign-atps │ ├── t-sign-atps.conf │ ├── t-sign-atps.lua │ ├── t-sign-report │ ├── t-sign-report.conf │ ├── t-sign-report.lua │ ├── t-sign-rs │ ├── t-sign-rs-lua │ ├── t-sign-rs-lua.conf │ ├── t-sign-rs-lua.keys │ ├── t-sign-rs-lua.lua │ ├── t-sign-rs-lua.lua-setup │ ├── t-sign-rs-lua.sign │ ├── t-sign-rs-mixconf │ ├── t-sign-rs-mixconf.conf │ ├── t-sign-rs-mixconf.keys │ ├── t-sign-rs-mixconf.lua │ ├── t-sign-rs-mixconf.lua-setup │ ├── t-sign-rs-multiple │ ├── t-sign-rs-multiple.conf │ ├── t-sign-rs-multiple.keys │ ├── t-sign-rs-multiple.lua │ ├── t-sign-rs-multiple.sign │ ├── t-sign-rs-tables │ ├── t-sign-rs-tables-bad │ ├── t-sign-rs-tables-bad.conf │ ├── t-sign-rs-tables-bad.keys │ ├── t-sign-rs-tables-bad.lua │ ├── t-sign-rs-tables-token │ ├── t-sign-rs-tables-token.conf │ ├── t-sign-rs-tables-token.keys │ ├── t-sign-rs-tables-token.lua │ ├── t-sign-rs-tables.conf │ ├── t-sign-rs-tables.keys │ ├── t-sign-rs-tables.lua │ ├── t-sign-rs-tables.sign │ ├── t-sign-rs.conf │ ├── t-sign-rs.lua │ ├── t-sign-ss │ ├── t-sign-ss-all │ ├── t-sign-ss-all.conf │ ├── t-sign-ss-all.lua │ ├── t-sign-ss-ltag │ ├── t-sign-ss-ltag.conf │ ├── t-sign-ss-ltag.lua │ ├── t-sign-ss-macro │ ├── t-sign-ss-macro-value │ ├── t-sign-ss-macro-value-file │ ├── t-sign-ss-macro-value-file.conf │ ├── t-sign-ss-macro-value-file.list │ ├── t-sign-ss-macro-value-file.lua │ ├── t-sign-ss-macro-value.conf │ ├── t-sign-ss-macro-value.lua │ ├── t-sign-ss-macro.conf │ ├── t-sign-ss-macro.lua │ ├── t-sign-ss-replace │ ├── t-sign-ss-replace.conf │ ├── t-sign-ss-replace.lua │ ├── t-sign-ss-replace.txt │ ├── t-sign-ss-x │ ├── t-sign-ss-x.conf │ ├── t-sign-ss-x.lua │ ├── t-sign-ss.conf │ ├── t-sign-ss.lua │ ├── t-verify-double-from │ ├── t-verify-double-from.conf │ ├── t-verify-double-from.lua │ ├── t-verify-malformed │ ├── t-verify-malformed.conf │ ├── t-verify-malformed.lua │ ├── t-verify-report │ ├── t-verify-report.conf │ ├── t-verify-report.lua │ ├── t-verify-report.txt │ ├── t-verify-revoked │ ├── t-verify-revoked.conf │ ├── t-verify-revoked.lua │ ├── t-verify-ss │ ├── t-verify-ss-ar-bad │ ├── t-verify-ss-ar-bad.conf │ ├── t-verify-ss-ar-bad.lua │ ├── t-verify-ss-atps │ ├── t-verify-ss-atps.conf │ ├── t-verify-ss-atps.lua │ ├── t-verify-ss-bad │ ├── t-verify-ss-bad.conf │ ├── t-verify-ss-bad.lua │ ├── t-verify-ss-rep │ ├── t-verify-ss-rep.conf │ ├── t-verify-ss-rep.lua │ ├── t-verify-ss.conf │ ├── t-verify-ss.lua │ ├── t-verify-syntax │ ├── t-verify-syntax.conf │ ├── t-verify-syntax.lua │ ├── t-verify-unsigned │ ├── t-verify-unsigned-silent │ ├── t-verify-unsigned-silent.conf │ ├── t-verify-unsigned-silent.lua │ ├── t-verify-unsigned.conf │ ├── t-verify-unsigned.lua │ ├── t-verify-unspec │ ├── t-verify-unspec.conf │ ├── t-verify-unspec.lua │ ├── testkey.private │ └── testmta ├── util.c └── util.h ├── reprrd ├── .gitignore ├── Makefile.am ├── README ├── opendkim-reprrdimport.8.in ├── opendkim-reprrdimport.in ├── reprrd-config.php ├── reprrd.c ├── reprrd.h ├── reprrd.pc.in └── reprrd.php ├── reputation ├── .gitignore ├── Makefile.am ├── README ├── mkdb-rep.mysql ├── opendkim-genrates.8.in ├── opendkim-genrates.in ├── opendkim-modtotals.8.in ├── opendkim-modtotals.in ├── opendkim-rephistory.8.in ├── opendkim-rephistory.in ├── repute-config.php ├── repute.c ├── repute.h ├── repute.pc.in └── repute.php └── stats ├── .gitignore ├── Makefile.am ├── README ├── README.opendkim-reportstats ├── mkdb.mysql ├── opendkim-expire.8.in ├── opendkim-expire.in ├── opendkim-gengraphs.8.in ├── opendkim-gengraphs.in ├── opendkim-genstats.8.in ├── opendkim-genstats.in ├── opendkim-importstats.8.in ├── opendkim-importstats.c └── opendkim-reportstats.in /.gitattributes: -------------------------------------------------------------------------------- 1 | www/ export-ignore 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | *.orig 10 | *.rej 11 | t-*[0-9] 12 | t-verifyperf 13 | t-signperf 14 | t-cleanup 15 | t-setup 16 | .deps/ 17 | .libs/ 18 | autom4te.cache/ 19 | autoscan-*.log 20 | build-config.h.in 21 | compile 22 | config.guess 23 | config.sub 24 | configure 25 | configure.scan 26 | configure.lineno 27 | aclocal.m4 28 | depcomp 29 | install-sh 30 | missing 31 | stamp-h* 32 | build-config.h 33 | config.log 34 | config.status 35 | ltmain.sh 36 | libtool 37 | Makefile.in 38 | Makefile 39 | *.tar.gz 40 | *.tar.gz.md5 41 | *.tar.gz.sha1 42 | *.tar.gz.asc 43 | tags 44 | .deps 45 | autom4te.cache 46 | core 47 | *.core 48 | build-aux 49 | opendkim-[0-9].[0-9].[0-9] 50 | -------------------------------------------------------------------------------- /HowToRelease: -------------------------------------------------------------------------------- 1 | Release procedures for OpenDKIM 2 | 3 | 0) Run "./copyright-check" to ensure anything updated in the current year has 4 | a current copyright notice in it. 5 | 6 | 1) Edit configure.ac so that the new release number is formed with the 7 | VERSION_RELEASE* macros. 8 | 9 | 2) In the root build directory, do these things: 10 | 11 | % make distclean 12 | % autoreconf 13 | % ./configure 14 | % make 15 | % make distcheck 16 | 17 | This will produce an opendkim-(version).tar.gz tarball after running 18 | all unit tests. 19 | 20 | 3) Commit changes made to RELEASE_NOTES to the SourceForge git repository. 21 | Be sure to include any open feature requests, patches or bug fixes 22 | from the SourceForge trackers. 23 | 24 | 4) Prepare a release announcement by using the file "announcement" from git 25 | as your template. Change the From: to the name and address of the person 26 | making the announcement. Make sure that address has permissions to post 27 | to opendkim-users and opendkim-announce. There should be a paragraph 28 | or two at the top highlighting the interesting changes and indicating 29 | what the main focus of this release is (new features, bug fixes, etc.), 30 | and then the full RELEASE_NOTES block for the new release. Commit this 31 | to git. 32 | 33 | 5) Merge the "develop" branch to the "master" branch, as follows: 34 | 35 | % git checkout master 36 | % git merge develop 37 | [massage in and commit any conflicts] 38 | % git push 39 | 40 | 6) Deploy all needed files to SourceForge by doing 'make push'. This will 41 | also place the release tag. 42 | 43 | 7) Via the SourceForge UI, make the latest tarball the default download for 44 | all operating systems. 45 | 46 | 8) Send the release announcement: 47 | 48 | % sendmail -t < announcement 49 | 50 | 9) Mark any bug fixes or feature requests, etc. as closed if this release 51 | contained them. 52 | -------------------------------------------------------------------------------- /KNOWNBUGS: -------------------------------------------------------------------------------- 1 | 2 | 3 | K N O W N B U G S I N O P E N D K I M 4 | 5 | 6 | The following are bugs or deficiencies in the OpenDKIM package that we 7 | are aware of but which have not been fixed in the current release. You 8 | probably want to get the most up to date version of this from 9 | http://www.opendkim.org. For descriptions of bugs that 10 | have been fixed, see the file RELEASE_NOTES. 11 | 12 | This list is not guaranteed to be complete. Check the OpenDKIM web site for 13 | additional pending bugs and feature requests. 14 | 15 | 16 | SIGNATURE HEADER TRUNCATION 17 | 18 | The sendmail MTA caps the length of headers to prevent a known MIME 19 | header attack. Unfortunately this can interfere with processing of a 20 | sufficiently large DKIM-Signature header. If you are getting failures 21 | on large signature headers which should otherwise be passing, consider 22 | adjusting the value of the MaxMimeHeaderLength option to a larger value 23 | (or to 0 which removes the limit). See the sendmail MTA configuration 24 | documentation for more information. 25 | 26 | 27 | $Revision: 1.1 $, Last updated $Date: 2009/07/16 18:42:55 $ 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, 2010, 2012, 2013, The Trusted Domain Project. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of The Trusted Domain Project nor the names of its 12 | contributors may be used to endorse or promote products derived from 13 | this software without specific prior written permission. 14 | 15 | Portions of this project are also covered by the Sendmail Open Source 16 | License, available in this distribution in the file "LICENSE.Sendmail". 17 | See the copyright notice(s) in each file to determine whether it is covered 18 | by either or both of the licenses. For example: 19 | 20 | Copyright (c) Sendmail, Inc. and its suppliers. 21 | All rights reserved. 22 | 23 | Files bearing the banner above are covered under the Sendmail Open Source 24 | License (see LICENSE.Sendmail). 25 | 26 | Copyright (c) , The Trusted Domain Project. 27 | All rights reserved. 28 | 29 | Files bearing the banner above are covered under the Trusted Domain Project 30 | License (above). 31 | 32 | Files bearing both banners are covered under both sets of license terms. 33 | 34 | THIS SOFTWARE IS PROVIDED BY THE TRUSTED DOMAIN PROJECT ''AS IS'' AND ANY 35 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 36 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 37 | DISCLAIMED. IN NO EVENT SHALL THE TRUSTED DOMAIN PROJECT BE LIABLE FOR ANY 38 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2014, The Trusted Domain Project. All rights reserved. 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | ACLOCAL_AMFLAGS = -I m4 5 | 6 | SUBDIRS = 7 | SUBDIRS += libopendkim contrib docs 8 | if VBR 9 | SUBDIRS += libvbr 10 | endif 11 | if RBL 12 | SUBDIRS += librbl 13 | endif 14 | if LUA 15 | SUBDIRS += miltertest 16 | endif 17 | if STATS 18 | SUBDIRS += stats 19 | endif 20 | if REPUTE 21 | SUBDIRS += libut reputation 22 | endif 23 | if REPRRD 24 | SUBDIRS += reprrd 25 | endif 26 | if JANSSON 27 | SUBDIRS += autobuild 28 | endif 29 | SUBDIRS += opendkim 30 | dist_doc_DATA = FEATURES KNOWNBUGS LICENSE LICENSE.Sendmail \ 31 | RELEASE_NOTES.Sendmail 32 | dist_noinst_SCRIPTS = libtool 33 | 34 | DISTCLEANFILES = opendkim-@VERSION@.tar.gz 35 | 36 | # TODO: get configure.ac to generate --enable-{feature} for all 37 | # non-experimental features and substitute it here e.g @SUPPORTED_FEATURES@. 38 | # Perhaps all features would enable a more comprehensive test coverage map 39 | # though. 40 | DISTCHECK_CONFIGURE_FLAGS=--enable-vbr --with-lua --enable-stats --with-odbx --with-db --with-openssl=/usr/local --enable-atps --enable-replace_rules 41 | 42 | $(DIST_ARCHIVES): distcheck 43 | 44 | $(DIST_ARCHIVES).md5: $(DIST_ARCHIVES) 45 | md5 $? > $@ || md5sum $? > $@ 46 | 47 | $(DIST_ARCHIVES).sha1: $(DIST_ARCHIVES) 48 | sha1 $? > $@ || sha1sum $? > $@ 49 | 50 | $(DIST_ARCHIVES).asc: $(DIST_ARCHIVES) 51 | gpg -a -u security@opendkim.org --detach-sign $? 52 | 53 | push: $(DIST_ARCHIVES) $(DIST_ARCHIVES).sha1 $(DIST_ARCHIVES).md5 $(DIST_ARCHIVES).asc 54 | @echo "Are you sure you want to tag and release $(DIST_ARCHIVES)? (y/n)" 55 | @read confirm && [ $$confirm = 'y' ] 56 | git tag rel-opendkim-`echo $(VERSION) | sed 's/\./-/g'` 57 | git push --tags 58 | scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sha1 $(DIST_ARCHIVES).md5 $(DIST_ARCHIVES).asc RELEASE_NOTES cm-msk,opendkim@frs.sourceforge.net:/home/frs/project/o/op/opendkim/ 59 | 60 | dist-hook: 61 | [ -f $(distdir)/libopendkim/dkim.h ] && rm -f $(distdir)/libopendkim/dkim.h 62 | sed -e '/OPENDKIM_LIB_VERSION/s/0x[0-9]*/0x@HEX_VERSION@/' < $(srcdir)/libopendkim/dkim.h > $(distdir)/libopendkim/dkim.h 63 | echo "looking to see if @VERSION@ is in the RELEASE_NOTES" 64 | fgrep @VERSION@ $(srcdir)/RELEASE_NOTES 65 | sed -e 's|\(@VERSION@[ \t]*\)[0-9?]\{4\}\(/[0-9?]\{2\}\)\{2\}|\1'`date +%Y/%m/%d`'|' < $(srcdir)/RELEASE_NOTES > $(distdir)/RELEASE_NOTES 66 | 67 | .PHONY: push 68 | -------------------------------------------------------------------------------- /announcement: -------------------------------------------------------------------------------- 1 | From: Murray S. Kucherawy 2 | To: opendkim-announce@lists.opendkim.org, opendkim-users@lists.opendkim.org 3 | Subject: OpenDKIM v2.10.3 released 4 | 5 | The Trusted Domain Project announces availability of OpenDKIM v2.10.3, 6 | now available for download from SourceForge. 7 | 8 | This release fixes a problem with strict header checking that was introduced in 9 | 2.10.0 which resulted in generation of faulty signatures. Upgrade is necessary 10 | only if you are using that feature. 11 | 12 | The full RELEASE_NOTES for this version: 13 | 14 | 2.10.3 2015/05/12 15 | LIBOPENDKIM: Make strict header checking non-destructive. The last change 16 | to this code resulted in failing signatures. Reported by Pedro 17 | Morales and Wez Furlong. 18 | 19 | Please use the mailing lists at http://lists.opendkim.org/ to report problems. 20 | Bug reports and feature requests can be made through the project trackers, 21 | which can be found via http://www.opendkim.org. 22 | 23 | The Trusted Domain Project 24 | -------------------------------------------------------------------------------- /autobuild/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | .deps/ 10 | .libs/ 11 | autom4te.cache/ 12 | core 13 | *.core 14 | autobuild 15 | -------------------------------------------------------------------------------- /autobuild/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2012, 2014, The Trusted Domain Project. 2 | # All rights reserved. 3 | 4 | # what flags you want to pass to the C compiler & linker 5 | #AM_CFLAGS = --pedantic -Wall -O2 6 | 7 | # this lists the binaries to produce, the (non-PHONY, binary) targets in 8 | # the previous manual Makefile 9 | if JANSSON 10 | bin_PROGRAMS = autobuild 11 | 12 | autobuild_SOURCES = autobuild.c 13 | autobuild_CPPFLAGS = $(LIBJANSSON_CPPFLAGS) 14 | autobuild_LDFLAGS = $(LIBJANSSON_LDFLAGS) 15 | autobuild_LDADD = $(LIBJANSSON_LIBS) -lm 16 | 17 | man_MANS = autobuild.8 18 | dist_doc_DATA = autobuild.conf.sample 19 | endif 20 | 21 | EXTRA_DIST = autobuild.8 autobuild.conf.sample 22 | -------------------------------------------------------------------------------- /autobuild/autobuild.conf.sample: -------------------------------------------------------------------------------- 1 | { 2 | "always": [ 3 | "--with-openssl=/usr/local", 4 | "--with-milter=/usr/local" 5 | ], 6 | 7 | "combine": [ 8 | "--enable-debug", 9 | "--disable-shared", 10 | "--with-odbx", 11 | [ 12 | "--enable-rbl", 13 | "--enable-stats", 14 | "--enable-statsext", 15 | "--with-lua" 16 | ], 17 | "--enable-diffheaders", 18 | "--enable-vbr", 19 | "--enable-atps", 20 | "--enable-poll", 21 | "--with-unbound", 22 | "--enable-replace_rules", 23 | "--with-libmemcached", 24 | "--enable-rate_limit", 25 | "--enable-reputation", 26 | "--enable-dkim_reputation", 27 | "--with-openldap", 28 | "--enable-resign" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /build-aux/.gitignore: -------------------------------------------------------------------------------- 1 | [cdilm]* 2 | -------------------------------------------------------------------------------- /build-aux/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is a placeholder for scripts generated during or required 3 | by the build process. 4 | -------------------------------------------------------------------------------- /buildtest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # buildtest -- build and test with numerous option combinations 4 | # 5 | 6 | # configuration 7 | module="opendkim" 8 | version="$1" 9 | buildtop="`echo $1 | sed 's/-[A-Za-z0-9]*//g'`" 10 | download="http://downloads.sourceforge.net/project/${module}/${module}-${version}.tar.gz" 11 | buildroot=/var/tmp 12 | 13 | # setup 14 | buildtime="`date +%Y%m%d%H%M%S`" 15 | buildname="${module}-${buildtime}" 16 | builddir="${buildroot}/${buildname}" 17 | 18 | # create directories 19 | mkdir $builddir 20 | cd $builddir 21 | 22 | # download and unpack 23 | wget -q $download 24 | gunzip -c `basename $download` | tar xf - 25 | cd ${module}-${buildtop} 26 | 27 | for i in --enable-filter \ 28 | --with-db \ 29 | --with-odbx \ 30 | --with-tre \ 31 | --with-unbound \ 32 | --enable-allsymbols \ 33 | --enable-bodylengthdb \ 34 | --enable-capture_unknown_errors \ 35 | --enable-diffheaders \ 36 | --enable-dkim_reputation \ 37 | --enable-dnsupgrade \ 38 | --enable-identity_header \ 39 | --enable-parsetime \ 40 | --enable-redirect \ 41 | --enable-replace_rules \ 42 | --enable-report_intervals \ 43 | --enable-resign \ 44 | --enable-select_canonicalization \ 45 | --enable-selector_header \ 46 | --enable-sender_macro \ 47 | --enable-stats \ 48 | --enable-vbr \ 49 | --enable-ztags 50 | do 51 | 52 | # configure 53 | ./configure $CONFIG_OPTS $i > configure.out 2>&1 54 | if test $? != 0 55 | then 56 | echo "${buildname} ./configure error" 57 | tail -20 configure.out 58 | exit 1 59 | fi 60 | 61 | # make 62 | make > make.out 2>&1 63 | if test $? != 0 64 | then 65 | echo "${buildname} make error" 66 | tail -20 make.out 67 | exit 1 68 | fi 69 | 70 | # make check 71 | make check > make.out 2>&1 72 | if test $? != 0 73 | then 74 | echo "${buildname} make check error" 75 | tail -20 make.out 76 | exit 1 77 | fi 78 | 79 | # make clean 80 | rm make.out configure.out 81 | make clean > /dev/null 2>&1 82 | done 83 | 84 | cd $HOME 85 | rm -rf $builddir 86 | exit 0 87 | -------------------------------------------------------------------------------- /contrib/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | opendkim.spec 4 | -------------------------------------------------------------------------------- /contrib/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | SUBDIRS = convert docs init ldap lua patches repute spec stats systemd 7 | 8 | dist_doc_DATA = README 9 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | This "contrib" directory of The Trusted Domain Project and its subdirectories 2 | contain files contributed by members of the community that provide functions 3 | not directly supported by the project team. The copyrights on the files in 4 | and/or below this directory are owned by the files' owners and not by 5 | The Trusted Domain Project. 6 | 7 | Support for files contained here are provided only on a best-effort basis by 8 | the project team and by the files' owners. 9 | 10 | -- 11 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 12 | 13 | -------------------------------------------------------------------------------- /contrib/convert/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = convert_keylist.sh 7 | -------------------------------------------------------------------------------- /contrib/convert/README: -------------------------------------------------------------------------------- 1 | This directory contains configuration file conversion scripts that are useful 2 | when upgrading between certain major releases of OpenDKIM. They are supported 3 | by their respective authors. 4 | 5 | Please submit bug reports and feature requests to 6 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 7 | 8 | -- 9 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 10 | -------------------------------------------------------------------------------- /contrib/convert/convert_keylist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # (c)2010 Mike Markley . Licensed under the same terms as the 5 | # OpenDKIM distribution (see ../LICENSE). 6 | 7 | force=0 8 | while [ -n "$1" ]; do 9 | if [ "$1" = "-f" ]; then 10 | force=1 11 | else 12 | file="$1" 13 | fi 14 | shift 15 | done 16 | 17 | if [ -z "$file" ]; then 18 | echo -n "Configuration or key list file: " 19 | read file 20 | fi 21 | 22 | if [ ! -e "$file" ]; then 23 | echo "$0: $file: file not found" >&2 24 | exit 1 25 | fi 26 | 27 | if grep -iq "^keylist" "$file"; then 28 | KEYLIST="$(grep -i "^keylist" "$file" | awk '{ print $2 }')" 29 | echo "Found OpenDKIM configuration file; using $KEYLIST as key list file" 30 | else 31 | # Assume we were passed a KeyList otherwise 32 | KEYLIST="$file" 33 | fi 34 | 35 | if [ -z "$KEYLIST" ]; then 36 | echo "$0: KeyList input file must be specified." >&2 37 | exit 1 38 | fi 39 | 40 | echo -n "Output file for KeyTable: " 41 | read KEYTABLE 42 | if [ -z "$KEYTABLE" ]; then 43 | echo "$0: KeyTable output file must be specified." >&2 44 | exit 1 45 | fi 46 | if [ -e "$KEYTABLE" -a $force -ne 1 ]; then 47 | echo "$0: refusing to overwrite $KEYTABLE" >&2 48 | exit 1 49 | fi 50 | echo -n > $KEYTABLE 51 | 52 | echo -n "Output file for SigningTable: " 53 | read SIGNINGTABLE 54 | if [ -z "$SIGNINGTABLE" ]; then 55 | echo "$0: SigningTable output file must be specified." >&2 56 | exit 1 57 | fi 58 | if [ -e "$SIGNINGTABLE" -a $force -ne 1 ]; then 59 | echo "$0: refusing to overwrite $SIGNINGTABLE" >&2 60 | exit 1 61 | fi 62 | echo -n > $SIGNINGTABLE 63 | 64 | while read line; do 65 | addresspat=$(echo $line | cut -d: -f1) 66 | domain=$(echo $line | cut -d: -f2) 67 | key=$(echo $line | cut -d: -f3) 68 | selector=$(basename $key) 69 | keyname="${selector}._domainkey.$domain" 70 | keyfile="" 71 | for f in "$key" "${key}.pem" "${key}.private"; do 72 | if [ -e "$f" ]; then 73 | keyfile="$f" 74 | fi 75 | done 76 | if [ -z "$keyfile" ]; then 77 | echo "Warning: Could not find private key file for $key (no privileges?)" >&2 78 | keyfile="$key" 79 | fi 80 | echo "$addresspat $keyname" >> $SIGNINGTABLE 81 | echo "$keyname $domain:$selector:$keyfile" >> $KEYTABLE 82 | done < "$KEYLIST" 83 | 84 | echo "Done; please add these options to your configuration file (and remove the KeyList entry):" 85 | echo "KeyTable file:$KEYTABLE" 86 | echo "SigningTable refile:$SIGNINGTABLE" 87 | -------------------------------------------------------------------------------- /contrib/docs/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = chroot 7 | -------------------------------------------------------------------------------- /contrib/docs/README: -------------------------------------------------------------------------------- 1 | This directory contains miscellaneous contributed documentation that may be 2 | of use to sites installing OpenDKIM. They are maintained by their respective 3 | authors. 4 | 5 | Please submit bug reports and feature requests to 6 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 7 | 8 | -- 9 | Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 10 | -------------------------------------------------------------------------------- /contrib/init/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | AUTOMAKE_OPTIONS = foreign 5 | 6 | SUBDIRS = generic redhat solaris 7 | 8 | #dist_doc_DATA = README 9 | -------------------------------------------------------------------------------- /contrib/init/README: -------------------------------------------------------------------------------- 1 | The directories below here contain start/stop scripts or their equivalents 2 | for various architectures. They are supported by their respective authors. 3 | 4 | Please submit bug reports and feature requests to 5 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 6 | 7 | -- 8 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 9 | -------------------------------------------------------------------------------- /contrib/init/generic/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = opendkim 7 | -------------------------------------------------------------------------------- /contrib/init/generic/README: -------------------------------------------------------------------------------- 1 | This directory contains a generic start/stop script that can be used on 2 | most UNIX systems to automate control of the opendkim filter. 3 | 4 | To install, copy it to /etc/init.d/opendkim, and ensure its mode is 0755. 5 | Then, follow the section below appropriate to your system. If you don't see 6 | your system listed, we would appreciate receiving from you instructions 7 | specific to your system once you get it working so that others who come 8 | after you can have helpful instructions. 9 | 10 | Please submit bug reports and feature requests to 11 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 12 | 13 | 14 | RHEL-based and SLES-based Linux systems: 15 | 16 | Execute "chkconfig --add opendkim" as root. This will read parameters found 17 | in the script and set up symbolic links under /etc/rc.d so that the filter 18 | is automatically started and stopped as needed. 19 | 20 | -- 21 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 22 | -------------------------------------------------------------------------------- /contrib/init/redhat/.gitignore: -------------------------------------------------------------------------------- 1 | opendkim 2 | opendkim-default-keygen 3 | -------------------------------------------------------------------------------- /contrib/init/redhat/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, 2013, The Trusted Domain Project. 2 | # All rights reserved. 3 | 4 | dist_doc_DATA = opendkim opendkim-default-keygen 5 | -------------------------------------------------------------------------------- /contrib/init/redhat/opendkim-default-keygen.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create default keys for the OpenDKIM Milter. 4 | 5 | # source function library 6 | #. /etc/rc.d/init.d/functions 7 | 8 | # Some functions to make the below more readable 9 | prog=opendkim 10 | KEYGEN=@sbindir@/$prog-genkey 11 | DKIM_SELECTOR=default 12 | DKIM_KEYDIR=@sysconfdir@/$prog/keys 13 | 14 | # Make some colors 15 | red='\033[1;31m' 16 | green='\033[1;32m' 17 | NC='\033[0m' # No Color 18 | 19 | # Pull in sysconfig settings (will override previously set functions) 20 | [ -f @sysconfdir@/sysconfig/$prog ] && . @sysconfdir@/sysconfig/$prog 21 | 22 | do_dkim_keygen() { 23 | if [ ! -s $DKIM_KEYDIR/$DKIM_SELECTOR.private ]; then 24 | echo -n $"Generating default DKIM keys: " 25 | if [ "x`hostname --domain`" = "x" ]; then 26 | echo 27 | echo -e "${red}Cannot determine host's domain name, so skipping default key generation.${NC}" 28 | else 29 | mkdir -p $DKIM_KEYDIR 30 | $KEYGEN -D $DKIM_KEYDIR -s $DKIM_SELECTOR -d `hostname --domain` 31 | chown -R root:$prog $DKIM_KEYDIR 32 | chmod 640 $DKIM_KEYDIR/$DKIM_SELECTOR.private 33 | chmod 644 $DKIM_KEYDIR/$DKIM_SELECTOR.txt 34 | echo 35 | echo -e "${green}Default DKIM keys for `hostname --domain` created in $DKIM_KEYDIR.${NC}" 36 | fi 37 | else 38 | echo -e "${red}Default DKIM keys already exist!${NC}" 39 | fi 40 | } 41 | 42 | # Create keys 43 | 44 | do_dkim_keygen 45 | 46 | -------------------------------------------------------------------------------- /contrib/init/solaris/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = opendkim opendkim.xml 7 | -------------------------------------------------------------------------------- /contrib/init/solaris/opendkim: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | # 3 | # Start method script for the DKIM milter 4 | # 5 | 6 | PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin; export PATH 7 | 8 | . /lib/svc/share/smf_include.sh 9 | 10 | echo "starting opendkim" 11 | opendkim -x /etc/mail/opendkim.conf 12 | echo "started opendkim" 13 | exit $SMF_EXIT_OK 14 | 15 | #!/end 16 | -------------------------------------------------------------------------------- /contrib/init/solaris/opendkim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /contrib/ldap/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = example.com.ldif opendkim.ldif opendkim.schema README.LDAP 7 | -------------------------------------------------------------------------------- /contrib/ldap/opendkim.ldif: -------------------------------------------------------------------------------- 1 | dn: cn=opendkim,cn=schema,cn=config 2 | objectClass: olcSchemaConfig 3 | cn: opendkim 4 | olcAttributeTypes: {0}( 1.3.6.1.4.1.29426.2.2.1.1 NAME 'DKIMSelector' DESC 'Se 5 | lector name associated with DKIM signing key' EQUALITY caseExactIA5Match SYNT 6 | AX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 7 | olcAttributeTypes: {1}( 1.3.6.1.4.1.29426.2.2.1.2 NAME 'DKIMKey' DESC 'DKIM si 8 | gning key' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SI 9 | NGLE-VALUE ) 10 | olcAttributeTypes: {2}( 1.3.6.1.4.1.29426.2.2.1.3 NAME 'DKIMIdentity' DESC 'Th 11 | e Agent or User Identifier (AUID)' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1. 12 | 4.1.1466.115.121.1.26 SINGLE-VALUE ) 13 | olcAttributeTypes: {3}( 1.3.6.1.4.1.29426.2.2.1.4 NAME 'DKIMDomain' DESC 'DKIM 14 | sender domain' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1. 15 | 26 SINGLE-VALUE ) 16 | olcObjectClasses: {0}( 1.3.6.1.4.1.29426.2.2.2.1 NAME 'DKIM' DESC 'DKIM Select 17 | or and Key container' SUP top AUXILIARY MUST ( DKIMSelector $ DKIMKey ) MAY ( 18 | DKIMIdentity $ DKIMDomain ) ) 19 | -------------------------------------------------------------------------------- /contrib/ldap/opendkim.schema: -------------------------------------------------------------------------------- 1 | # 2 | # state of mind () 3 | # Patrick Ben Koetter, p@state-of-mind.de 4 | # 5 | # Private Enterprise Number: 29426 6 | # 7 | # OID prefix: 1.3.6.1.4.1.29426 8 | # openDKIM: 1.3.6.1.4.1.29426.2.2 9 | # attributes: 1.3.6.1.4.1.29426.2.2.1 10 | # classes: 1.3.6.1.4.1.29426.2.2.2 11 | # 12 | attributetype ( 1.3.6.1.4.1.29426.2.2.1.1 13 | NAME 'DKIMSelector' 14 | DESC 'Selector name associated with DKIM signing key' 15 | EQUALITY caseExactIA5Match 16 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 17 | 18 | attributetype ( 1.3.6.1.4.1.29426.2.2.1.2 19 | NAME 'DKIMKey' 20 | DESC 'DKIM signing key' 21 | EQUALITY caseExactIA5Match 22 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 23 | 24 | attributetype ( 1.3.6.1.4.1.29426.2.2.1.3 25 | NAME 'DKIMIdentity' 26 | DESC 'The Agent or User Identifier (AUID)' 27 | EQUALITY caseExactIA5Match 28 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 29 | 30 | attributetype ( 1.3.6.1.4.1.29426.2.2.1.4 31 | NAME 'DKIMDomain' 32 | DESC 'DKIM sender domain' 33 | EQUALITY caseExactIA5Match 34 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 35 | 36 | objectclass ( 1.3.6.1.4.1.29426.2.2.2.1 37 | NAME 'DKIM' AUXILIARY 38 | DESC 'DKIM Selector and Key container' 39 | SUP top 40 | MAY ( DKIMIdentity $ DKIMDomain ) 41 | MUST ( DKIMSelector $ DKIMKey )) 42 | -------------------------------------------------------------------------------- /contrib/lua/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = authheaders-check-setup-hook.lua 7 | -------------------------------------------------------------------------------- /contrib/lua/README: -------------------------------------------------------------------------------- 1 | This directory contains sample Lua scripts for use with the opendkim filter. 2 | They are supported by their respective authors. 3 | 4 | Please submit bug reports and feature requests to 5 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 6 | 7 | -- 8 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 9 | -------------------------------------------------------------------------------- /contrib/patches/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = opendkim-spam-ignore-cmdswitch.patch 7 | -------------------------------------------------------------------------------- /contrib/patches/README: -------------------------------------------------------------------------------- 1 | This directory contains miscellaneous contributed patches that may be 2 | of use to sites installing OpenDKIM. They are maintained by their respective 3 | authors. 4 | 5 | Please submit bug reports and feature requests to 6 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 7 | 8 | The patches are: 9 | 10 | opendkim-spam-ignore-cmdswitch.patch Andreas Schulze 11 | 12 | Adds an ignored "-N" switch to opendkim-spam to allow compatibility 13 | with some versions of amavisd-new. 14 | 15 | -- 16 | Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 17 | -------------------------------------------------------------------------------- /contrib/patches/opendkim-spam-ignore-cmdswitch.patch: -------------------------------------------------------------------------------- 1 | Index: dv-opendkim-2.5.0.beta8/opendkim/opendkim-spam.c 2 | =================================================================== 3 | --- dv-opendkim-2.5.0.beta8.orig/opendkim/opendkim-spam.c 2011-12-15 21:54:21.000000000 +0100 4 | +++ dv-opendkim-2.5.0.beta8/opendkim/opendkim-spam.c 2011-12-18 12:16:37.000000000 +0100 5 | @@ -32,7 +32,7 @@ 6 | 7 | /* definitions, macros, etc. */ 8 | #define BUFRSZ 1024 9 | -#define CMDLINEOPTS "b:c:d:fh:o:p:P:s:u:vV" 10 | +#define CMDLINEOPTS "b:c:d:fh:N:o:p:P:s:u:vV" 11 | #define DEFDBBACKEND SQL_BACKEND 12 | #define DEFCONFFILE CONFIG_BASE "/opendkim-spam.conf" 13 | #define DEFDBHOST "localhost" 14 | @@ -174,6 +174,12 @@ 15 | dbhost = optarg; 16 | break; 17 | 18 | + case 'N': 19 | + /* accept and ignore any -N switch 20 | + * added by the quarantine feature of amavisd-new 21 | + */ 22 | + break; 23 | + 24 | case 'P': 25 | dbport = optarg; 26 | break; 27 | -------------------------------------------------------------------------------- /contrib/repute/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Trusted Domain Project. All rights reserved. 2 | 3 | dist_doc_DATA = repute.py 4 | -------------------------------------------------------------------------------- /contrib/spec/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = opendkim.spec.in 7 | 8 | EXTRA_DIST = opendkim.spec 9 | -------------------------------------------------------------------------------- /contrib/spec/README: -------------------------------------------------------------------------------- 1 | This directory contains a prototype spec file for use in converting this 2 | source tarball into an RPM for installation on Linux systems that use the 3 | RPM system. 4 | 5 | Please submit bug reports and feature requests to 6 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 7 | 8 | -- 9 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 10 | -------------------------------------------------------------------------------- /contrib/stats/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = opendkim-fixipaddrs.pl \ 7 | stats.lua 8 | -------------------------------------------------------------------------------- /contrib/stats/README: -------------------------------------------------------------------------------- 1 | This directory contains two files: 2 | 3 | stats.lua -- sample Lua script for processing local enhancements to the 4 | statistics reporting system (see the "stats" directory of the main package) 5 | 6 | opendkim-fixipaddrs.pl -- perl script for removing duplicate entries from the 7 | ipaddr table; if you were doing stats back when such a bug existed, you might 8 | find this useful 9 | -------------------------------------------------------------------------------- /contrib/stats/stats.lua: -------------------------------------------------------------------------------- 1 | -- stats.lua -- conventional stats extensions 2 | -- 3 | -- Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 4 | -- 5 | -- Referencing this as StatisticsScript from an opendkim that has both "stats" 6 | -- and "lua" enabled will produce some extended stats lines for each message 7 | -- that indicate whether the message passed SPF and/or SenderID, and 8 | -- whether or not SpamAssassin thought the message was spam. This might 9 | -- be useful for data correlation at the data aggregation point. 10 | 11 | -- 12 | -- SpamAssassin 13 | -- 14 | spam = odkim.get_header(ctx, "X-Spam-Status", 0) 15 | if spam == nil then 16 | odkim.stats(ctx, "spam", "-1") 17 | elseif string.sub(spam, 1, 3) == "No," or string.sub(spam, 2, 4) == "No," then 18 | odkim.stats(ctx, "spam", "0") 19 | elseif string.sub(spam, 1, 4) == "Yes," or string.sub(spam, 2, 5) == "Yes," then 20 | odkim.stats(ctx, "spam", "1") 21 | else 22 | odkim.stats(ctx, "spam", "-1") 23 | end 24 | 25 | -- 26 | -- SPF/Sender-ID 27 | -- 28 | n = 0 29 | done = 0 30 | found = 0 31 | while (done == 0) do 32 | ares = odkim.get_header(ctx, "Authentication-Results", n) 33 | if ares == nil then 34 | done = 1 35 | else 36 | spf = string.find(ares, "spf=", 1, true) 37 | if spf ~= nil then 38 | done = 1 39 | found = 1 40 | if string.find(ares, "spf=pass", 1, true) ~= nil then 41 | odkim.stats(ctx, "spf", "1") 42 | elseif string.find(ares, "spf=fail", 1, true) ~= nil then 43 | odkim.stats(ctx, "spf", "0") 44 | else 45 | odkim.stats(ctx, "spf", "-1") 46 | end 47 | if string.find(ares, "sender-id=pass", 1, true) ~= nil then 48 | odkim.stats(ctx, "senderid", "1") 49 | elseif string.find(ares, "sender-id=fail", 1, true) ~= nil then 50 | odkim.stats(ctx, "senderid", "0") 51 | else 52 | odkim.stats(ctx, "senderid", "-1") 53 | end 54 | end 55 | end 56 | n = n + 1 57 | end 58 | if found == 0 then 59 | odkim.stats(ctx, "spf", "-1") 60 | odkim.stats(ctx, "senderid", "-1") 61 | end 62 | 63 | odkim.stats(ctx, "rcpts", tostring(odkim.rcpt_count(ctx))) 64 | -------------------------------------------------------------------------------- /contrib/systemd/.gitignore: -------------------------------------------------------------------------------- 1 | opendkim.service 2 | -------------------------------------------------------------------------------- /contrib/systemd/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, The Trusted Domain Project. All rights reserved. 2 | 3 | dist_doc_DATA = opendkim.service 4 | -------------------------------------------------------------------------------- /contrib/systemd/README: -------------------------------------------------------------------------------- 1 | This directory includes files meant to be incorporated into Linux distributions 2 | for use with systemd. They are supported by their respective authors. 3 | 4 | Please submit bug reports and feature requests to 5 | opendkim-users@lists.opendkim.org or via the trackers on SourceForge. 6 | 7 | -- 8 | Copyright (c) 2013, The Trusted Domain Project. All rights reserved. 9 | -------------------------------------------------------------------------------- /contrib/systemd/opendkim.service.in: -------------------------------------------------------------------------------- 1 | # If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers. 2 | # For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to: 3 | # After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service 4 | 5 | [Unit] 6 | Description=DomainKeys Identified Mail (DKIM) Milter 7 | Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html 8 | After=network.target nss-lookup.target syslog.target 9 | 10 | [Service] 11 | Type=forking 12 | PIDFile=@localstatedir@/run/opendkim/opendkim.pid 13 | EnvironmentFile=-@sysconfdir@/sysconfig/opendkim 14 | ExecStart=@sbindir@/opendkim $OPTIONS 15 | ExecReload=/bin/kill -USR1 $MAINPID 16 | User=opendkim 17 | Group=opendkim 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /copyright-check: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2011-2014, The Trusted Domain Project. All rights reserved. 4 | # 5 | 6 | YEAR=`date +%Y` 7 | LASTYEAR=$(($YEAR - 1)) 8 | 9 | for i in `git diff develop --name-only @{$LASTYEAR-12-31} | fgrep -v .jpg | fgrep -v contrib/ | fgrep -v m4/` 10 | do 11 | if test -f $i 12 | then 13 | if grep -q Copyright $i 14 | then 15 | if ! grep -q Copyright.\*$YEAR $i 16 | then 17 | echo $i 18 | fi 19 | fi 20 | fi 21 | done 22 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | #AUTOMAKE_OPTIONS = foreign 5 | 6 | dist_doc_DATA = README.specs.html 7 | -------------------------------------------------------------------------------- /libopendkim/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | *.gmon 10 | *.info 11 | *.prof 12 | t-*[0-9] 13 | t-verifyperf 14 | t-signperf 15 | t-cleanup 16 | t-setup 17 | .deps/ 18 | .libs/ 19 | autom4te.cache/ 20 | autoscan-*.log 21 | build-config.h.in 22 | compile 23 | config.guess 24 | config.sub 25 | configure 26 | configure.scan 27 | aclocal.m4 28 | depcomp 29 | install-sh 30 | missing 31 | stamp-h* 32 | build-config.h 33 | config.log 34 | config.status 35 | ltmain.sh 36 | libtool 37 | Makefile.in 38 | Makefile 39 | symbols.map 40 | .libs 41 | .deps 42 | *.core 43 | core 44 | 45 | description.txt 46 | description.html 47 | *.core 48 | -------------------------------------------------------------------------------- /libopendkim/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2014, The Trusted Domain Project. All rights reserved. 2 | 3 | SUBDIRS=tests docs 4 | 5 | if DEBUG 6 | AM_CFLAGS = -g 7 | endif 8 | LDADD = ./libopendkim.la 9 | 10 | lib_LTLIBRARIES = libopendkim.la 11 | libopendkim_la_SOURCES = base32.c base64.c dkim-atps.c dkim-cache.c dkim-canon.c dkim-dns.c dkim-keys.c dkim-mailparse.c dkim-report.c dkim-tables.c dkim-test.c dkim-util.c dkim.c util.c base64.h dkim-cache.h dkim-canon.h dkim-dns.h dkim-internal.h dkim-keys.h dkim-mailparse.h dkim-report.h dkim-tables.h dkim-test.h dkim-types.h dkim-util.h dkim.h util.h 12 | libopendkim_la_CPPFLAGS = $(LIBCRYPTO_CPPFLAGS) 13 | libopendkim_la_CFLAGS = $(LIBCRYPTO_INCDIRS) $(LIBOPENDKIM_INC) $(COV_CFLAGS) 14 | libopendkim_la_LDFLAGS = -no-undefined $(LIBCRYPTO_LIBDIRS) $(COV_LDFLAGS) -version-info $(LIBOPENDKIM_VERSION_INFO) 15 | libopendkim_la_LIBADD = $(LIBOPENDKIM_LIBS) $(LIBCRYPTO_LDADD) $(COV_LIBADD) 16 | if !ALL_SYMBOLS 17 | libopendkim_la_DEPENDENCIES = symbols.map 18 | libopendkim_la_LDFLAGS += -export-symbols symbols.map 19 | endif 20 | if RPATH 21 | libopendkim_la_LDFLAGS += -rpath $(libdir) 22 | endif 23 | libopendkim_includedir = $(includedir)/opendkim 24 | libopendkim_include_HEADERS = dkim.h 25 | 26 | pkgconfigdir = $(libdir)/pkgconfig 27 | pkgconfig_DATA = opendkim.pc 28 | 29 | if USE_DB_LIBOPENDKIM 30 | libopendkim_la_CPPFLAGS += -I$(LIBDB_INCDIRS) 31 | libopendkim_la_LDFLAGS += $(LIBDB_LIBDIRS) 32 | libopendkim_la_LIBADD += $(LIBDB_LIBS) 33 | endif 34 | 35 | if USE_TRE 36 | libopendkim_la_CFLAGS += $(LIBTRE_CPPFLAGS) 37 | libopendkim_la_LIBADD += $(LIBTRE_LIBS) 38 | endif 39 | 40 | DISTCLEANFILES=symbols.map *.gcno *.gcda 41 | 42 | symbols.map: $(libopendkim_include_HEADERS) 43 | grep '^extern' $? | \ 44 | awk '{ for (c = 1; c <= NF; c++) if ($$c ~ /dkim_/) { print $$c; break; } }' | \ 45 | sed -e s/\[\*\;\]//g -e s/\[\\\[\\\]\]//g | \ 46 | sort -u -o $@ 47 | 48 | MOSTLYCLEANFILES=symbols.map *.gcno *.gcda 49 | -------------------------------------------------------------------------------- /libopendkim/README: -------------------------------------------------------------------------------- 1 | 2 | ENVIRONMENT VARIABLES 3 | ===================== 4 | 5 | The following environment variables are checked and have some impact on 6 | what libdkim does: 7 | 8 | DKIM_TMPDIR directory in which temporary files are created; default is 9 | /tmp 10 | 11 | 12 | SELF-TEST 13 | ========= 14 | 15 | A number of self-test programs are included here for unit-testing the 16 | library. To run them, type "make check". A brief description of each 17 | test will be provided before its result. If the description is followed by 18 | the word SKIPPED, it means support for the function (e.g. an external 19 | library) to be tested was not available at compile-time and the test was 20 | not run. 21 | 22 | 23 | CRYPTO LIBRARIES 24 | ================ 25 | 26 | Cryptography libraries, such as openssl and gnutls, that can be used with 27 | libopendkim may have initialization requirements. libopendkim will not 28 | initialize these libraries for you, as doing so may interfere with other 29 | aspects of the application calling this library. It is therefore the 30 | responsibility of the calling application to initailize the crypto library 31 | before attempting DKIM signing or validation, or unexpected errors can occur. 32 | -------------------------------------------------------------------------------- /libopendkim/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _BASE64_H_ 9 | #define _BASE64_H_ 10 | 11 | /* system includes */ 12 | #include 13 | 14 | /* prototypes */ 15 | extern int dkim_base64_decode(u_char *str, u_char *buf, size_t buflen); 16 | extern int dkim_base64_encode(u_char *data, size_t datalen, u_char *buf, 17 | size_t buflen); 18 | 19 | #endif /* ! _BASE64_H_ */ 20 | -------------------------------------------------------------------------------- /libopendkim/dkim-cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, 2013, The Trusted Domain Project. 6 | ** All rights reserved. 7 | */ 8 | 9 | #ifndef _DKIM_CACHE_H_ 10 | #define _DKIM_CACHE_H_ 11 | 12 | #include "build-config.h" 13 | 14 | #include "dkim-internal.h" 15 | 16 | #ifdef QUERY_CACHE 17 | 18 | /* libdb includes */ 19 | #include 20 | 21 | /* prototypes */ 22 | extern void dkim_cache_close __P((DB *)); 23 | extern int dkim_cache_expire __P((DB *, int, int *)); 24 | extern DB *dkim_cache_init __P((int *, char *)); 25 | extern int dkim_cache_insert __P((DB *, char *, char *, int, int *)); 26 | extern int dkim_cache_query __P((DB *, char *, int, char *, size_t *, int *)); 27 | extern void dkim_cache_stats __P((DB *, u_int *, u_int *, u_int *, u_int *, 28 | _Bool)); 29 | 30 | #endif /* QUERY_CACHE */ 31 | 32 | #endif /* ! _DKIM_CACHE_H_ */ 33 | -------------------------------------------------------------------------------- /libopendkim/dkim-canon.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007, 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2011, 2012, The Trusted Domain Project. 6 | ** All rights reserved. 7 | */ 8 | 9 | #ifndef _DKIM_CANON_H_ 10 | #define _DKIM_CANON_H_ 11 | 12 | #include "build-config.h" 13 | 14 | /* system includes */ 15 | #include 16 | #ifdef HAVE_STDBOOL_H 17 | # include 18 | #endif /* HAVE_STDBOOL_H */ 19 | 20 | /* libopendkim includes */ 21 | #include "dkim.h" 22 | 23 | #define DKIM_HASHBUFSIZE 4096 24 | 25 | /* prototypes */ 26 | extern DKIM_STAT dkim_add_canon __P((DKIM *, _Bool, dkim_canon_t, int, 27 | u_char *, struct dkim_header *, 28 | ssize_t length, DKIM_CANON **)); 29 | extern DKIM_STAT dkim_canon_bodychunk __P((DKIM *, u_char *, size_t)); 30 | extern void dkim_canon_cleanup __P((DKIM *)); 31 | extern DKIM_STAT dkim_canon_closebody __P((DKIM *)); 32 | extern DKIM_STAT dkim_canon_getfinal __P((DKIM_CANON *, u_char **, size_t *)); 33 | extern DKIM_STAT dkim_canon_gethashes __P((DKIM_SIGINFO *, void **, size_t *, 34 | void **, size_t *)); 35 | extern DKIM_STAT dkim_canon_header_string __P((struct dkim_dstring *, 36 | dkim_canon_t, unsigned char *, 37 | size_t, _Bool)); 38 | extern DKIM_STAT dkim_canon_init __P((DKIM *, _Bool, _Bool)); 39 | extern u_long dkim_canon_minbody __P((DKIM *)); 40 | extern DKIM_STAT dkim_canon_runheaders __P((DKIM *)); 41 | extern int dkim_canon_selecthdrs __P((DKIM *, u_char *, struct dkim_header **, 42 | int)); 43 | extern DKIM_STAT dkim_canon_signature __P((DKIM *, struct dkim_header *)); 44 | 45 | #endif /* ! _DKIM_CANON_H_ */ 46 | -------------------------------------------------------------------------------- /libopendkim/dkim-dns.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2010, 2012, The Trusted Domain Project. All rights reserved. 3 | ** 4 | */ 5 | 6 | #ifndef _DKIM_DNS_H_ 7 | #define _DKIM_DNS_H_ 8 | 9 | /* libopendkim includes */ 10 | #include "dkim.h" 11 | 12 | /* prototypes */ 13 | extern int dkim_res_cancel __P((void *, void *)); 14 | extern void dkim_res_close __P((void *)); 15 | extern int dkim_res_init __P((void **)); 16 | extern int dkim_res_nslist __P((void *, const char *)); 17 | extern int dkim_res_query __P((void *, int, unsigned char *, unsigned char *, 18 | size_t, void **)); 19 | extern int dkim_res_waitreply __P((void *, void *, struct timeval *, 20 | size_t *, int *, int *)); 21 | 22 | #endif /* ! _DKIM_DNS_H_ */ 23 | -------------------------------------------------------------------------------- /libopendkim/dkim-keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005, 2007 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _DKIM_KEYS_H_ 9 | #define _DKIM_KEYS_H_ 10 | 11 | /* libopendkim includes */ 12 | #include "dkim.h" 13 | 14 | /* prototypes */ 15 | extern DKIM_STAT dkim_get_key_dns __P((DKIM *, DKIM_SIGINFO *, u_char *, 16 | size_t)); 17 | extern DKIM_STAT dkim_get_key_file __P((DKIM *, DKIM_SIGINFO *, u_char *, 18 | size_t)); 19 | 20 | #endif /* ! _DKIM_KEYS_H_ */ 21 | -------------------------------------------------------------------------------- /libopendkim/dkim-mailparse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2004 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2010, 2012, 2014, The Trusted Domain Project. 6 | ** All rights reserved. 7 | */ 8 | 9 | #ifndef _DKIM_MAILPARSE_H_ 10 | #define _DKIM_MAILPARSE_H_ 11 | 12 | #ifdef __STDC__ 13 | # ifndef __P 14 | # define __P(x) x 15 | # endif /* ! __P */ 16 | #else /* __STDC__ */ 17 | # ifndef __P 18 | # define __P(x) () 19 | # endif /* ! __P */ 20 | #endif /* __STDC__ */ 21 | 22 | /* prototypes */ 23 | extern int dkim_mail_parse __P((unsigned char *line, unsigned char **user_out, 24 | unsigned char **domain_out)); 25 | extern int dkim_mail_parse_multi __P((unsigned char *line, 26 | unsigned char ***users_out, 27 | unsigned char ***domains_out)); 28 | #endif /* ! _DKIM_MAILPARSE_H_ */ 29 | -------------------------------------------------------------------------------- /libopendkim/dkim-report.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2012, The Trusted Domain Project. All rights reserved. 3 | */ 4 | 5 | #ifndef _DKIM_REPORT_H_ 6 | #define _DKIM_REPORT_H_ 7 | 8 | /* system includes */ 9 | #include 10 | #include 11 | 12 | /* libopendkim includes */ 13 | #include "dkim.h" 14 | 15 | /* definitions */ 16 | #define DKIM_REPORT_PREFIX "_report._domainkey" 17 | 18 | /* prototypes */ 19 | extern DKIM_STAT dkim_repinfo __P((DKIM *, DKIM_SIGINFO *, 20 | struct timeval *, unsigned char *, size_t)); 21 | 22 | #endif /* ! _DKIM_REPORT_H_ */ 23 | -------------------------------------------------------------------------------- /libopendkim/dkim-tables.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2010, 2012, 2014, The Trusted Domain Project. 6 | ** All rights reserved. 7 | */ 8 | 9 | #ifndef _DKIM_TABLES_H_ 10 | #define _DKIM_TABLES_H_ 11 | 12 | #ifdef __STDC__ 13 | # ifndef __P 14 | # define __P(x) x 15 | # endif /* ! __P */ 16 | #else /* __STDC__ */ 17 | # ifndef __P 18 | # define __P(x) () 19 | # endif /* ! __P */ 20 | #endif /* __STDC__ */ 21 | 22 | /* structures */ 23 | struct nametable 24 | { 25 | const char * tbl_name; /* name */ 26 | const int tbl_code; /* code */ 27 | }; 28 | 29 | /* tables */ 30 | extern struct nametable *algorithms; 31 | extern struct nametable *canonicalizations; 32 | extern struct nametable *hashes; 33 | extern struct nametable *keyflags; 34 | extern struct nametable *keyparams; 35 | extern struct nametable *keytypes; 36 | extern struct nametable *querytypes; 37 | extern struct nametable *results; 38 | extern struct nametable *settypes; 39 | extern struct nametable *sigerrors; 40 | extern struct nametable *sigparams; 41 | 42 | /* prototypes */ 43 | extern const char *dkim_code_to_name __P((struct nametable *tbl, 44 | const int code)); 45 | extern const int dkim_name_to_code __P((struct nametable *tbl, 46 | const char *name)); 47 | 48 | #endif /* _DKIM_TABLES_H_ */ 49 | -------------------------------------------------------------------------------- /libopendkim/dkim-test.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007, 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _DKIM_TEST_H_ 9 | #define _DKIM_TEST_H_ 10 | 11 | /* libopendkim includes */ 12 | #include "dkim.h" 13 | 14 | /* prototypes */ 15 | extern size_t dkim_test_dns_get __P((DKIM *, u_char *, size_t)); 16 | extern int dkim_test_dns_put __P((DKIM *, int, int, int, u_char *, u_char *)); 17 | 18 | #endif /* ! _DKIM_TEST_H_ */ 19 | -------------------------------------------------------------------------------- /libopendkim/dkim-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007, 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _DKIM_UTIL_H_ 9 | #define _DKIM_UTIL_H_ 10 | 11 | #include "build-config.h" 12 | 13 | /* system includes */ 14 | #include 15 | #include 16 | #ifdef HAVE_STDBOOL_H 17 | # include 18 | #endif /* HAVE_STDBOOL_H */ 19 | 20 | /* libopendkim includes */ 21 | #include "dkim.h" 22 | 23 | /* macros */ 24 | #define DKIM_MALLOC(x,y) dkim_malloc((x)->dkim_libhandle, \ 25 | (x)->dkim_closure, y) 26 | #define DKIM_FREE(x,y) dkim_mfree((x)->dkim_libhandle, \ 27 | (x)->dkim_closure, y) 28 | 29 | extern void *dkim_malloc __P((DKIM_LIB *, void *, size_t)); 30 | extern void dkim_mfree __P((DKIM_LIB *, void *, void *)); 31 | extern unsigned char *dkim_strdup __P((DKIM *, const unsigned char *, size_t)); 32 | extern DKIM_STAT dkim_tmpfile __P((DKIM *, int *, _Bool)); 33 | 34 | extern void dkim_dstring_blank __P((struct dkim_dstring *)); 35 | extern _Bool dkim_dstring_cat __P((struct dkim_dstring *, u_char *)); 36 | extern _Bool dkim_dstring_cat1 __P((struct dkim_dstring *, int)); 37 | extern _Bool dkim_dstring_catn __P((struct dkim_dstring *, u_char *, size_t)); 38 | extern _Bool dkim_dstring_copy __P((struct dkim_dstring *, u_char *)); 39 | extern void dkim_dstring_free __P((struct dkim_dstring *)); 40 | extern u_char *dkim_dstring_get __P((struct dkim_dstring *)); 41 | extern int dkim_dstring_len __P((struct dkim_dstring *)); 42 | extern struct dkim_dstring *dkim_dstring_new __P((DKIM *, int, int)); 43 | extern size_t dkim_dstring_printf __P((struct dkim_dstring *dstr, char *fmt, 44 | ...)); 45 | 46 | #endif /* _DKIM_UTIL_H_ */ 47 | -------------------------------------------------------------------------------- /libopendkim/docs/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim.html: -------------------------------------------------------------------------------- 1 | 2 | DKIM 3 | 4 | 6 |

DKIM

7 |

[back to index]

8 | 9 | 10 | 11 | 27 | 28 | 35 | 36 |
DESCRIPTION 12 | 13 | 14 | 15 | 22 | 23 |
PurposeA DKIM handle is returned by successful calls to 16 | dkim_sign() and 17 | dkim_verify(), and passed to 18 | all of the message processing functions. It contains per-message 19 | context-specific information about the message. When processing of 20 | the message is complete, it must be destroyed using a call 21 | to dkim_free().
24 | 25 | 26 |
NOTES 29 |
    30 |
  • More than one DKIM handle may exist at any given time. There is 31 | no memory shared between these handles, so two different handles may be 32 | concurrently accessed in separate threads. 33 |
34 |
37 | 38 |
39 | 40 | Copyright (c) 2005 Sendmail, Inc. and its suppliers. 41 | All rights reserved. 42 |
43 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 44 | 45 |
46 | By using this file, you agree to the terms and conditions set 47 | forth in the respective licenses. 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_alg_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_alg_t 3 | 4 | 6 |

dkim_alg_t

7 |

[back to index]

8 | 9 | 10 | 11 | 38 | 39 | 45 | 46 |
DESCRIPTION 12 | 13 | 14 | 15 | 22 | 23 | 24 | 25 | 33 | 34 |
PurposeA dkim_alg_t is a value from an enumerated list of the possible 16 | message signing algorithms available. It is passed as a parameter to 17 | dkim_sign() when selecting a signing 18 | algorithm to be used to sign a message. It need not be passed to 19 | dkim_verify() as that function 20 | will determine the signing algorithm for verification based on the 21 | signature on an arriving message.
Possible Values 26 |
    27 |
  • DKIM_SIGN_RSASHA1 -- use an RSA-signed SHA1 hash of the message's 28 | headers and body 29 |
  • DKIM_SIGN_RSASHA256 -- use an RSA-signed SHA256 hash of the 30 | message's headers and body 31 |
32 |
35 | 36 | 37 |
NOTES 40 |
    41 |
  • DKIM_SIGN_RSASHA256 is only available if the OpenSSL 42 | available at compile-time supported the SHA256 algorithm. 43 |
44 |
47 | 48 |
49 | 50 | Copyright (c) 2005-2007 Sendmail, Inc. and its suppliers. 51 | All rights reserved. 52 |
53 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 54 | 55 |
56 | By using this file, you agree to the terms and conditions set 57 | forth in the respective licenses. 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_atps_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_atps_t 3 | 4 | 6 |

dkim_atps_t

7 |

[back to index]

8 | 9 | 10 | 11 | 35 | 36 | 41 | 42 |
DESCRIPTION 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 30 | 31 |
PurposeA dkim_atps_t is a result from an Authorized Third-Party Signers 16 | (ATPS) check.
Possible Values 21 |
    22 |
  • DKIM_ATPS_UNKNOWN -- an ATPS test has not been performed or a 23 | result could not be determined 24 |
  • DKIM_ATPS_FOUND -- the sending domain has authorized the signing 25 | domain to sign its mail 26 |
  • DKIM_ATPS_NOTFOUND -- the sending domain has not authorized the 27 | signing domain to sign its mail 28 |
29 |
32 | 33 | 34 |
NOTES 37 |
    38 |
  • None. 39 |
40 |
43 | 44 |
45 | 46 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 47 | All rights reserved. 48 |
49 | Copyright (c) 2010, The Trusted Domain Project. All rights reserved. 50 | 51 |
52 | By using this file, you agree to the terms and conditions set 53 | forth in the respective licenses. 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_canon_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_canon_t 3 | 4 | 6 |

dkim_canon_t

7 |

[back to index]

8 | 9 | 10 | 11 |
DESCRIPTION 12 | 13 | 14 | 15 | 23 | 24 | 25 | 26 | 34 | 35 |
PurposeA dkim_canon_t is a value from an enumerated list of the possible 16 | message canonicalization algorithms available. It is passed as a 17 | parameter to dkim_sign() when 18 | selecting a canonicalization algorithm to be used when preparing a message 19 | body for signing. It need not be passed to 20 | dkim_verify() as that function 21 | will determine the canonicalization algorithm for verification based on the 22 | signature on an arriving message.
Possible Values 27 |
    28 |
  • DKIM_CANON_RELAXED -- "relaxed" canonicalization as defined 29 | in RFC6376 30 |
  • DKIM_CANON_SIMPLE -- "simple" canonicalization as defined 31 | in RFC6376 32 |
33 |
36 | 37 |
38 | 39 |
40 | 41 | Copyright (c) 2005, 2007 Sendmail, Inc. and its suppliers. 42 | All rights reserved. 43 |
44 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 45 | 46 |
47 | By using this file, you agree to the terms and conditions set 48 | forth in the respective licenses. 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_dns_close.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_dns_close() 3 | 4 | 6 |

dkim_dns_close()

7 |

[back to index]

8 | 9 | 10 | 11 | 25 | 26 | 27 | 45 | 46 | 47 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 65 | 66 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | int dkim_dns_close(
15 | 	DKIM_LIB *libopendkim)
16 | );
17 | 
18 | 
19 | Shuts down the DNS resolver in use by the library. This in turn calls 20 | either the compiled-in default or the replacement provided by a call to 21 | dkim_dns_set_close(). 22 | This is automatically called by 23 | dkim_close(). 24 |
DESCRIPTION 28 | 29 | 30 | 31 | 32 | 33 |
Called Whendkim_dns_close() can be called at any time.
34 | 35 | 36 |
ARGUMENTS 37 | 38 | 39 | 40 | 43 |
ArgumentDescription
libopendkimThe library instantiation handle, returned by 41 | dkim_init(). 42 |
44 |
RETURN VALUES 50 |
    51 |
  • DKIM_DNS_SUCCESS -- successful operation 52 |
  • DKIM_DNS_ERROR -- an error occurred 53 |
54 |
NOTES 61 |
    62 |
  • None. 63 |
64 |
67 | 68 |
69 | 70 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 71 | All rights reserved. 72 |
73 | Copyright (c) 2012, The Trusted Domain Project. All rights reserved. 74 | 75 |
76 | By using this file, you agree to the terms and conditions set 77 | forth in the respective licenses. 78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_dnssec.html: -------------------------------------------------------------------------------- 1 | 2 | DKIM_DNSSEC 3 | 4 | 6 |

DKIM_DNSSEC

7 |

[back to index]

8 | 9 | 10 | 11 | 31 |
DESCRIPTION 12 | 13 | 14 | 15 | 18 | 19 | 20 | 28 |
PurposeA DKIM_DNSSEC is a mnemonic describing the security 16 | of a key record acquired via the DNS. 17 |
Possible Values 21 |
    22 |
  • DKIM_DNSSEC_UNKNOWN -- DNSSEC evaluation not done 23 |
  • DKIM_DNSSEC_BOGUS -- DNS response failed DNSSEC evaluation 24 |
  • DKIM_DNSSEC_INSECURE -- DNS response was not secured by DNSSEC 25 |
  • DKIM_DNSSEC_SECURE -- DNS response was secured by DNSSEC 26 |
27 |
29 | 30 |
32 | 33 |
34 | 35 | Copyright (c) 2008 Sendmail, Inc. and its suppliers. 36 | All rights reserved. 37 |
38 | Copyright (c) 2009, 2010, 2014, The Trusted Domain Project. 39 | All rights reserved. 40 | 41 |
42 | By using this file, you agree to the terms and conditions set 43 | forth in the respective licenses. 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_get_signer.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_get_signer() 3 | 4 | 6 |

dkim_get_signer()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 42 | 43 | 44 | 45 | 46 | 54 | 55 | 56 | 57 | 58 | 59 | 64 | 65 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | const unsigned char *dkim_get_signer(
15 | 	DKIM *dkim);
16 | );
17 | 
18 | Returns the current signer (i.e. value to be used in the "i=" tag) 19 | for a signing handle. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 29 | 30 |
Called Whendkim_get_signer() can be called at any time prior to signature 28 | generation.
31 | 32 | 33 |
ARGUMENTS 34 | 35 | 36 | 37 | 40 |
ArgumentDescription
dkimMessage-specific signing handle, returned by 38 | dkim_sign(). 39 |
41 |
RETURN VALUES 47 |
    48 |
  • NULL -- no signer has been requested, meaning no "i=" tag will be 49 | included in the generated signature 50 |
  • otherwise -- a pointer to a terminated string containing the signer 51 | address previously requested 52 |
53 |
NOTES 60 |
    61 |
  • None. 62 |
63 |
66 | 67 |
68 | 69 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 70 | All rights reserved. 71 |
72 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 73 | 74 |
75 | By using this file, you agree to the terms and conditions set 76 | forth in the respective licenses. 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_get_user_context.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_get_user_context() 3 | 4 | 6 |

dkim_get_user_context()

7 |

[back to index]

8 | 9 | 10 | 11 | 23 | 24 | 25 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 64 | 65 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 	void * dkim_get_user_context(
15 | 	DKIM *dkim
16 | );
17 | 
18 | Retrieves an opaque user context pointer previously associated with 19 | a DKIM handle by a call to 20 | dkim_set_user_context(), 21 | if any. 22 |
DESCRIPTION 26 | 27 | 28 | 29 | 30 | 31 |
Called Whendkim_get_user_context() can be called at any time.
32 | 33 | 34 |
ARGUMENTS 35 | 36 | 37 | 38 | 42 |
ArgumentDescription
dkimMessage-specific signing handle, returned by 39 | dkim_sign() or 40 | dkim_verify(). 41 |
43 |
RETURN VALUES 49 | The user-specific context pointer previously associated with the named 50 | handle via a call to 51 | dkim_set_user_context(), 52 | if any. If none has been set, the value NULL will be returned. 53 |
NOTES 60 |
    61 |
  • None. 62 |
63 |
66 | 67 |
68 | 69 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 70 | All rights reserved. 71 |
72 | Copyright (c) 2009-2011, The Trusted Domain Project. All rights reserved. 73 | 74 |
75 | By using this file, you agree to the terms and conditions get 76 | forth in the respective licenses. 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_getresultstr.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_getresultstr() 3 | 4 | 6 |

dkim_getresultstr()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 41 | 42 | 43 | 55 | 56 | 57 | 58 | 59 | 64 | 65 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | const char * dkim_getresultstr(
16 | 	DKIM_STAT result
17 | );
18 | 
19 | Retrieve a text conversion for a DKIM_STAT result code. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 29 | 30 |
Called Whendkim_getresultstr() can be called at any time after a function 28 | that returns a DKIM_STAT result code.
31 | 32 | 33 |
ARGUMENTS 34 | 35 | 36 | 37 | 39 |
ArgumentDescription
resultA DKIM_STAT result code to be translated. 38 |
40 |
RETURN VALUES 44 | 45 | 46 | 47 | 49 | 50 | 53 |
ValueDescription
NULLThe value of result was not recognized. 48 |
otherwiseA pointer to a NULL-terminated string containing a text 51 | translation of result. 52 |
54 |
NOTES 60 |
    61 |
  • None. 62 |
63 |
66 | 67 |
68 | 69 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 70 | All rights reserved. 71 |
72 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 73 | 74 |
75 | By using this file, you agree to the terms and conditions set 76 | forth in the respective licenses. 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_lib.html: -------------------------------------------------------------------------------- 1 | 2 | DKIM_LIB 3 | 4 | 6 |

DKIM_LIB

7 |

[back to index]

8 | 9 | 10 | 11 | 25 | 26 | 33 | 34 |
DESCRIPTION 12 | 13 | 14 | 15 | 20 | 21 |
PurposeA DKIM_LIB handle is returned by a successful call to 16 | dkim_init() and 17 | contains context information needed for a single instance of the 18 | libopendkim service to be used. It can be used by several threads 19 | at once.
22 | 23 | 24 |
NOTES 27 | 32 |
35 | 36 |
37 | 38 | Copyright (c) 2005 Sendmail, Inc. and its suppliers. 39 | All rights reserved. 40 |
41 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 42 | 43 |
44 | By using this file, you agree to the terms and conditions set 45 | forth in the respective licenses. 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_libversion.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_libversion() 3 | 4 | 6 |

dkim_libversion()

7 |

[back to index]

8 | 9 | 10 | 11 | 23 | 24 | 25 | 37 | 38 | 39 | 40 | 41 | 46 | 47 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | uint32_t dkim_libversion(void);
16 | 
17 | 
18 | Returns the version of the library against which an application was linked. 19 | The version is encoded as a four-octet integer, with the octets representing 20 | (from highest-order to lowest-order) the release number, the major version 21 | number, the minor version number, and the patch level. 22 |
DESCRIPTION 26 | 27 | 28 | 29 | 30 | 31 |
Called Whendkim_libversion() can be called at any time.
32 | 33 | 34 |
ARGUMENTS 35 | None. 36 |
NOTES 42 |
    43 |
  • None. 44 |
45 |
48 | 49 |
50 | 51 | Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers. 52 | All rights reserved. 53 |
54 | Copyright (c) 2010, 2011, The Trusted Domain Project. All rights reserved. 55 | 56 |
57 | By using this file, you agree to the terms and conditions set 58 | forth in the respective licenses. 59 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_param_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_param_t 3 | 4 | 6 |

dkim_param_t

7 |

[back to index]

8 | 9 | 10 | 11 | 44 | 45 | 50 | 51 |
DESCRIPTION 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 39 | 40 |
PurposeA dkim_param_t is a value from an enumerated list of the possible 16 | signature parameters (tags) available.
Possible Values 21 |
    22 |
  • DKIM_PARAM_UNKNOWN -- tags not known by the API 23 |
  • DKIM_PARAM_SIGNATURE -- base64-encode signature data 24 |
  • DKIM_PARAM_SIGNALG -- DKIM signing algorithm 25 |
  • DKIM_PARAM_DOMAIN -- signing domain 26 |
  • DKIM_PARAM_CANONALG -- canonicalization algorithm(s) 27 |
  • DKIM_PARAM_QUERYMETHOD -- key lookup method 28 |
  • DKIM_PARAM_SELECTOR -- selector 29 |
  • DKIM_PARAM_HDRLIST -- colon-separated header list 30 |
  • DKIM_PARAM_VERSION -- version 31 |
  • DKIM_PARAM_IDENTITY -- sender's identity 32 |
  • DKIM_PARAM_TIMESTAMP -- signature timestamp 33 |
  • DKIM_PARAM_EXPIRATION -- signature expiration 34 |
  • DKIM_PARAM_COPIEDHDRS -- copied headers 35 |
  • DKIM_PARAM_BODYHASH -- body hash 36 |
  • DKIM_PARAM_BODYLENGTH -- body length 37 |
38 |
41 | 42 | 43 |
NOTES 46 |
    47 |
  • None. 48 |
49 |
52 | 53 |
54 | 55 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 56 | All rights reserved. 57 |
58 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 59 | 60 |
61 | By using this file, you agree to the terms and conditions set 62 | forth in the respective licenses. 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_qi_getname.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_qi_getname() 3 | 4 | 6 |

dkim_qi_getname()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 42 | 43 | 44 | 55 | 56 | 57 | 58 | 59 | 64 | 65 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | const char * dkim_qi_getname(
16 | 	DKIM_QUERYINFO *query
17 | );
18 | 
19 | Retrieve from a DKIM_QUERYINFO handle the name to be queried from the DNS. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 30 | 31 |
Called Whendkim_qi_getname() can be called at any time after 28 | query information is returned by 29 | dkim_sig_getqueries().
32 | 33 | 34 |
ARGUMENTS 35 | 36 | 37 | 38 | 40 |
ArgumentDescription
queryA reference to a DKIM_QUERYINFO handle. 39 |
41 |
RETURN VALUES 45 | 46 | 47 | 48 | 50 | 51 | 53 |
ValueDescription
NULLNo name could be determined for this query handle. 49 |
otherwiseA pointer to the DNS name found in the handle. 52 |
54 |
NOTES 60 |
    61 |
  • None. 62 |
63 |
66 | 67 |
68 | 69 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 70 | All rights reserved. 71 |
72 | Copyright (c) 2011, 2014, The Trusted Domain Project. All rights reserved. 73 | 74 |
75 | By using this file, you agree to the terms and conditions set 76 | forth in the respective licenses. 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_query_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_query_t 3 | 4 | 6 |

dkim_query_t

7 |

[back to index]

8 | 9 | 10 | 11 | 37 | 38 | 43 | 44 |
DESCRIPTION 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 | 32 | 33 |
PurposeA dkim_query_t is a value from an enumerated list of the possible 16 | key query algorithms available. It is typically determined by parsing 17 | the q= portion of a received signature when verifying an 18 | arriving message. However, by using 19 | dkim_options(), the caller can 20 | force a particular query method.
Possible Values 25 |
    26 |
  • DKIM_QUERY_DNS -- use the DNS TXT record binding defined by 27 | the DKIM specification (the default) 28 |
  • DKIM_QUERY_FILE -- read keys from a local file; intended for 29 | debugging or experimental use only 30 |
31 |
34 | 35 | 36 |
NOTES 39 |
    40 |
  • None. 41 |
42 |
45 | 46 |
47 | 48 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 49 | All rights reserved. 50 |
51 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 52 | 53 |
54 | By using this file, you agree to the terms and conditions set 55 | forth in the respective licenses. 56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_queryinfo.html: -------------------------------------------------------------------------------- 1 | 2 | DKIM_QUERYINFO 3 | 4 | 6 |

DKIM_QUERYINFO

7 |

[back to index]

8 | 9 | 10 | 11 | 28 | 29 | 34 | 35 |
DESCRIPTION 12 | 13 | 14 | 15 | 23 | 24 |
PurposeA DKIM_QUERYINFO handle stores data having to do with a 16 | DNS query that is or may be needed. This is useful when the 17 | application has some mechanism for resolving DNS queries that does 18 | not make direct use of the DNS handling system provided by libopendkim. 19 | It is created by the 20 | dkim_sig_getqueries() 21 | function and must be freed by the caller. 22 |
25 | 26 | 27 |
NOTES 30 |
    31 |
  • More than one of these handles may exist at any given time. 32 |
33 |
36 | 37 |
38 | 39 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 40 | All rights reserved. 41 |
42 | Copyright (c) 2011, 2014, The Trusted Domain Project. All rights reserved. 43 | 44 |
45 | By using this file, you agree to the terms and conditions set 46 | forth in the respective licenses. 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_getcontext.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_getcontext() 3 | 4 | 6 |

dkim_sig_getcontext()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 42 | 43 | 44 | 45 | 46 | 51 | 52 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | void * dkim_sig_getcontext(
16 | 	DKIM_SIGINFO *sig
17 | );
18 | 
19 | Retrieve the user-provided context pointer for a specific signature. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 29 | 30 |
Called Whendkim_sig_getcontext() can be called from within the prescreen 28 | callback, if defined.
31 | 32 | 33 |
ARGUMENTS 34 | 35 | 36 | 37 | 40 |
ArgumentDescription
sigSignature-specific handle, passed to the prescreen callback 38 | (if defined). 39 |
41 |
NOTES 47 |
    48 |
  • None. 49 |
50 |
53 | 54 |
55 | 56 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 57 | All rights reserved. 58 |
59 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 60 | 61 |
62 | By using this file, you agree to the terms and conditions set 63 | forth in the respective licenses. 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_getdnssec.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_getdnssec() 3 | 4 | 6 |

dkim_sig_getdnssec()

7 |

[back to index]

8 | 9 | 10 | 11 | 22 | 23 | 24 | 46 | 47 | 48 | 49 | 50 | 55 | 56 | 57 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | DKIM_DNSSEC dkim_sig_getdnssec(
15 | 	DKIM_SIGINFO *sig
16 | );
17 | 
18 | Retrieve DNSSEC information about the DNS query that was used to retrieve 19 | the key matching a signature. The value returned is a 20 | DKIM_DNSSEC constant. 21 |
DESCRIPTION 25 | 26 | 27 | 28 | 33 | 34 |
Called Whendkim_sig_getdnssec() is called after 29 | dkim_eoh() to determine 30 | whether or not DNSSEC was used to retrieve the key matching the 31 | provided signature, and if so, whether or not the returned value 32 | was legitimate.
35 | 36 | 37 |
ARGUMENTS 38 | 39 | 40 | 41 | 44 |
ArgumentDescription
sigThe DKIM_SIGINFO handle representing the signature 42 | being evaluated. 43 |
45 |
NOTES 51 |
    52 |
  • None. 53 |
54 |
58 | 59 |
60 | 61 | Copyright (c) 2008 Sendmail, Inc. and its suppliers. 62 | All rights reserved. 63 |
64 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 65 | 66 |
67 | By using this file, you agree to the terms and conditions set 68 | forth in the respective licenses. 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_getdomain.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_getdomain() 3 | 4 | 6 |

dkim_sig_getdomain()

7 |

[back to index]

8 | 9 | 10 | 11 | 22 | 23 | 24 | 43 | 44 | 45 | 56 | 57 | 58 | 59 | 60 | 65 | 66 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | const char * dkim_sig_getdomain(
16 | 	DKIM_SIGINFO *sig
17 | );
18 | 
19 | Retrieve from a DKIM handle the domain name associated with the signature 20 | on a message. 21 |
DESCRIPTION 25 | 26 | 27 | 28 | 31 | 32 |
Called Whendkim_sig_getdomain() can be called at any time after 29 | signature handles are initialized by a call to 30 | dkim_eoh().
33 | 34 | 35 |
ARGUMENTS 36 | 37 | 38 | 39 | 41 |
ArgumentDescription
sigSignature-specific handle. 40 |
42 |
RETURN VALUES 46 | 47 | 48 | 49 | 51 | 52 | 54 |
ValueDescription
NULLNo domain name could be determined for this signature. 50 |
otherwiseA pointer to the domain name found in the signature. 53 |
55 |
NOTES 61 |
    62 |
  • None. 63 |
64 |
67 | 68 |
69 | 70 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 71 | All rights reserved. 72 |
73 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 74 | 75 |
76 | By using this file, you agree to the terms and conditions set 77 | forth in the respective licenses. 78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_geterror.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_geterror() 3 | 4 | 6 |

dkim_sig_geterror()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 43 | 44 | 45 | 46 | 47 | 52 | 53 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | DKIM_SIGERROR dkim_sig_geterror(
16 | 	DKIM_SIGINFO *sig
17 | );
18 | 
19 | Retrieve the error value stored for a specific signature. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 31 | 32 |
Called Whendkim_sig_geterror() can be called from within the 28 | prescreen or 29 | final or 30 | callbacks, if defined.
33 | 34 | 35 |
ARGUMENTS 36 | 37 | 38 | 39 | 41 |
ArgumentDescription
sigSignature-specific handle. 40 |
42 |
NOTES 48 |
    49 |
  • None. 50 |
51 |
54 | 55 |
56 | 57 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 58 | All rights reserved. 59 |
60 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 61 | 62 |
63 | By using this file, you agree to the terms and conditions set 64 | forth in the respective licenses. 65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_geterrorstr.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_geterrorstr() 3 | 4 | 6 |

dkim_sig_geterrorstr()

7 |

[back to index]

8 | 9 | 10 | 11 | 22 | 23 | 24 | 41 | 42 | 43 | 44 | 45 | 50 | 51 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | const char * dkim_sig_geterrorstr(
16 | 	DKIM_SIGERROR sigerr
17 | );
18 | 
19 | Retrieve a string describing a signature error code, or NULL if the code 20 | had no text translation. 21 |
DESCRIPTION 25 | 26 | 27 | 28 | 29 | 30 |
Called Whendkim_sig_geterrorstr() can be called at any time.
31 | 32 | 33 |
ARGUMENTS 34 | 35 | 36 | 37 | 39 |
ArgumentDescription
sigerrA DKIM_SIGERROR constant. 38 |
40 |
NOTES 46 |
    47 |
  • None. 48 |
49 |
52 | 53 |
54 | 55 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 56 | All rights reserved. 57 |
58 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 59 | 60 |
61 | By using this file, you agree to the terms and conditions set 62 | forth in the respective licenses. 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_ignore.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_ignore() 3 | 4 | 6 |

dkim_sig_ignore()

7 |

[back to index]

8 | 9 | 10 | 11 | 21 | 22 | 23 | 42 | 43 | 44 | 45 | 46 | 51 | 52 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | void dkim_sig_ignore(
16 | 	DKIM_SIGINFO *sig
17 | );
18 | 
19 | Flag a signature to be ignored by the library. 20 |
DESCRIPTION 24 | 25 | 26 | 27 | 29 | 30 |
Called Whendkim_sig_ignore() can be called from within the prescreen 28 | callback, if defined.
31 | 32 | 33 |
ARGUMENTS 34 | 35 | 36 | 37 | 40 |
ArgumentDescription
sigSignature-specific handle, passed to the prescreen callback 38 | (if defined). 39 |
41 |
NOTES 47 |
    48 |
  • None. 49 |
50 |
53 | 54 |
55 | 56 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 57 | All rights reserved. 58 |
59 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 60 | 61 |
62 | By using this file, you agree to the terms and conditions set 63 | forth in the respective licenses. 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_setdnssec.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_setdnssec() 3 | 4 | 6 |

dkim_sig_setdnssec()

7 |

[back to index]

8 | 9 | 10 | 11 | 22 | 23 | 24 | 48 | 49 | 50 | 51 | 52 | 57 | 58 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | void dkim_sig_setdnssec(
16 | 	DKIM_SIGINFO *sig,
17 | 	int dnssec_status
18 | );
19 | 
20 | Store the DNSSEC result for a specified signature. 21 |
DESCRIPTION 25 | 26 | 27 | 28 | 31 | 32 |
Called Whendkim_sig_setdnssec() can be called by any caller-provided 29 | DNS function to indicate the result of DNSSEC evaluation of a key 30 | record.
33 | 34 | 35 |
ARGUMENTS 36 | 37 | 38 | 39 | 41 | 42 | 46 |
ArgumentDescription
sigSignature-specific handle. 40 |
dnssec_statusA valid DNSSEC result code. 43 | any unrecognized value will be treated as 44 | DKIM_DNSSEC_UNKNOWN. 45 |
47 |
NOTES 53 |
    54 |
  • None. 55 |
56 |
59 | 60 |
61 | 62 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 63 | All rights reserved. 64 |
65 | Copyright (c) 2014, The Trusted Domain Project. All rights reserved. 66 | 67 |
68 | By using this file, you agree to the terms and conditions set 69 | forth in the respective licenses. 70 |
71 | 72 | 73 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sig_seterror.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sig_seterror() 3 | 4 | 6 |

dkim_sig_seterror()

7 |

[back to index]

8 | 9 | 10 | 11 | 22 | 23 | 24 | 48 | 49 | 50 | 51 | 52 | 58 | 59 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | DKIM_STAT dkim_sig_seterror(
16 | 	DKIM_SIGINFO *sig,
17 | 	int err
18 | );
19 | 
20 | Set the error value stored for a specific signature. 21 |
DESCRIPTION 25 | 26 | 27 | 28 | 32 | 33 |
Called Whendkim_sig_seterror() can be called from within the key lookup 29 | callback set by 30 | dkim_set_key_lookup(), 31 | if defined.
34 | 35 | 36 |
ARGUMENTS 37 | 38 | 39 | 40 | 42 | 43 | 46 |
ArgumentDescription
sigSignature-specific handle. 41 |
errA DKIM_SIGERROR error 44 | code. 45 |
47 |
NOTES 53 |
    54 |
  • Returns DKIM_STAT_INVALID if the signature already has an error 55 | code assigned to it other than DKIM_SIGERROR_UNKNOWN. 56 |
57 |
60 | 61 |
62 | 63 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 64 | All rights reserved. 65 |
66 | Copyright (c) 2012, The Trusted Domain Project. All rights reserved. 67 | 68 |
69 | By using this file, you agree to the terms and conditions set 70 | forth in the respective licenses. 71 |
72 | 73 | 74 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_siginfo.html: -------------------------------------------------------------------------------- 1 | 2 | DKIM_SIGINFO 3 | 4 | 6 |

DKIM_SIGINFO

7 |

[back to index]

8 | 9 | 10 | 11 | 28 | 29 | 34 | 35 |
DESCRIPTION 12 | 13 | 14 | 15 | 23 | 24 |
PurposeA DKIM_SIGINFO handle stores data having to do with a 16 | signature handle discovered during a verification operation. 17 | A DKIM handle contains an array 18 | of these items, one for each signature discovered on an arriving 19 | message. It also contains an optional pointer to user-specific 20 | data which can be retrieved by the user during signature processing 21 | operations. 22 |
25 | 26 | 27 |
NOTES 30 |
    31 |
  • More than one of these handles may exist at any given time. 32 |
33 |
36 | 37 |
38 | 39 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 40 | All rights reserved. 41 |
42 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 43 | 44 |
45 | By using this file, you agree to the terms and conditions set 46 | forth in the respective licenses. 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_sigkey_t.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_sigkey_t 3 | 4 | 6 |

dkim_sigkey_t

7 |

[back to index]

8 | 9 | 10 | 11 | 25 | 26 | 33 | 34 |
DESCRIPTION 12 | 13 | 14 | 15 | 20 | 21 |
PurposeA dkim_sigkey_t points to the private key to be 16 | used to sign messages. It should be a contiguous block of memory 17 | containing the private key either in PEM format, or in base64-encoded 18 | DER format, terminated by a NUL character. (For now, it is simply a 19 | pointer to a string of type unsigned char.)
22 | 23 | 24 |
NOTES 27 |
    28 |
  • The calling application should read the key into memory and 29 | pass it in as this data type. Carriage return and newline characters 30 | (ASCII 13 and 10, respectively) need not be stripped. 31 |
32 |
35 | 36 |
37 | 38 | Copyright (c) 2005 Sendmail, Inc. and its suppliers. 39 | All rights reserved. 40 |
41 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 42 | 43 |
44 | By using this file, you agree to the terms and conditions set 45 | forth in the respective licenses. 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_signhdrs.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_signhdrs() 3 | 4 | 6 |

dkim_signhdrs()

7 |

[back to index]

8 | 9 | 10 | 11 | 23 | 24 | 25 | 47 | 48 | 49 | 50 | 51 | 60 | 61 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | 
15 | void dkim_signhdrs(
16 | 	DKIM *dkim,
17 |         const char **hdrlist
18 | );
19 | 
20 | Select header fields to be signed for this message, overriding the library 21 | default. 22 |
DESCRIPTION 26 | 27 | 28 | 29 | 31 | 32 |
Called Whendkim_signhdrs() can be called after a signing handle is created 30 | with dkim_sign().
33 | 34 | 35 |
ARGUMENTS 36 | 37 | 38 | 39 | 41 | 42 | 45 |
ArgumentDescription
dkimA message signing handle. 40 |
hdrlistA NULL-terminated array of strings containing the names of header 43 | fields to be included in the hashes that generate this signature. 44 |
46 |
NOTES 52 |
    53 |
  • This overides the list of header field names previously selected as the 54 | library default by a call to 55 | dkim_options(). It affects only the 56 | handle passed to the function. If not called, the default set configured for 57 | this library instance is used. 58 |
59 |
62 | 63 |
64 | 65 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 66 | All rights reserved. 67 |
68 | Copyright (c) 2013, The Trusted Domain Project. All rights reserved. 69 | 70 |
71 | By using this file, you agree to the terms and conditions set 72 | forth in the respective licenses. 73 |
74 | 75 | 76 | -------------------------------------------------------------------------------- /libopendkim/docs/dkim_ssl_version.html: -------------------------------------------------------------------------------- 1 | 2 | dkim_ssl_version() 3 | 4 | 6 |

dkim_ssl_version()

7 |

[back to index]

8 | 9 | 10 | 11 | 18 | 19 | 20 | 32 | 33 | 34 | 38 | 39 | 40 | 41 | 42 | 49 | 50 |
SYNOPSIS 12 |
13 | #include <dkim.h>
14 | unsigned long dkim_ssl_version(void);
15 | 
16 | Retrieve the SSL version number against which the library was compiled. 17 |
DESCRIPTION 21 | 22 | 23 | 24 | 25 | 26 |
Called Whendkim_ssl_version() can be called at any time.
27 | 28 | 29 |
ARGUMENTS 30 | None. 31 |
RETURN VALUES 35 | The constant OPENSSL_VERSION_NUMBER as defined by 36 | the OpenSSL package. 37 |
NOTES 43 |
    44 |
  • The value returned by this function has no meaning to the library. 45 | The intent here is to confirm that the library and applications using 46 | it were both compiled with compatible versions of OpenSSL. 47 |
48 |
51 | 52 |
53 | 54 | Copyright (c) 2007 Sendmail, Inc. and its suppliers. 55 | All rights reserved. 56 |
57 | Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved. 58 | 59 |
60 | By using this file, you agree to the terms and conditions set 61 | forth in the respective licenses. 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /libopendkim/opendkim.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@/opendkim 7 | 8 | Name: OpenDKIM Library 9 | Description: Library for performing DKIM signing and verification 10 | URL: http://opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} @PTHREAD_CFLAGS@ -lopendkim 13 | Libs.private: @LIBOPENDKIM_LIBS_PKG@ @PTHREAD_LIBS@ 14 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 15 | 16 | -------------------------------------------------------------------------------- /libopendkim/tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | *.gmon 10 | *.prof 11 | *.info 12 | *.gcov 13 | t-*[0-9] 14 | t-verifyperf 15 | t-signperf 16 | t-cleanup 17 | t-setup 18 | .deps/ 19 | .libs/ 20 | .info-files 21 | autom4te.cache/ 22 | autoscan-*.log 23 | build-config.h.in 24 | compile 25 | config.guess 26 | config.sub 27 | configure 28 | configure.scan 29 | aclocal.m4 30 | description.html 31 | description.txt 32 | depcomp 33 | install-sh 34 | missing 35 | stamp-h* 36 | build-config.h 37 | config.log 38 | config.status 39 | ltmain.sh 40 | libtool 41 | Makefile.in 42 | Makefile 43 | symbols.map 44 | .libs 45 | .deps 46 | core 47 | *.core 48 | gmon.out 49 | -------------------------------------------------------------------------------- /libopendkim/tests/gcov-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $1 3 | x=$? 4 | myname=`basename $1` 5 | if test x"$OSTYPE" = x"OpenBSD" 6 | then 7 | mv *$myname.bb $myname.bb 8 | mv *$myname.bbg $myname.bbg 9 | mv *$myname.da $myname.da 10 | else 11 | mv *$myname.gcda $myname.gcda 12 | mv *$myname.gcno $myname.gcno 13 | fi 14 | exit $x 15 | -------------------------------------------------------------------------------- /libopendkim/tests/lcov-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $1 3 | x=$? 4 | # keep consistant with Makefile.am 5 | testname=${1/.\/t-} 6 | testname=${testname//-/_} 7 | lcov --capture --directory .. --output-file $1.info --test-name ${testname} --quiet 8 | lcov --remove $1.info '/usr/include/*' --output-file $1.info --quiet & 9 | exit $x 10 | -------------------------------------------------------------------------------- /libopendkim/tests/lcov/.gitignore: -------------------------------------------------------------------------------- 1 | [^R]* 2 | -------------------------------------------------------------------------------- /libopendkim/tests/lcov/README: -------------------------------------------------------------------------------- 1 | This directory will contain the output of an "lcov" (code coverage) report 2 | run during packaging of this release. To read it, point your favourite 3 | browser at "index.html" in this directory. 4 | 5 | -------------------------------------------------------------------------------- /libopendkim/tests/t-cleanup.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007, 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #include "build-config.h" 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef USE_GNUTLS 16 | # include 17 | #endif /* USE_GNUTLS */ 18 | 19 | /* libopendkim includes */ 20 | #include "t-testdata.h" 21 | 22 | /* 23 | ** MAIN -- program mainline 24 | ** 25 | ** Parameters: 26 | ** The usual. 27 | ** 28 | ** Return value: 29 | ** Exit status. 30 | */ 31 | 32 | int 33 | main(int argc, char **argv) 34 | { 35 | /* needed for code coverage test descriptions */ 36 | printf("*** test cleanup\n"); 37 | 38 | assert(unlink(KEYFILE) == 0); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /libopendkim/tests/t-signperf-relaxed-relaxed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # Speed signing test using relaxed/relaxed canonicalization 5 | 6 | ./t-signperf -b relaxed -h relaxed 7 | -------------------------------------------------------------------------------- /libopendkim/tests/t-signperf-sha1: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # Speed signing test using sha1 hash algorithm 5 | 6 | ./t-signperf -s rsa-sha1 7 | -------------------------------------------------------------------------------- /libopendkim/tests/t-signperf-simple-simple: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # Speed signing test using simple/simple canonicalization 5 | 6 | ./t-signperf -b simple -h simple 7 | -------------------------------------------------------------------------------- /libopendkim/tests/t-test111.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #include "build-config.h" 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef USE_GNUTLS 17 | # include 18 | #endif /* USE_GNUTLS */ 19 | 20 | /* libopendkim includes */ 21 | #include "../dkim.h" 22 | #include "../dkim-internal.h" 23 | #include "../util.h" 24 | 25 | #define MAXHEADER 4096 26 | 27 | #define QP_IN "root=40example=2E=\r\ncom\n" 28 | #define QP_OUT "root@example.com\n" 29 | 30 | /* 31 | ** MAIN -- program mainline 32 | ** 33 | ** Parameters: 34 | ** The usual. 35 | ** 36 | ** Return value: 37 | ** Exit status. 38 | */ 39 | 40 | int 41 | main(int argc, char **argv) 42 | { 43 | int olen; 44 | char buf[BUFRSZ + 1]; 45 | 46 | printf("*** quoted-printable decode\n"); 47 | 48 | olen = dkim_qp_decode(QP_IN, buf, sizeof buf); 49 | assert(olen == strlen(QP_OUT)); 50 | buf[olen] = '\0'; 51 | assert(strcmp(QP_OUT, buf) == 0); 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /libopendkim/tests/t-test133.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #include "build-config.h" 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef USE_GNUTLS 16 | # include 17 | #endif /* USE_GNUTLS */ 18 | 19 | /* libopendkim includes */ 20 | #include "../dkim.h" 21 | 22 | /* 23 | ** MAIN -- program mainline 24 | ** 25 | ** Parameters: 26 | ** The usual. 27 | ** 28 | ** Return value: 29 | ** Exit status. 30 | */ 31 | 32 | int 33 | main(int argc, char **argv) 34 | { 35 | unsigned long libversion; 36 | 37 | printf("*** testing dkim_libversion()\n"); 38 | 39 | libversion = dkim_libversion(); 40 | assert(libversion == OPENDKIM_LIB_VERSION); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /libopendkim/tests/t-test135.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005-2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2013, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #include "build-config.h" 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef USE_GNUTLS 17 | # include 18 | #endif /* USE_GNUTLS */ 19 | 20 | /* libopendkim includes */ 21 | #include "../dkim.h" 22 | #include "t-testdata.h" 23 | 24 | #define MAXHEADER 4096 25 | 26 | /* 27 | ** MAIN -- program mainline 28 | ** 29 | ** Parameters: 30 | ** The usual. 31 | ** 32 | ** Return value: 33 | ** Exit status. 34 | */ 35 | 36 | int 37 | main(int argc, char **argv) 38 | { 39 | #ifdef TEST_KEEP_FILES 40 | u_int flags; 41 | #endif /* TEST_KEEP_FILES */ 42 | DKIM_STAT status; 43 | DKIM *dkim; 44 | DKIM_LIB *lib; 45 | dkim_query_t qtype = DKIM_QUERY_FILE; 46 | 47 | printf("*** relaxed/simple rsa-sha1 verifying using chunking API (leading CRLF)\n"); 48 | 49 | #ifdef USE_GNUTLS 50 | (void) gnutls_global_init(); 51 | #endif /* USE_GNUTLS */ 52 | 53 | /* instantiate the library */ 54 | lib = dkim_init(NULL, NULL); 55 | assert(lib != NULL); 56 | 57 | #ifdef TEST_KEEP_FILES 58 | /* set flags */ 59 | flags = (DKIM_LIBFLAGS_TMPFILES|DKIM_LIBFLAGS_KEEPFILES); 60 | (void) dkim_options(lib, DKIM_OP_SETOPT, DKIM_OPTS_FLAGS, &flags, 61 | sizeof flags); 62 | #endif /* TEST_KEEP_FILES */ 63 | 64 | (void) dkim_options(lib, DKIM_OP_SETOPT, DKIM_OPTS_QUERYMETHOD, 65 | &qtype, sizeof qtype); 66 | (void) dkim_options(lib, DKIM_OP_SETOPT, DKIM_OPTS_QUERYINFO, 67 | KEYFILE, strlen(KEYFILE)); 68 | 69 | dkim = dkim_verify(lib, JOBID, NULL, &status); 70 | assert(dkim != NULL); 71 | 72 | status = dkim_chunk(dkim, CRLF, strlen(CRLF)); 73 | assert(status == DKIM_STAT_SYNTAX); 74 | 75 | status = dkim_free(dkim); 76 | assert(status == DKIM_STAT_OK); 77 | 78 | dkim_close(lib); 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /libopendkim/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2005, 2007, 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _UTIL_H_ 9 | #define _UTIL_H_ 10 | 11 | #include "build-config.h" 12 | 13 | /* system includes */ 14 | #include 15 | #include 16 | #ifdef USE_UNBOUND 17 | # include 18 | #endif /* USE_UNBOUND */ 19 | #ifdef HAVE_STDBOOL_H 20 | # include 21 | #endif /* HAVE_STDBOOL_H */ 22 | 23 | /* prototypes */ 24 | extern int dkim_addrcmp __P((u_char *, u_char *)); 25 | extern int dkim_check_dns_reply __P((unsigned char *ansbuf, size_t anslen, 26 | int xclass, int xtype)); 27 | extern void dkim_clobber_array __P((char **)); 28 | extern void dkim_collapse __P((u_char *)); 29 | extern const char **dkim_copy_array __P((char **)); 30 | extern _Bool dkim_hdrlist __P((u_char *, size_t, u_char **, _Bool)); 31 | extern int dkim_hexchar __P((int c)); 32 | extern void dkim_lowerhdr __P((u_char *)); 33 | extern void dkim_min_timeval __P((struct timeval *, struct timeval *, 34 | struct timeval *, struct timeval **)); 35 | extern int dkim_qp_decode __P((u_char *, u_char *, int)); 36 | extern int dkim_qp_encode __P((u_char *, u_char *, int)); 37 | 38 | #ifdef NEED_FAST_STRTOUL 39 | extern unsigned long dkim_strtoul __P((const char *str, char **endptr, 40 | int base)); 41 | extern unsigned long long dkim_strtoull __P((const char *str, char **endptr, 42 | int base)); 43 | #endif /* NEED_FAST_STRTOUL */ 44 | 45 | #endif /* ! _UTIL_H_ */ 46 | -------------------------------------------------------------------------------- /librbl/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | lib_LTLIBRARIES = librbl.la 5 | librbl_la_SOURCES = rbl.c 6 | librbl_la_LDFLAGS = -version-info 1:0:0 $(LIBRESOLV) 7 | librblincludedir = $(includedir)/rbl 8 | librblinclude_HEADERS = rbl.h 9 | 10 | if RPATH 11 | librbl_la_LDFLAGS += -rpath $(libdir) 12 | endif 13 | 14 | pkgconfigdir = $(libdir)/pkgconfig 15 | pkgconfig_DATA = rbl.pc 16 | 17 | dist_man_MANS = rbl.3 18 | -------------------------------------------------------------------------------- /librbl/rbl.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: RBL (Real-time Blacklist) library 9 | Description: Library for assisting in RBL query functions 10 | URL: http://www.opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} -lrbl 13 | Libs.private: @LIBRESOLV@ 14 | Cflags: -I${includedir} 15 | 16 | -------------------------------------------------------------------------------- /libut/.gitignore: -------------------------------------------------------------------------------- 1 | ut 2 | ut.o 3 | ut.core 4 | Makefile.in 5 | Makefile 6 | -------------------------------------------------------------------------------- /libut/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | lib_LTLIBRARIES = libut.la 5 | libut_la_SOURCES = ut.c 6 | libut_la_LDFLAGS = -version-info 1:0:0 7 | libutincludedir = $(includedir)/ut 8 | libutinclude_HEADERS = ut.h 9 | 10 | if RPATH 11 | libut_la_LDFLAGS += -rpath $(libdir) 12 | endif 13 | 14 | pkgconfigdir = $(libdir)/pkgconfig 15 | pkgconfig_DATA = ut.pc 16 | 17 | dist_man_MANS = ut.3 18 | -------------------------------------------------------------------------------- /libut/ut.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 3 | */ 4 | 5 | #ifndef _UT_H_ 6 | #define _UT_H_ 7 | 8 | /* system includes */ 9 | #include 10 | #include 11 | 12 | /* types */ 13 | struct uri_template; 14 | typedef struct uri_template * URITEMP; 15 | 16 | #define UT_KEYTYPE_STRING 1 17 | #define UT_KEYTYPE_LIST 2 18 | #define UT_KEYTYPE_KEYVALUE 3 19 | 20 | #define UT_ERROR_OK 0 21 | #define UT_ERROR_MALFORMED (-1) 22 | 23 | /* prototypes */ 24 | extern URITEMP ut_init(void); 25 | extern void ut_destroy(URITEMP); 26 | extern int ut_keyvalue(URITEMP, int, const char *, void *); 27 | extern size_t ut_generate(URITEMP, const char *, char *, size_t); 28 | 29 | #endif /* ! _UT_H_ */ 30 | -------------------------------------------------------------------------------- /libut/ut.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: UT (URL Template Library) 9 | Description: Library for assisting in URI construction from templates 10 | URL: http://www.opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} -lut 13 | Cflags: -I${includedir} 14 | 15 | -------------------------------------------------------------------------------- /libvbr/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | t-*[0-9] 10 | t-verifyperf 11 | t-signperf 12 | t-cleanup 13 | t-setup 14 | .deps/ 15 | .libs/ 16 | autom4te.cache/ 17 | autoscan-*.log 18 | build-config.h.in 19 | compile 20 | config.guess 21 | config.sub 22 | configure 23 | configure.scan 24 | aclocal.m4 25 | depcomp 26 | install-sh 27 | missing 28 | stamp-h* 29 | build-config.h 30 | config.log 31 | config.status 32 | ltmain.sh 33 | libtool 34 | Makefile.in 35 | Makefile 36 | .deps 37 | .libs 38 | core 39 | *.core 40 | -------------------------------------------------------------------------------- /libvbr/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | 4 | lib_LTLIBRARIES = libvbr.la 5 | libvbr_la_SOURCES = vbr.c 6 | libvbr_la_LDFLAGS = -version-info 2:0:0 $(LIBRESOLV) 7 | libvbrincludedir = $(includedir)/vbr 8 | libvbrinclude_HEADERS = vbr.h 9 | 10 | if RPATH 11 | libvbr_la_LDFLAGS += -rpath $(libdir) 12 | endif 13 | 14 | pkgconfigdir = $(libdir)/pkgconfig 15 | pkgconfig_DATA = vbr.pc 16 | 17 | dist_man_MANS = vbr.3 18 | -------------------------------------------------------------------------------- /libvbr/vbr.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: VBR (Vouch by reference library) 9 | Description: Library for assisting in Vouch By Refence functions 10 | URL: http://opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} -lvbr 13 | Libs.private: @LIBRESOLV@ 14 | Cflags: -I${includedir} 15 | 16 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | ltoptions.m4 3 | ltsugar.m4 4 | ltversion.m4 5 | lt~obsolete.m4 6 | -------------------------------------------------------------------------------- /miltertest/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | t-*[0-9] 10 | t-verifyperf 11 | t-signperf 12 | t-cleanup 13 | t-setup 14 | .deps/ 15 | .libs/ 16 | autom4te.cache/ 17 | autoscan-*.log 18 | build-config.h.in 19 | compile 20 | config.guess 21 | config.sub 22 | configure 23 | configure.scan 24 | aclocal.m4 25 | depcomp 26 | install-sh 27 | missing 28 | stamp-h* 29 | build-config.h 30 | config.log 31 | config.status 32 | ltmain.sh 33 | libtool 34 | Makefile.in 35 | Makefile 36 | .deps 37 | opendkim-testadsp 38 | opendkim 39 | opendkim-stats 40 | opendkim-testkey 41 | .libs 42 | core 43 | *.core 44 | opendkim*.[58] 45 | miltertest 46 | -------------------------------------------------------------------------------- /miltertest/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010, 2012, 2013, The Trusted Domain Project. 2 | # All rights reserved. 3 | 4 | # what flags you want to pass to the C compiler & linker 5 | #AM_CFLAGS = --pedantic -Wall -O2 6 | 7 | # this lists the binaries to produce, the (non-PHONY, binary) targets in 8 | # the previous manual Makefile 9 | if LUA 10 | bin_PROGRAMS = miltertest 11 | 12 | miltertest_SOURCES = miltertest.c 13 | miltertest_CPPFLAGS = -I$(srcdir)/../libopendkim $(LIBMILTER_INCDIRS) $(LIBLUA_INCDIRS) 14 | miltertest_LDFLAGS = ../libopendkim/libopendkim.la $(LIBLUA_LIBDIRS) 15 | miltertest_LDADD = $(LIBLUA_LIBS) $(LIBNSL_LIBS) 16 | 17 | man_MANS = miltertest.8 18 | endif 19 | 20 | EXTRA_DIST = miltertest.8 21 | -------------------------------------------------------------------------------- /opendkim/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | opendkim*.[58] 10 | t-*[0-9] 11 | t-verifyperf 12 | t-signperf 13 | t-cleanup 14 | t-setup 15 | .deps/ 16 | .libs/ 17 | autom4te.cache/ 18 | autoscan-*.log 19 | build-config.h.in 20 | compile 21 | config.guess 22 | config.sub 23 | configure 24 | configure.scan 25 | aclocal.m4 26 | depcomp 27 | install-sh 28 | missing 29 | stamp-h* 30 | build-config.h 31 | config.log 32 | config.status 33 | ltmain.sh 34 | libtool 35 | Makefile.in 36 | Makefile 37 | .deps 38 | opendkim-testadsp 39 | opendkim 40 | opendkim-stats 41 | opendkim-testmsg 42 | opendkim-testkey 43 | opendkim-genzone 44 | opendkim-genkey 45 | .libs 46 | core 47 | *.core 48 | opendkim-lua.3 49 | opendkim.conf.simple-verify 50 | opendkim.conf.simple 51 | opendkim-atpszone 52 | opendkim-atpszone.8 53 | opendkim-spam 54 | opendkim-spam.1 55 | -------------------------------------------------------------------------------- /opendkim/autorespond.csh: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | ## 3 | ## 4 | ## Copyright (c) 2004, 2005 Sendmail, Inc. and its suppliers. 5 | ## All rights reserved. 6 | ## 7 | ## Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 8 | ## 9 | ## autorespond.csh -- accept a message and reply to it to test signing and 10 | ## verifying of opendkim 11 | 12 | ## Setup 13 | set infile=/tmp/ari.$$ 14 | set tmpfile=/tmp/aro.$$ 15 | set hostname=`hostname` 16 | 17 | ## Capture the incoming message 18 | cat > $infile 19 | 20 | ## Build the reply 21 | echo From: autorespond@$hostname >> $tmpfile 22 | grep '^From:' < $infile | sed 's/^From/To/g' >> $tmpfile 23 | ## Enable the next line to allow remote canonicalization selection: 24 | # grep '^X-Canonicalization:' < $infile >> $tmpfile 25 | echo Subject: Auto-response from $hostname >> $tmpfile 26 | echo "" >> $tmpfile 27 | echo "Original message:" >> $tmpfile 28 | echo "" >> $tmpfile 29 | cat $infile >> $tmpfile 30 | echo "" >> $tmpfile 31 | echo "And some random data:" >> $tmpfile 32 | echo "" >> $tmpfile 33 | dd if=/dev/urandom count=10 | base64 -e >> $tmpfile 34 | 35 | ## Send the reply 36 | sendmail -t < $tmpfile 37 | 38 | ## Clean up 39 | rm -f $tmpfile $infile 40 | 41 | exit 0 42 | -------------------------------------------------------------------------------- /opendkim/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2006-2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, 2015, The Trusted Domain Project. All rights reserved. 6 | ** 7 | */ 8 | 9 | #ifndef _CONFIG_H_ 10 | #define _CONFIG_H_ 11 | 12 | #include "build-config.h" 13 | 14 | /* system includes */ 15 | #include 16 | #ifdef HAVE_STDBOOL_H 17 | # include 18 | #endif /* HAVE_STDBOOL_H */ 19 | #include 20 | 21 | /* types and things */ 22 | #define CONFIG_TYPE_STRING 0 23 | #define CONFIG_TYPE_INTEGER 1 24 | #define CONFIG_TYPE_BOOLEAN 2 25 | #define CONFIG_TYPE_INCLUDE 3 26 | #define CONFIG_TYPE_DEPRECATED 4 27 | 28 | struct config 29 | { 30 | _Bool cfg_bool; 31 | u_int cfg_type; 32 | int cfg_int; 33 | char * cfg_name; 34 | char * cfg_string; 35 | struct config * cfg_next; 36 | }; 37 | 38 | struct configdef 39 | { 40 | char * cd_name; 41 | u_int cd_type; 42 | u_int cd_req; 43 | }; 44 | 45 | /* prototypes */ 46 | extern char *config_check __P((struct config *, struct configdef *)); 47 | extern unsigned int config_dump __P((struct config *, FILE *, const char *)); 48 | extern char *config_error __P((void)); 49 | extern void config_free __P((struct config *)); 50 | extern int config_get __P((struct config *, const char *, void *, size_t)); 51 | extern struct config *config_load __P((char *, struct configdef *, 52 | unsigned int *, char *, size_t, char **)); 53 | extern _Bool config_validname __P((struct configdef *, const char *)); 54 | 55 | #endif /* _CONFIG_H_ */ 56 | -------------------------------------------------------------------------------- /opendkim/final.lua.sample: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (c) 2009, 2010, 2012, The Trusted Domain Project. 3 | -- All rights reserved. 4 | -- 5 | -- final.lua.sample -- sample version of the "final" script that demonstrates 6 | -- all of the features of the configuration file 7 | -- 8 | -- The final script is executed after the entire message body has been 9 | -- received and processed but before the filter renders its final verdict. 10 | -- The main use of this script is to determine whether or not the message 11 | -- is acceptable to the verifier, and what final filtering action should be 12 | -- taken. For exmaple, if the message failed Author Domain Signing 13 | -- Practises tests, or had additional data appended to it beyond what the 14 | -- signature covered, or even if the signature simply failed to verify, 15 | -- this script can detect such things and take whatever action is desired. 16 | 17 | -- Retrieve signature count 18 | nsigs = odkim.get_sigcount(ctx) 19 | if nsigs == nil then 20 | return nil 21 | end 22 | 23 | -- Enact ADSP. 24 | -- 1) If it reported NXDOMAIN, reject. 25 | if odkim.get_presult(ctx) == DKIM_PRESULT_NXDOMAIN then 26 | odkim.set_reply(ctx, "554", "5.7.1", "sender domain does not exist") 27 | odkim.set_result(ctx, SMFIS_REJECT) 28 | return nil 29 | end 30 | 31 | -- 2) Test for discardable. We'll handle "unknown" and "all" through RFC5451. 32 | if odkim.get_presult(ctx) == DKIM_PRESULT_FOUND and 33 | odkim.get_policy(ctx) == DKIM_POLICY_DISCARDABLE then 34 | discard = true 35 | for n = 1, nsigs 36 | sig = odkim.get_sighandle(ctx, n) 37 | sigres = odkim.sig_result(sig) 38 | sdomain = odkim.sig_getdomain(sig) 39 | if sigres == 0 and sdomain == fromdomain then 40 | discard = false 41 | end 42 | end 43 | if discard then 44 | odkim.set_result(ctx, SMFIS_REJECT) 45 | return nil 46 | end 47 | end 48 | 49 | -- If the message had too much stuff added to it (more than 120 bytes) 50 | -- then bounce it 51 | for n = 1, nsigs do 52 | sig = odkim.get_sighandle(ctx, n) 53 | bodylen = odkim.sig_bodylength(sig) 54 | canonlen = odkim.sig_canonlength(sig) 55 | if bodylen > canonlen + 120 then 56 | odkim.set_reply(ctx, "554", "", 57 | "Too much data after DKIM-protected body") 58 | odkim.set_result(ctx, SMFIS_REJECT) 59 | end 60 | end 61 | 62 | -- That's it! 63 | return nil 64 | -------------------------------------------------------------------------------- /opendkim/flowrate.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 3 | */ 4 | 5 | #ifndef _FLOWRATE_H_ 6 | #define _FLOWRATE_H_ 7 | 8 | #include "build-config.h" 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | 14 | /* opendkim includes */ 15 | #include "opendkim-db.h" 16 | 17 | #ifdef __STDC__ 18 | # ifndef __P 19 | # define __P(x) x 20 | # endif /* ! __P */ 21 | #else /* __STDC__ */ 22 | # ifndef __P 23 | # define __P(x) () 24 | # endif /* ! __P */ 25 | #endif /* __STDC__ */ 26 | 27 | /* prototypes */ 28 | extern int dkimf_rate_check __P((const char *, DKIMF_DB, DKIMF_DB, int, int, 29 | unsigned int *)); 30 | 31 | #endif /* _FLOWRATE_H_ */ 32 | -------------------------------------------------------------------------------- /opendkim/opendkim-arf.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2011, 2012, The Trusted Domain Project. 6 | ** All rights reserved. 7 | ** 8 | */ 9 | 10 | /* system includes */ 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /* opendkim includes */ 18 | #include "opendkim-arf.h" 19 | 20 | /* 21 | ** ARF_TYPE_STRING -- translate an ARF_TYPE_* constant to a string 22 | ** 23 | ** Parameters: 24 | ** type -- an ARF_TYPE_* constant 25 | ** 26 | ** Return value: 27 | ** A string describing the "type" provided. 28 | */ 29 | 30 | char * 31 | arf_type_string(int type) 32 | { 33 | switch (type) 34 | { 35 | case ARF_TYPE_ABUSE: 36 | return "abuse"; 37 | 38 | case ARF_TYPE_FRAUD: 39 | return "fraud"; 40 | 41 | case ARF_TYPE_VIRUS: 42 | return "virus"; 43 | 44 | case ARF_TYPE_AUTHFAIL: 45 | return "auth-failure"; 46 | 47 | case ARF_TYPE_UNKNOWN: 48 | case ARF_TYPE_OTHER: 49 | default: 50 | return "other"; 51 | } 52 | } 53 | 54 | /* 55 | ** ARF_DKIM_FAILURE_STRING -- return an appropriate DKIM-Failure: string for 56 | ** an ARF report 57 | ** 58 | ** Parameters: 59 | ** ftype -- failure type, i.e. an ARF_DKIMF_* constant 60 | ** 61 | ** Return value: 62 | ** A string describing the "ftype" provided. 63 | */ 64 | 65 | char * 66 | arf_dkim_failure_string(int ftype) 67 | { 68 | switch (ftype) 69 | { 70 | case ARF_DKIMF_BODYHASH: 71 | return "bodyhash"; 72 | 73 | case ARF_DKIMF_REVOKED: 74 | return "revoked"; 75 | 76 | case ARF_DKIMF_SIGNATURE: 77 | return "signature"; 78 | 79 | case ARF_DKIMF_SYNTAX: 80 | return "syntax"; 81 | 82 | case ARF_DKIMF_OTHER: 83 | default: 84 | return "other"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /opendkim/opendkim-arf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2011, 2012, 2014, The Trusted Domain Project. 6 | ** All rights reserved. 7 | ** 8 | */ 9 | 10 | #ifndef _DKIM_ARF_H_ 11 | #define _DKIM_ARF_H_ 12 | 13 | /* system includes */ 14 | #include 15 | 16 | #ifdef __STDC__ 17 | # ifndef __P 18 | # define __P(x) x 19 | # endif /* ! __P */ 20 | #else /* __STDC__ */ 21 | # ifndef __P 22 | # define __P(x) () 23 | # endif /* ! __P */ 24 | #endif /* __STDC__ */ 25 | 26 | #define ARF_VERSION "0.1" 27 | 28 | #define ARF_TYPE_UNKNOWN (-1) 29 | #define ARF_TYPE_ABUSE 0 30 | #define ARF_TYPE_FRAUD 1 31 | #define ARF_TYPE_VIRUS 2 32 | #define ARF_TYPE_AUTHFAIL 3 33 | #define ARF_TYPE_OTHER 4 34 | 35 | #define ARF_DKIMF_UNKNOWN (-1) 36 | #define ARF_DKIMF_BODYHASH 0 37 | #define ARF_DKIMF_REVOKED 1 38 | #define ARF_DKIMF_SIGNATURE 2 39 | #define ARF_DKIMF_SYNTAX 3 40 | #define ARF_DKIMF_OTHER 4 41 | 42 | #define ARF_FORMAT_ARF "arf" 43 | 44 | #define ARF_OPTIONS_DKIM_ALL "all" 45 | #define ARF_OPTIONS_DKIM_DNS "d" 46 | #define ARF_OPTIONS_DKIM_OTHER "o" 47 | #define ARF_OPTIONS_DKIM_POLICY "p" 48 | #define ARF_OPTIONS_DKIM_SYNTAX "s" 49 | #define ARF_OPTIONS_DKIM_VERIFY "v" 50 | #define ARF_OPTIONS_DKIM_EXPIRED "x" 51 | 52 | /* prototypes */ 53 | extern char *arf_dkim_failure_string __P((int)); 54 | extern char *arf_type_string __P((int)); 55 | 56 | #endif /* _DKIM_ARF_H_ */ 57 | -------------------------------------------------------------------------------- /opendkim/opendkim-crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009, 2012, The Trusted Domain Project. All rights reserved. 6 | ** 7 | */ 8 | 9 | #ifndef _DKIM_CRYPTO_H_ 10 | #define _DKIM_CRYPTO_H_ 11 | 12 | #ifdef __STDC__ 13 | # ifndef __P 14 | # define __P(x) x 15 | # endif /* ! __P */ 16 | #else /* __STDC__ */ 17 | # ifndef __P 18 | # define __P(x) () 19 | # endif /* ! __P */ 20 | #endif /* __STDC__ */ 21 | 22 | /* PROTOTYPES */ 23 | #ifdef USE_GNUTLS 24 | extern const char *dkimf_crypto_geterror __P((void)); 25 | #endif /* USE_GNUTLS */ 26 | extern int dkimf_crypto_init __P((void)); 27 | extern void dkimf_crypto_free __P((void)); 28 | 29 | #endif /* _DKIM_CRYPTO_H_ */ 30 | -------------------------------------------------------------------------------- /opendkim/opendkim-dns.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2008 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2013, The Trusted Domain Project. All rights reserved. 6 | */ 7 | 8 | #ifndef _OPENDKIM_DNS_H_ 9 | #define _OPENDKIM_DNS_H_ 10 | 11 | /* system includes */ 12 | #include 13 | 14 | /* libopendkim includes */ 15 | #include 16 | 17 | /* opendkim includes */ 18 | #include "opendkim-db.h" 19 | 20 | #ifdef _FFR_RBL 21 | /* librbl includes */ 22 | # include 23 | #endif /* _FFR_RBL */ 24 | 25 | #ifdef _FFR_VBR 26 | /* libvbr includes */ 27 | # include 28 | #endif /* _FFR_VBR */ 29 | 30 | struct dkimf_filedns; 31 | 32 | #ifdef USE_UNBOUND 33 | /* libunbound includes */ 34 | # include 35 | 36 | /* prototypes */ 37 | extern int dkimf_unbound_setup __P((DKIM_LIB *)); 38 | # ifdef _FFR_RBL 39 | extern int dkimf_rbl_unbound_setup __P((RBL *)); 40 | # endif /* _FFR_RBL */ 41 | # ifdef _FFR_VBR 42 | extern int dkimf_vbr_unbound_setup __P((VBR *)); 43 | # endif /* _FFR_VBR */ 44 | #endif /* USE_UNBOUND */ 45 | 46 | extern int dkimf_filedns_free __P((struct dkimf_filedns *)); 47 | extern int dkimf_filedns_setup __P((DKIM_LIB *, DKIMF_DB)); 48 | 49 | extern int dkimf_dns_config __P((DKIM_LIB *, const char *)); 50 | extern int dkimf_dns_setnameservers __P((DKIM_LIB *, const char *)); 51 | extern int dkimf_dns_trustanchor __P((DKIM_LIB *, const char *)); 52 | 53 | #endif /* _OPENDKIM_DNS_H_ */ 54 | -------------------------------------------------------------------------------- /opendkim/opendkim-lua.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 3 | ** 4 | */ 5 | 6 | #ifndef _OPENDKIM_LUA_H_ 7 | #define _OPENDKIM_LUA_H_ 8 | 9 | /* system includes */ 10 | #include 11 | 12 | /* types */ 13 | struct dkimf_lua_script_result 14 | { 15 | int lrs_rcount; 16 | char * lrs_error; 17 | char ** lrs_results; 18 | }; 19 | 20 | struct dkimf_lua_gc_item 21 | { 22 | int gci_type; 23 | void * gci_item; 24 | struct dkimf_lua_gc_item * gci_next; 25 | }; 26 | 27 | struct dkimf_lua_gc 28 | { 29 | struct dkimf_lua_gc_item * gc_head; 30 | struct dkimf_lua_gc_item * gc_tail; 31 | }; 32 | 33 | /* macros */ 34 | #define DKIMF_GC "_DKIMF_GC" 35 | #define DKIMF_LUA_GC_DB 1 36 | 37 | /* prototypes */ 38 | extern int dkimf_lua_db_hook __P((const char *, size_t, const char *, 39 | struct dkimf_lua_script_result *, 40 | void **, size_t *)); 41 | extern int dkimf_lua_final_hook __P((void *, const char *, size_t, 42 | const char *, 43 | struct dkimf_lua_script_result *, 44 | void **, size_t *)); 45 | extern void dkimf_lua_gc_add __P((struct dkimf_lua_gc *g, void *, int)); 46 | extern void dkimf_lua_gc_cleanup __P((struct dkimf_lua_gc *)); 47 | extern void dkimf_lua_gc_remove __P((struct dkimf_lua_gc *, void *)); 48 | extern int dkimf_lua_screen_hook __P((void *, const char *, size_t, 49 | const char *, 50 | struct dkimf_lua_script_result *, 51 | void **, size_t *)); 52 | extern int dkimf_lua_setup_hook __P((void *, const char *, size_t, 53 | const char *, 54 | struct dkimf_lua_script_result *, 55 | void **, size_t *)); 56 | #ifdef _FFR_STATSEXT 57 | extern int dkimf_lua_stats_hook __P((void *, const char *, size_t, 58 | const char *, 59 | struct dkimf_lua_script_result *, 60 | void **, size_t *)); 61 | #endif /* _FFR_STATSEXT */ 62 | 63 | #endif /* _OPENDKIM_LUA_H_ */ 64 | -------------------------------------------------------------------------------- /opendkim/opendkim-stats.8.in: -------------------------------------------------------------------------------- 1 | .TH OPENDKIM-STATS 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-stats 4 | \- output opendkim statistics 5 | .SH SYNOPSIS 6 | .B opendkim-stats 7 | .I file 8 | .SH DESCRIPTION 9 | The 10 | .B opendkim-stats 11 | utility reads from an 12 | .I opendkim 13 | statistics database and dumps the data therein to standard output. It takes as 14 | its only argument the path to this database. The 15 | .I opendkim 16 | statistics gathering is disabled by default, but can be enabled through a 17 | .I Statistics 18 | entry in 19 | .I @SYSCONFDIR@/opendkim.conf. 20 | 21 | See the 22 | .I opendkim.conf(5) 23 | man page for details. 24 | .SH SEE ALSO 25 | .I opendkim(8), opendkim.conf(5) 26 | .SH VERSION 27 | This man page covers the 28 | .I opendkim-stats 29 | that shipped with version @VERSION@ of 30 | .I OpenDKIM. 31 | -------------------------------------------------------------------------------- /opendkim/opendkim-testmsg.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-testmsg 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-testmsg 4 | \- DKIM message tst 5 | .SH SYNOPSIS 6 | .B opendkim-testmsg 7 | [\-C] [\-d domain] [\-K] [\-k keypath] [\-s selector] [\-t path] 8 | .SH DESCRIPTION 9 | .B opendkim-testmsg 10 | signs or verifies an input message. This is similar to the test mode for 11 | .I opendkim(8) 12 | except that it does not use the same configuration system or milter interface. 13 | Rather, it is a direct access to the DKIM library with those functions 14 | "out of the way". 15 | 16 | The message is read from standard input. In signing mode, the complete 17 | signed message will then be written to standard output. When verifying, 18 | there will be no output unless an error occurred. 19 | 20 | To sign a message, the \-d, \-k and \-s settings in the SYNOPSIS above 21 | must be provided. If all of them are absent, the input message will be 22 | verified. If some but not all are present, an error is returned. 23 | 24 | .SH OPTIONS 25 | .TP 26 | .I -C 27 | If specified, the signature header field generated in signing mode will 28 | be line-terminated with carriage-return line-feed, instead of just line-feed. 29 | .TP 30 | .I -d domain 31 | Names the domain in which signing is to be done. More specifically, 32 | names the domain in which the public key matching the provided private key 33 | would be found in a live test. 34 | .TP 35 | .I -K 36 | Arranges to keep temporary files generated during message canonicalization 37 | for debugging purposes. 38 | .TP 39 | .I -k keypath 40 | Specifies the path to the private key file which should be used to sign 41 | the input message. 42 | .TP 43 | .I -s selector 44 | Names the selector within the specified domain that should be included in 45 | the signature. 46 | .TP 47 | .I -t path 48 | Specifies the directory in which temporary files are to be created. The 49 | default is 50 | .I /tmp. 51 | .SH VERSION 52 | This man page covers the version of 53 | .I opendkim-testmsg 54 | that shipped with version @VERSION@ of 55 | .I OpenDKIM. 56 | .SH COPYRIGHT 57 | Copyright (c) 2011-2013, The Trusted Domain Project. All rights reserved. 58 | .SH SEE ALSO 59 | .I opendkim(8) 60 | .P 61 | RFC6376 - DomainKeys Identified Mail 62 | -------------------------------------------------------------------------------- /opendkim/opendkim.conf.simple-verify.in: -------------------------------------------------------------------------------- 1 | 2 | # This is a simple config file verifying messages only 3 | 4 | #LogWhy yes 5 | Syslog yes 6 | SyslogSuccess yes 7 | 8 | Socket inet:8891@localhost 9 | 10 | ReportAddress postmaster@@DOMAIN@ 11 | SendReports yes 12 | 13 | Mode v 14 | 15 | ## For secondary mailservers - indicates not to verify message from these hosts 16 | # PeerList X.X.X.X 17 | 18 | # ADSPDiscard no 19 | 20 | # PidFile /var/run/opendkim/opendkim.pid 21 | 22 | -------------------------------------------------------------------------------- /opendkim/opendkim.conf.simple.in: -------------------------------------------------------------------------------- 1 | # This is a simple config file for signing and verifying 2 | 3 | #LogWhy yes 4 | Syslog yes 5 | SyslogSuccess yes 6 | 7 | Canonicalization relaxed/simple 8 | 9 | Domain @DOMAIN@ 10 | Selector default 11 | KeyFile /var/db/dkim/@DOMAIN@.private 12 | 13 | Socket inet:8891@localhost 14 | 15 | ReportAddress postmaster@@DOMAIN@ 16 | SendReports yes 17 | 18 | ## Hosts to sign email for - 127.0.0.1 is default 19 | ## See the OPERATION section of opendkim(8) for more information 20 | # 21 | # InternalHosts 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12 22 | 23 | ## For secondary mailservers - indicates not to sign or verify messages 24 | ## from these hosts 25 | # 26 | # PeerList X.X.X.X 27 | 28 | # PidFile /var/run/opendkim/opendkim.pid 29 | -------------------------------------------------------------------------------- /opendkim/reputation.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 6 | ** 7 | */ 8 | 9 | #ifndef _REPUTATION_H_ 10 | #define _REPUTATION_H_ 11 | 12 | /* system includes */ 13 | #include 14 | #include 15 | 16 | /* opendkim includes */ 17 | #include "opendkim.h" 18 | #include "opendkim-db.h" 19 | 20 | /* definitions */ 21 | #define DKIMF_REP_DEFCACHETTL 3600 22 | #define DKIMF_REP_DEFFACTOR 1 23 | 24 | /* data types */ 25 | struct reputation; 26 | typedef struct reputation * DKIMF_REP; 27 | 28 | /* PROTOTYPES */ 29 | extern int dkimf_rep_init __P((DKIMF_REP *, time_t, unsigned int, unsigned int, 30 | char *, char *, DKIMF_DB, DKIMF_DB, DKIMF_DB, 31 | DKIMF_DB)); 32 | extern int dkimf_rep_check __P((DKIMF_REP, DKIM_SIGINFO *, _Bool, 33 | void *, size_t, unsigned long *, float *, 34 | unsigned long *, unsigned long *, 35 | char *, size_t)); 36 | extern int dkimf_rep_chown_cache __P((DKIMF_REP, uid_t)); 37 | extern void dkimf_rep_close __P((DKIMF_REP)); 38 | 39 | #endif /* _REPUTATION_H_ */ 40 | -------------------------------------------------------------------------------- /opendkim/screen.lua.sample: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright (c) 2009, 2010, 2012, The Trusted Domain Project. 3 | -- All rights reserved. 4 | -- 5 | -- screen.lua.sample -- sample version of the "screen" script that demonstrates 6 | -- all of the features of the configuration file 7 | -- 8 | -- The screen script is executed after all header fields have been received 9 | -- and after signatures have been selected, but before the message body 10 | -- is handled. Here we have an opportunity to identify and ignore signatures 11 | -- we know we don't trust. 12 | 13 | -- retrieve the count of signatures on the message 14 | nsigs = odkim.get_sigcount(ctx) 15 | if nsigs == nil then 16 | return nil 17 | end 18 | 19 | -- get the From: domain 20 | fdomain = odkim.get_fromdomain(ctx) 21 | if fdomain == nil then 22 | return nil 23 | end 24 | 25 | -- for each signature, ignore it if it's not from the sender's domain 26 | for n = 1, nsigs do 27 | sig = odkim.get_signhandle(ctx, n) 28 | sdomain = odkim.sig_getdomain(sig) 29 | if fdomain ~= sdomain then 30 | odkim.sig_ignore(sig) 31 | end 32 | end 33 | 34 | -- That's it! 35 | return nil 36 | -------------------------------------------------------------------------------- /opendkim/stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 6 | ** 7 | */ 8 | 9 | #ifndef _STATS_H_ 10 | #define _STATS_H_ 11 | 12 | /* system includes */ 13 | #include 14 | #include 15 | #include 16 | 17 | /* libopendkim includes */ 18 | #include 19 | 20 | /* opendkim includes */ 21 | #include "opendkim.h" 22 | 23 | #define DKIMS_VERSION 3 24 | 25 | /* column numbers */ 26 | #define DKIMS_MI_JOBID 0 27 | #define DKIMS_MI_REPORTER 1 28 | #define DKIMS_MI_FROMDOMAIN 2 29 | #define DKIMS_MI_IPADDR 3 30 | #define DKIMS_MI_MSGTIME 4 31 | #define DKIMS_MI_MSGLEN 5 32 | #define DKIMS_MI_SIGCOUNT 6 33 | #define DKIMS_MI_ATPS 7 34 | #define DKIMS_MI_SPAM 8 35 | #define DKIMS_MI_MAX 8 36 | 37 | #define DKIMS_SI_DOMAIN 0 38 | #define DKIMS_SI_PASS 1 39 | #define DKIMS_SI_FAIL_BODY 2 40 | #define DKIMS_SI_SIGLENGTH 3 41 | #define DKIMS_SI_SIGERROR 4 42 | #define DKIMS_SI_DNSSEC 5 43 | #define DKIMS_SI_MAX 5 44 | 45 | /* PROTOTYPES */ 46 | extern void dkimf_stats_init __P((void)); 47 | extern int dkimf_stats_record __P((char *, u_char *, char *, char *, Header, 48 | DKIM *, 49 | #ifdef _FFR_STATSEXT 50 | struct statsext *, 51 | #endif /* _FFR_STATSEXT */ 52 | int, int, struct sockaddr *)); 53 | 54 | #endif /* _STATS_H_ */ 55 | -------------------------------------------------------------------------------- /opendkim/test.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2007 Sendmail, Inc. and its suppliers. 3 | ** All rights reserved. 4 | ** 5 | ** Copyright (c) 2009-2012, The Trusted Domain Project. All rights reserved. 6 | ** 7 | */ 8 | 9 | #ifndef _TEST_H_ 10 | #define _TEST_H_ 11 | 12 | /* system includes */ 13 | #include 14 | #include 15 | 16 | /* libmilter includes */ 17 | #include 18 | 19 | /* libopendkim includes */ 20 | #include "dkim.h" 21 | 22 | /* PROTOTYPES */ 23 | extern int dkimf_testfiles __P((DKIM_LIB *, char *, uint64_t, bool, int)); 24 | 25 | extern int dkimf_test_addheader __P((void *, char *, char *)); 26 | extern int dkimf_test_addrcpt __P((void *, char *)); 27 | extern int dkimf_test_chgheader __P((void *, char *, int, char *)); 28 | extern int dkimf_test_delrcpt __P((void *, char *)); 29 | extern void *dkimf_test_getpriv __P((void *)); 30 | extern char *dkimf_test_getsymval __P((void *, char *)); 31 | extern int dkimf_test_insheader __P((void *, int, char *, char *)); 32 | extern int dkimf_test_progress __P((void *)); 33 | extern int dkimf_test_quarantine __P((void *, char *)); 34 | extern int dkimf_test_setpriv __P((void *, void *)); 35 | extern int dkimf_test_setreply __P((void *, char *, char *, char *)); 36 | 37 | #endif /* _TEST_H_ */ 38 | -------------------------------------------------------------------------------- /opendkim/tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *~ 6 | *.pc 7 | *.gcda 8 | *.gcno 9 | *.gmon 10 | *.prof 11 | *.info 12 | *.gcov 13 | *.trs 14 | *.log 15 | t-*[0-9] 16 | t-verifyperf 17 | t-signperf 18 | t-cleanup 19 | t-setup 20 | .deps/ 21 | .libs/ 22 | .info-files 23 | autom4te.cache/ 24 | autoscan-*.log 25 | build-config.h.in 26 | compile 27 | config.guess 28 | config.sub 29 | configure 30 | configure.scan 31 | aclocal.m4 32 | description.html 33 | description.txt 34 | depcomp 35 | install-sh 36 | missing 37 | stamp-h* 38 | build-config.h 39 | config.log 40 | config.status 41 | ltmain.sh 42 | libtool 43 | Makefile.in 44 | Makefile 45 | symbols.map 46 | .libs 47 | .deps 48 | core 49 | *.core 50 | opendkim-testadsp 51 | opendkim 52 | opendkim-stats 53 | opendkim-testkey 54 | opendkim*.[58] 55 | test.sock 56 | gmon.out 57 | -------------------------------------------------------------------------------- /opendkim/tests/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains unit tests run against the filter, written using the 3 | Lua language and executed via the "miltertest" tool found below the main 4 | source directory. 5 | -------------------------------------------------------------------------------- /opendkim/tests/cp-test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # small tool to copy a test case 4 | 5 | # XXX TODO arg 3 should be a description approprately inserted to the files 6 | 7 | if [ $# -lt 2 ] 8 | then 9 | echo requires more parameters 10 | echo usage: $0 fromtestcasename totestcasename 11 | exit 1 12 | fi 13 | for a in $1 $1.*; 14 | do 15 | dest=${a/$1/$2} 16 | echo copying $a to $dest 17 | sed -e s/$1/$2/g $a > $dest 18 | done 19 | chmod a+x $2 20 | -------------------------------------------------------------------------------- /opendkim/tests/gcov-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $1 3 | x=$? 4 | myname=`basename $1` 5 | if test x"$OSTYPE" = x"OpenBSD" 6 | then 7 | mv *$myname.bb $myname.bb 8 | mv *$myname.bbg $myname.bbg 9 | mv *$myname.da $myname.da 10 | else 11 | mv *$myname.gcda $myname.gcda 12 | mv *$myname.gcno $myname.gcno 13 | fi 14 | exit $x 15 | -------------------------------------------------------------------------------- /opendkim/tests/lcov-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $1 3 | x=$? 4 | # keep consistant with Makefile.am 5 | testname=${1/.\/t-} 6 | testname=${testname//-/_} 7 | lcov --capture --directory ../.. --output-file $1.info --test-name ${testname} --quiet 8 | lcov --remove $1.info '/usr/include/*' --output-file $1.info --quiet & 9 | exit $x 10 | -------------------------------------------------------------------------------- /opendkim/tests/lcov/.gitignore: -------------------------------------------------------------------------------- 1 | [a-z]* 2 | -------------------------------------------------------------------------------- /opendkim/tests/lcov/README: -------------------------------------------------------------------------------- 1 | This directory will contain the output of an "lcov" (code coverage) report 2 | run during packaging of this release. To read it, point your favourite 3 | browser at "index.html" in this directory. 4 | 5 | -------------------------------------------------------------------------------- /opendkim/tests/pubkeys: -------------------------------------------------------------------------------- 1 | example2.com foo 2 | _adsp._domainkey.example2.com dkim=all; ra=adsp-feedback 3 | revoked._domainkey.example.com k=rsa; t=y; p= 4 | _report._domainkey.example.com ra=dkim-feedbacks 5 | UN42N5XOV642KXRXRQIYANHCOUPGQL5LT4WTBKYT2IJFLBWODFDQ====._atps.example.net v=ATPS1 6 | report._domainkey.example.com v=DKIM1; k=rsa; r=dkim-feedbacks; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9p5rp5EjC8cZbnlUpasA5HoUYwSA+HEBsBZnxppmehsiCLY/rSGDxmYaOL2LhGJur4UnXzTRpB/VgPTNOn3bkudEARqu0H2W6afEcI46igMs8fuZlyIi+UMGdUbn5tgbTRS7g6r9bxOcxwTtZcKAhvCWfDiTc2QeEzzxxyL4jewIDAQAB 7 | test._domainkey.example.com v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9p5rp5EjC8cZbnlUpasA5HoUYwSA+HEBsBZnxppmehsiCLY/rSGDxmYaOL2LhGJur4UnXzTRpB/VgPTNOn3bkudEARqu0H2W6afEcI46igMs8fuZlyIi+UMGdUbn5tgbTRS7g6r9bxOcxwTtZcKAhvCWfDiTc2QeEzzxxyL4jewIDAQAB 8 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2012, 2013, The Trusted Domain Project. All rights reserved. 4 | # 5 | # Configuration validity check 6 | 7 | echo "*** configuration validity checks" 8 | 9 | if [ x"$srcdir" = x"" ] 10 | then 11 | srcdir=`pwd` 12 | fi 13 | 14 | if ../../miltertest/miltertest -s $srcdir/t-conf-check.lua > /dev/null 2>&1 15 | then 16 | echo ERROR: opendkim started with a faulty configuration 17 | exit 1 18 | fi 19 | 20 | if ../../miltertest/miltertest -s $srcdir/t-conf-check2.lua > /dev/null 2>&1 21 | then 22 | echo ERROR: opendkim started with a faulty configuration 23 | exit 1 24 | fi 25 | 26 | if ! ../opendkim -n -x $srcdir/t-largecomment.conf > /dev/null 2>&1 27 | then 28 | echo ERROR: opendkim failed using a configuration file with a large comment 29 | exit 1 30 | fi 31 | 32 | exit 0 33 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check.conf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | # Configuration validity check 4 | 5 | Background No 6 | Mode s 7 | SigningTable file:t-conf-check.signtable 8 | KeyTable file:t-conf-check.keytable 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check.keytable: -------------------------------------------------------------------------------- 1 | key1 example.com:ts:testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2009, 2010, 2012, 2013, The Trusted Domain Project. 2 | -- All rights reserved. 3 | 4 | -- Configuration validity check 5 | -- 6 | -- Confirms that the configuration file is acceptable (fail test) 7 | 8 | mt.echo("*** invalid signing configuration test") 9 | 10 | -- setup 11 | if TESTSOCKET ~= nil then 12 | sock = TESTSOCKET 13 | else 14 | sock = "unix:" .. mt.getcwd() .. "/t-conf-check.sock" 15 | end 16 | binpath = mt.getcwd() .. "/.." 17 | if os.getenv("srcdir") ~= nil then 18 | mt.chdir(os.getenv("srcdir")) 19 | end 20 | 21 | -- try to start the filter 22 | mt.startfilter(binpath .. "/opendkim", "-x", "t-conf-check.conf", "-p", sock) 23 | 24 | -- try to connect to it 25 | conn = mt.connect(sock, 40, 0.25) 26 | if conn ~= nil then 27 | error("mt.connect() succeeded (shouldn't have)") 28 | end 29 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check.signtable: -------------------------------------------------------------------------------- 1 | example.com key1 2 | example.net key2 3 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check2.conf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012, The Trusted Domain Project. All rights reserved. 2 | # 3 | # Configuration validity check #2 4 | 5 | Background No 6 | Mode s 7 | SigningTable file:t-conf-check2.signtable 8 | KeyTable file:t-conf-check2.keytable 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check2.keytable: -------------------------------------------------------------------------------- 1 | key1 example.com:ts:testkey.private 2 | key2 example.net:ts 3 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check2.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2009, 2010, 2012, 2013, The Trusted Domain Project. 2 | -- All rights reserved. 3 | 4 | -- Configuration validity check2 5 | -- 6 | -- Confirms that the configuration file is acceptable (fail test) 7 | 8 | mt.echo("*** invalid signing configuration test") 9 | 10 | -- setup 11 | if TESTSOCKET ~= nil then 12 | sock = TESTSOCKET 13 | else 14 | sock = "unix:" .. mt.getcwd() .. "/t-conf-check2.sock" 15 | end 16 | binpath = mt.getcwd() .. "/.." 17 | if os.getenv("srcdir") ~= nil then 18 | mt.chdir(os.getenv("srcdir")) 19 | end 20 | 21 | -- try to start the filter 22 | mt.startfilter(binpath .. "/opendkim", "-x", "t-conf-check2.conf", "-p", sock) 23 | 24 | -- try to connect to it 25 | conn = mt.connect(sock, 40, 0.25) 26 | if conn ~= nil then 27 | error("mt.connect() succeeded (shouldn't have)") 28 | end 29 | -------------------------------------------------------------------------------- /opendkim/tests/t-conf-check2.signtable: -------------------------------------------------------------------------------- 1 | example.com key1 2 | example.net key2 3 | -------------------------------------------------------------------------------- /opendkim/tests/t-dontsign: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # "DontSignMailTo" test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-dontsign.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-dontsign.conf: -------------------------------------------------------------------------------- 1 | # 2 | # "DontSignMailTo" test 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | DontSignMailTo recipient@example.org 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-rbl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple verifying test using Lua's RBL feature 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-lua-rbl.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-rbl.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Lua RBL test configuration 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | FinalPolicyScript t-lua-rbl.lua-final 8 | TestPublicKeys pubkeys 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-rbl.lua-final: -------------------------------------------------------------------------------- 1 | 2 | -- Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 3 | 4 | -- sample "final" hook script that issues an RBL query 5 | 6 | -- make the RBL request 7 | a,b,c,d = odkim.rbl_check(ctx, "2.0.0.127", "sbl.spamhaus.org") 8 | 9 | odkim.add_header(ctx, "X-Lua-RBL", tostring(a) .. "." .. tostring(b) .. "." .. 10 | tostring(c) .. "." .. tostring(d)) 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-speed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing speed test with and without Lua 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | echo ===== signing without Lua 12 | ../../miltertest/miltertest $MILTERTESTFLAGS -u -s $srcdir/t-lua-speed-nolua.lua 13 | echo ===== signing with Lua 14 | ../../miltertest/miltertest $MILTERTESTFLAGS -u -s $srcdir/t-lua-speed-lua.lua 15 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-speed-lua.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test with Lua 3 | 4 | Background No 5 | RequireSafeKeys No 6 | KeyFile testkey.private 7 | Selector test 8 | SetupPolicyScript t-lua-speed-lua.lua-setup 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-speed-lua.lua-setup: -------------------------------------------------------------------------------- 1 | 2 | -- Copyright (c) 2009, 2010, 2012, The Trusted Domain Project. 3 | -- All rights reserved. 4 | 5 | -- sample "setup" hook script that issues a single signing request 6 | 7 | -- make the signing request 8 | odkim.sign(ctx) 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-speed-nolua.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test without Lua 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-verify-tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # Lua tests 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-lua-verify-tests.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-verify-tests.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple verifying test with Lua features 3 | 4 | TestPublicKeys pubkeys 5 | Mode v 6 | On-BadSignature reject 7 | Background No 8 | SetupPolicyScript t-lua-verify-tests.lua-setup 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-lua-verify-tests.lua-setup: -------------------------------------------------------------------------------- 1 | 2 | -- Copyright (c) 2010-2012, The Trusted Domain Project. All rights reserved. 3 | 4 | -- sample "setup" hook script that does various Lua things 5 | 6 | -- change the From: header field before signing 7 | odkim.replace_header(ctx, "From", 0, "user@example.com") 8 | -------------------------------------------------------------------------------- /opendkim/tests/t-peer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # Test of peer IP calculations 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-peer.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-peer.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Test of peer calculations 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | PeerList file:t-peer.list 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-peer.list: -------------------------------------------------------------------------------- 1 | .example.com 2 | !nonpeer.example.com 3 | !.nonpeer.example.com 4 | allowed.nonpeer.example.com 5 | smtp.example.net 6 | 192.168.1.0/24 7 | !192.168.1.64 8 | !192.168.1.128/30 9 | 2001:db8::/64 10 | !2001:db8::99 11 | !2001:db8::fff0/126 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-atps: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test with ATPS 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-atps.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-atps.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test with ATPS 3 | 4 | Background No 5 | KeyTable csl:key1=example.com:test:./testkey.private 6 | SigningTable csl:*=key1 7 | ATPSDomains example.net 8 | RequireSafeKeys No 9 | Canonicalization relaxed/simple 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-report: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test requesting reports 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-report.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-report.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test requesting reports 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | RequestReports true 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-lua: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test using tables and a Lua hook 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-lua.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-lua.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test using tables and Lua 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-lua.keys 8 | SigningTable file:t-sign-rs-lua.sign 9 | SetupPolicyScript t-sign-rs-lua.lua-setup 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-lua.keys: -------------------------------------------------------------------------------- 1 | testkey example.com:test:./testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-lua.lua-setup: -------------------------------------------------------------------------------- 1 | 2 | -- Copyright (c) 2009, 2010, 2012, The Trusted Domain Project. 3 | -- All rights reserved. 4 | 5 | -- sample "setup" hook script that issues a single signing request 6 | 7 | -- make the signing request 8 | odkim.sign(ctx, "testkey", "signer@example.com") 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-lua.sign: -------------------------------------------------------------------------------- 1 | user@example.com testkey 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-mixconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test using KeyTable and SetupPolicyScript 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-mixconf.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-mixconf.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-mixconf.keys 8 | SetupPolicyScript t-sign-rs-mixconf.lua-setup 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-mixconf.keys: -------------------------------------------------------------------------------- 1 | testkey example.com:test:./testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-mixconf.lua-setup: -------------------------------------------------------------------------------- 1 | 2 | -- Copyright (c) 2009, 2010, 2012, The Trusted Domain Project. 3 | -- All rights reserved. 4 | 5 | -- sample "setup" hook script that issues a single signing request 6 | 7 | -- make the signing request 8 | odkim.sign(ctx, "testkey") 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-multiple: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple multiple signing test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-multiple.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-multiple.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test with multiple signatures 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-multiple.keys 8 | SigningTable file:t-sign-rs-multiple.sign 9 | MultipleSignatures True 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-multiple.keys: -------------------------------------------------------------------------------- 1 | testkey example.com:test:./testkey.private 2 | testkey2 example.net:test2:./testkey.private 3 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-multiple.sign: -------------------------------------------------------------------------------- 1 | user@example.com testkey 2 | example.com testkey2 3 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test using tables 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-tables.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-bad: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test using invalid KeyTable 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-tables-bad.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-bad.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test with invalid KeyTable 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-tables-bad.keys 8 | SigningTable file:t-sign-rs-tables.sign 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-bad.keys: -------------------------------------------------------------------------------- 1 | testkey example.com test ./testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-token: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # relaxed/simple signing test using KeyTable with the domain token 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-rs-tables-token.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-token.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test with KeyTable using domain token 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-tables-token.keys 8 | SigningTable file:t-sign-rs-tables.sign 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables-token.keys: -------------------------------------------------------------------------------- 1 | testkey %:test:./testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test 3 | 4 | Background No 5 | Canonicalization relaxed/simple 6 | RequireSafeKeys No 7 | KeyTable file:t-sign-rs-tables.keys 8 | SigningTable file:t-sign-rs-tables.sign 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables.keys: -------------------------------------------------------------------------------- 1 | testkey example.com:test:./testkey.private 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs-tables.sign: -------------------------------------------------------------------------------- 1 | user@example.com testkey 2 | user2@example.com testkey:signer@example.com 3 | user3@example.com testkey:signer@foo.% 4 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-rs.conf: -------------------------------------------------------------------------------- 1 | # 2 | # relaxed/simple signing test 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | Canonicalization relaxed/simple 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test for all domains 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-all.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-all.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test 3 | 4 | Background No 5 | Domain * 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-ltag: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test with l= tag 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-ltag.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-ltag.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test with l= tag 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | BodyLengthDB csl:* 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test using macro-based origin selection 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-macro.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro-value: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test using macro-based origin selection with value test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-macro-value.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro-value-file: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test using macro-based origin selection with value test 5 | # configured with a file 6 | 7 | if [ x"$srcdir" = x"" ] 8 | then 9 | srcdir=`pwd` 10 | fi 11 | 12 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-macro-value-file.lua 13 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro-value-file.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test using macros to validate origin with value test 3 | # configured with a file 4 | 5 | Background No 6 | Domain example.com 7 | RequireSafeKeys No 8 | KeyFile testkey.private 9 | Selector test 10 | InternalHosts - 11 | MacroList file:t-sign-ss-macro-value-file.list 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro-value-file.list: -------------------------------------------------------------------------------- 1 | testmacro testvalue 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro-value.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test using macros to validate origin with value test 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | InternalHosts - 10 | MacroList testmacro=testvalue 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-macro.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test using macros to validate origin 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | InternalHosts - 10 | MacroList testmacro 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-replace: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple signing test with header field replacement 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-replace.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-replace.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test with header field replacement 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | ReplaceRules t-sign-ss-replace.txt 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-replace.txt: -------------------------------------------------------------------------------- 1 | @host.example.com @example.com 2 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-x: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # simple/simple signing test requesting an "x=" tag 4 | 5 | if [ x"$srcdir" = x"" ] 6 | then 7 | srcdir=`pwd` 8 | fi 9 | 10 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-sign-ss-x.lua 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss-x.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test with SignatureTTL set 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | SignatureTTL 86400 10 | -------------------------------------------------------------------------------- /opendkim/tests/t-sign-ss.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple signing test 3 | 4 | Background No 5 | Domain example.com 6 | RequireSafeKeys No 7 | KeyFile testkey.private 8 | Selector test 9 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-double-from: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # test a message with two From: fields 4 | 5 | if [ x"$srcdir" = x"" ] 6 | then 7 | srcdir=`pwd` 8 | fi 9 | 10 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-double-from.lua 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-double-from.conf: -------------------------------------------------------------------------------- 1 | # double-From: test 2 | 3 | Background No 4 | On-BadSignature reject 5 | StrictHeaders Yes 6 | Mode v 7 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-malformed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # malformed From: field test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-malformed.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-malformed.conf: -------------------------------------------------------------------------------- 1 | # malformed From: field verifying test 2 | 3 | Background No 4 | Mode v 5 | KeyTable file:t-sign-rs-multiple.keys 6 | SigningTable file:t-sign-rs-multiple.sign 7 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-report: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # verify reporting of failed signatures 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | export TMPFILE=`mktemp /tmp/opendkim-XXXXXXXXX` 12 | 13 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-report.lua || exit 1 14 | # ignore version differences in useragent and arrival date 15 | diff -I ^User-Agent -I ^Arrival-Date -I ^Date \ 16 | -u $srcdir/t-verify-report.txt ${TMPFILE} || exit 1 17 | rm -f ${TMPFILE} 18 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-report.conf: -------------------------------------------------------------------------------- 1 | # 2 | # simple/simple verifying test with report generation 3 | 4 | Background No 5 | Mode v 6 | TestPublicKeys pubkeys 7 | TestDNSData file:pubkeys 8 | SendReports yes 9 | ReportAddress "Mail Admin" 10 | ReportBccAddress postmaster@example.net, tom@example.net, "hary" 11 | MTACommand ./testmta 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-report.txt: -------------------------------------------------------------------------------- 1 | -t 2 | -fpostmaster@example.org 3 | From: "Mail Admin" 4 | To: dkim-feedbacks@example.com 5 | Bcc: postmaster@example.net, tom@example.net, "hary" 6 | Subject: DKIM failure report for t-verify-report 7 | MIME-Version: 1.0 8 | Content-Type: multipart/report; report-type=feedback-report; 9 | boundary="dkimreport/unknown-host/t-verify-report" 10 | --dkimreport/unknown-host/t-verify-report 11 | Content-Type: text/plain 12 | 13 | DKIM failure report for job t-verify-report on unknown-host 14 | 15 | The canonicalized form of the failed message's header and body are 16 | attached. 17 | 18 | --dkimreport/unknown-host/t-verify-report 19 | Content-Type: message/feedback-report 20 | 21 | User-Agent: OpenDKIM-Filter/2.3.1 22 | Version: 0.1 23 | Original-Envelope-Id: t-verify-report 24 | Original-Mail-From: user@example.com 25 | Reporting-MTA: unknown-host 26 | Source-IP: 127.0.0.1 27 | Message-ID: <184510.abcdefg@example.com> 28 | Arrival-Date: Mon, 14 Mar 2011 16:41:35 -0700 29 | Reported-Domain: example.com 30 | Delivery-Result: other 31 | Feedback-Type: auth-failure 32 | Auth-Failure: signature (signature verification failed) 33 | DKIM-Failure: signature 34 | DKIM-Domain: example.com 35 | DKIM-Selector: test 36 | DKIM-Identity: @example.com 37 | DKIM-Canonicalized-Header: RnJvbTogdXNlckBleDRtcGxlLmNvbQ0KRGF0ZTogVHVl 38 | LCAyMiBEZWMgMjAwOSAxMzowNDoxMiAtMDgwMA0KU3ViamVjdDogU2lnbmluZyB0ZXN0 39 | DQpES0lNLVNpZ25hdHVyZTogdj0xOyBhPXJzYS1zaGEyNTY7IGM9c2ltcGxlL3NpbXBs 40 | ZTsgZD1leGFtcGxlLmNvbTsgcz10ZXN0Ow0KCXQ9MTMyOTExMzQxMjsgcj15OyBiaD0z 41 | VldHUUdZK2NTTllkMU1HTStYNmhSWFUwc3RsOEpDYVF0bDRtYlgvajJJPTsNCgloPUZy 42 | b206RGF0ZTpTdWJqZWN0Ow0KCWI9 43 | DKIM-Canonicalized-Body: VGhpcyBpcyBhIHRlc3QhDQo= 44 | 45 | --dkimreport/unknown-host/t-verify-report 46 | Content-Type: text/rfc822-headers 47 | 48 | DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=example.com; s=test; 49 | t=1329113412; r=y; bh=3VWGQGY+cSNYd1MGM+X6hRXU0stl8JCaQtl4mbX/j2I=; 50 | h=From:Date:Subject; 51 | b=J4DYccKlZx8+EFXvnUEZyiQn2JNpQ0JSvTT1PeyGfrYPAux//SHXb/K/Z6jYzqH5z 52 | ZkiQ5UutfDjkkW2WsRCilkvodnp0PGrLK5fDFHBK7vGTLzXyhI/zubkeYVZufd+9U7 53 | kuVE9jz2Vb4YDL8DC9EZJ5SyAY8uNnsrky8gQ948= 54 | From: user@ex4mple.com 55 | Date: Tue, 22 Dec 2009 13:04:12 -0800 56 | Subject: Signing test 57 | Message-ID: <184510.abcdefg@example.com> 58 | 59 | --dkimreport/unknown-host/t-verify-report-- 60 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-revoked: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # verify revoked key test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-revoked.lua -v -v -v 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-revoked.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test with revoked key 2 | 3 | Background No 4 | Mode v 5 | TestPublicKeys pubkeys 6 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple verifying test (should pass) 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-ss.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-ar-bad: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # simple/simple verifying test with oversized Authentication-Results (should 4 | # not crash) 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-ss-ar-bad.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-ar-bad.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test with oversized Authentication-Results (should 2 | # not crash) 3 | 4 | TestPublicKeys pubkeys 5 | Mode v 6 | On-BadSignature reject 7 | Background No 8 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-atps: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple verifying test with an ATPS result 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-ss-atps.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-atps.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test with ATPS 2 | 3 | TestPublicKeys pubkeys 4 | TestDNSData file:pubkeys 5 | Mode v 6 | On-BadSignature reject 7 | Background No 8 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-bad: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple verifying test (should fail) 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-ss-bad.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-bad.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test (should fail) 2 | 3 | TestPublicKeys pubkeys 4 | Mode v 5 | On-BadSignature reject 6 | Background No 7 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-rep: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # simple/simple verifying test with reputation checks 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-ss-rep.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss-rep.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test with reputation checks 2 | 3 | TestPublicKeys pubkeys 4 | Mode v 5 | On-BadSignature reject 6 | Background No 7 | ReputationLimits csl:*=72 8 | ReputationRatios csl:*=0.5 9 | ReputationTimeFactor 24 10 | ReputationSpamCheck /^X-Spam: ?[Yy][Ee][Ss]/ 11 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-ss.conf: -------------------------------------------------------------------------------- 1 | # simple/simple verifying test (should pass) 2 | 3 | TestPublicKeys pubkeys 4 | Mode v 5 | On-BadSignature reject 6 | Background No 7 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-syntax: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # unspecified protocol family test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-syntax.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-syntax.conf: -------------------------------------------------------------------------------- 1 | # bad signature protocol test 2 | 3 | Background No 4 | On-BadSignature reject 5 | Mode v 6 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unsigned: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # unsigned message test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-unsigned.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unsigned-silent: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # silent unsigned message test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-unsigned-silent.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unsigned-silent.conf: -------------------------------------------------------------------------------- 1 | # unsigned message verifying test (silent) 2 | 3 | Background No 4 | Mode v 5 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unsigned.conf: -------------------------------------------------------------------------------- 1 | # unsigned message verifying test 2 | 3 | Background No 4 | Mode v 5 | AlwaysAddARHeader True 6 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unspec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # unspecified protocol family test 5 | 6 | if [ x"$srcdir" = x"" ] 7 | then 8 | srcdir=`pwd` 9 | fi 10 | 11 | ../../miltertest/miltertest $MILTERTESTFLAGS -s $srcdir/t-verify-unspec.lua 12 | -------------------------------------------------------------------------------- /opendkim/tests/t-verify-unspec.conf: -------------------------------------------------------------------------------- 1 | # unspecified protocol test 2 | 3 | Background No 4 | Mode v 5 | -------------------------------------------------------------------------------- /opendkim/tests/testkey.private: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQC9p5rp5EjC8cZbnlUpasA5HoUYwSA+HEBsBZnxppmehsiCLY/r 3 | SGDxmYaOL2LhGJur4UnXzTRpB/VgPTNOn3bkudEARqu0H2W6afEcI46igMs8fuZl 4 | yIi+UMGdUbn5tgbTRS7g6r9bxOcxwTtZcKAhvCWfDiTc2QeEzzxxyL4jewIDAQAB 5 | AoGAJlOEntefTKYHa+RnWWNVTTW5t/LvTR3wduP65DbCvKKISqZiey25SZm482ro 6 | FI0giG+SuKWjfcY59CTqBW18XQrN3PmYAKfL6yOOA5jb7yEOqQWIC77amUvBJ1CQ 7 | 5HDHT/L18E1K7A92lmS4FV94r8Qu9yWMOCdW7+vKO8HcTiECQQD7JYh45YSceDSU 8 | kHIPpCQhGXvGPhB2sp5beP13zVYtXYq5bBape9iMgD80Ql0swCdK5C8d/H0WUygC 9 | WH9IXYuFAkEAwVHcU+bsyjQ2SI8mHiGLWBUkxGOmcpLuvQawrGFK0VhRPStWmh38 10 | t9kwCCtvA4GqPy2UWFE+DvUrV2cWYA6i/wJBAPEDsvU6Zcn2/Za5DA0Am398QjEc 11 | LJaMkbX85VoMHzCH/XI2TYU2iblD9ePD8EDa4ppXYvQm8y/ye4nMvdGHnDUCQQCp 12 | pROLET/EJdNpEy2pDVjBoDRWnvgG3Ufh20gYzXwhf7YyzqA9uIj4MQCEetD9q8Dh 13 | ljby1cB20dEJ7y3kd5OzAkBfhe+7Yj1vqJbbiL4l7AEVoJ06scnnRS3P8XQaMxY3 14 | 29G3iZoC/+P7Si1hQZKj7GhmDpY/4fkocOQ5l9ufaeKt 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /opendkim/tests/testmta: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2010, 2012, The Trusted Domain Project. All rights reserved. 4 | # 5 | # Dummy "MTA" that just writes stdin to a file for testing. 6 | 7 | while [ "$1" != "" ]; 8 | do 9 | echo $1 >> $TMPFILE 10 | shift 11 | done 12 | 13 | cat >> $TMPFILE 14 | -------------------------------------------------------------------------------- /reprrd/.gitignore: -------------------------------------------------------------------------------- 1 | opendkim-reprrdimport 2 | opendkim-reprrdimport.8 3 | -------------------------------------------------------------------------------- /reprrd/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2013, The Trusted Domain Project. All rights reserved. 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | 5 | lib_LTLIBRARIES = libreprrd.la 6 | libreprrd_la_SOURCES = reprrd.c reprrd.h 7 | libreprrd_la_LIBADD = $(RRDTOOL_LIBS) 8 | libreprrd_la_LDFLAGS = -no-undefined $(PTHREAD_LDFLAGS) -version-info 1:0:0 9 | libreprrd_la_CFLAGS = $(PTHREAD_CFLAGS) $(RRDTOOL_CFLAGS) 10 | libreprrd_la_CC = $(PTHREAD_CC) 11 | libreprrdincludedir = $(includedir)/reprrd 12 | libreprrdinclude_HEADERS = reprrd.h 13 | 14 | dist_doc_DATA = README reprrd.php reprrd-config.php 15 | 16 | dist_bin_SCRIPTS = opendkim-reprrdimport 17 | 18 | dist_man_MANS = opendkim-reprrdimport.8 19 | -------------------------------------------------------------------------------- /reprrd/README: -------------------------------------------------------------------------------- 1 | This is the development area for the experimental DKIM-based reputation 2 | system that uses time series evaluation methods, as opposed to the contents 3 | of ../reputation which uses predictive inference. 4 | 5 | As with the other reputation system, this method uses the data collected 6 | by the statistics system as input. It also uses the concept of the NULL 7 | domain, defined in that system. Finally, it uses rrdtool[1] to maintain a 8 | sliding window of history about each source (messages and spam ratios). 9 | The tool applies time series forecasting to develop a notion of what is 10 | typical behaviour for the source over the course of a day (peaks and troughs) 11 | and then develops a range of values it considers to be expected. 12 | Deviations from that range are considered abnormal and can be dealt with. 13 | 14 | As of the time of this writing, the system produces the RRD tables for each 15 | domain whose mail has been signed (and soon for the NULL domain), and a PHP 16 | script is provided that can generate graphs on-demand for a given domain 17 | and data type, i.e., "messages" or "spam". The opendkim filter can make 18 | use of the RRD tables to determine if a domain is outside of its expected 19 | norms (overall traffic and spam ratio) and take corrective action when that 20 | conition is true. What remains is to test this in operation at scale, and to 21 | adjust the query to impose rate limits commensurate with spam predictions, 22 | as with the other reputation system. 23 | 24 | More complete documentation will be provided when the above work is complete. 25 | Users are welcome to experiment with what's been built so far and comment 26 | or improve on what's there. 27 | 28 | [1] http://oss.oetiker.ch/rrdtool/ 29 | -------------------------------------------------------------------------------- /reprrd/reprrd-config.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /reprrd/reprrd.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2012, 2013, The Trusted Domain Project. All rights reserved. 3 | */ 4 | 5 | #ifndef _REPRRD_H_ 6 | #define _REPRRD_H_ 7 | 8 | /* system includes */ 9 | #include 10 | #include 11 | 12 | /* constants */ 13 | #ifndef FALSE 14 | # define FALSE 0 15 | #endif /* ! FALSE */ 16 | #ifndef TRUE 17 | # define TRUE 1 18 | #endif /* ! TRUE */ 19 | 20 | /* status codes */ 21 | #define REPRRD_STAT_UNKNOWN (-1) /* unknown status */ 22 | #define REPRRD_STAT_OK 0 /* successful completion */ 23 | #define REPRRD_STAT_INTERNAL 1 /* internal error */ 24 | #define REPRRD_STAT_QUERY 2 /* query failure */ 25 | #define REPRRD_STAT_NODATA 3 /* no data for specified domain */ 26 | 27 | typedef int REPRRD_STAT; 28 | 29 | /* constants */ 30 | #define REPRRD_TYPE_UNKNOWN (-1) 31 | #define REPRRD_TYPE_MESSAGES 0 32 | #define REPRRD_TYPE_SPAM 1 33 | #define REPRRD_TYPE_LIMIT 2 34 | 35 | #define REPRRD_BACKSTEPS 2 36 | #define REPRRD_CF_AVERAGE "AVERAGE" 37 | #define REPRRD_CF_FAILURES "FAILURES" 38 | #define REPRRD_CF_HWPREDICT "HWPREDICT" 39 | #define REPRRD_DEFHASHDEPTH 2 40 | #define REPRRD_STEP 3600 41 | 42 | /* other types */ 43 | struct reprrd_handle; 44 | typedef struct reprrd_handle * REPRRD; 45 | 46 | /* prototypes */ 47 | extern void reprrd_close(REPRRD); 48 | extern REPRRD reprrd_init(const char *, int); 49 | extern REPRRD_STAT reprrd_query(REPRRD, const char *, int, int *, 50 | char *, size_t); 51 | 52 | #endif /* ! _REPRRD_H_ */ 53 | -------------------------------------------------------------------------------- /reprrd/reprrd.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: OpenDKIM RRD query library 9 | Description: Library for performing reputation queries for spammy domains using RRD tables 10 | URL: http://opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} @PTHREAD_CFLAGS@ -lreprrd 13 | Libs.private: @LIBRESOLV@ @PTHREAD_LIBS@ 14 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 15 | 16 | -------------------------------------------------------------------------------- /reputation/.gitignore: -------------------------------------------------------------------------------- 1 | opendkim-genrates.8 2 | opendkim-genrates 3 | opendkim-modtotals.8 4 | opendkim-modtotals 5 | opendkim-rephistory.8 6 | opendkim-rephistory 7 | -------------------------------------------------------------------------------- /reputation/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2013, The Trusted Domain Project. All rights reserved. 2 | 3 | AUTOMAKE_OPTIONS = foreign 4 | 5 | dist_doc_DATA = README repute.php repute-config.php mkdb-rep.mysql 6 | 7 | lib_LTLIBRARIES = librepute.la 8 | librepute_la_SOURCES = repute.c repute.h 9 | librepute_la_LIBADD = $(PTHREAD_LIBS) $(LIBRESOLV) $(CURL_LIBS) $(LIBJANSSON_LIBS) ../libut/libut.la 10 | librepute_la_LDFLAGS = -no-undefined $(PTHREAD_CFLAGS) $(CURL_LDFLAGS) $(LIBJANSSON_LDFLAGS) -version-info 1:0:0 11 | librepute_la_CFLAGS = $(PTHREAD_CFLAGS) $(CURL_CPPFLAGS) $(LIBJANSSON_CPPFLAGS) -I../libut 12 | librepute_la_CC = $(PTHREAD_CC) 13 | libreputeincludedir = $(includedir)/repute 14 | libreputeinclude_HEADERS = repute.h 15 | 16 | dist_sbin_SCRIPTS = opendkim-genrates opendkim-modtotals opendkim-rephistory 17 | 18 | if RPATH 19 | librepute_la_LDFLAGS += -rpath $(libdir) 20 | endif 21 | 22 | pkgconfigdir = $(libdir)/pkgconfig 23 | pkgconfig_DATA = repute.pc 24 | 25 | dist_man_MANS = opendkim-genrates.8 opendkim-modtotals.8 opendkim-rephistory.8 26 | #dist_man_MANS = repute.3 27 | -------------------------------------------------------------------------------- /reputation/mkdb-rep.mysql: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2010-2013, The Trusted Domain Project. All rights reserved. 2 | 3 | -- MySQL command sequence to create a database to accumulate OpenDKIM 4 | -- reputation data 5 | 6 | -- table containing data aggregation for staging to predictions 7 | create table if not exists aggregate ( 8 | id int auto_increment, 9 | reporter int, 10 | domain int not null, 11 | updated timestamp not null default current_timestamp on update current_timestamp, 12 | date timestamp not null default '0000-00-00 00:00:00', 13 | messages int, 14 | spam int, 15 | ratio float, 16 | 17 | primary key (id), 18 | unique key (domain, date, reporter) 19 | ) engine=innodb default charset=latin1; 20 | 21 | -- table mapping domain codes to flow predictions 22 | create table if not exists predictions ( 23 | id int not null auto_increment, 24 | reporter int, 25 | domain int not null, 26 | name varchar(255), 27 | updated timestamp not null default current_timestamp on update current_timestamp, 28 | rate_samples int, 29 | rate_max int, 30 | rate_avg float, 31 | rate_stddev float, 32 | rate_high int, 33 | ratio_max float, 34 | ratio_avg float, 35 | ratio_stddev float, 36 | ratio_high float, 37 | daily_limit_high int, 38 | daily_limit_low int, 39 | today_mail int, 40 | today_spam float, 41 | 42 | primary key (id), 43 | key (name), 44 | unique key (domain, reporter) 45 | ) engine=innodb default charset=latin1; 46 | 47 | -- table containing reputation history 48 | create table if not exists history ( 49 | id int not null auto_increment, 50 | date timestamp not null, 51 | domain int not null, 52 | maxmsgs int, 53 | maxspam float, 54 | maxlimit int, 55 | 56 | primary key(id), 57 | unique key(domain, date) 58 | ) engine=innodb default charset=latin1; 59 | 60 | -- alter domains table to contain "low time" flag 61 | alter table domains add column low_time tinyint unsigned not null default 0; 62 | 63 | -- For upgrading from pre-2.8.0 releases: 64 | -- 65 | -- alter table history add column maxmsgs int after domain, change 66 | -- column ratio maxspam float, change column msglimit maxlimit int; 67 | -------------------------------------------------------------------------------- /reputation/opendkim-modtotals.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-modtotals 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-modtotals 4 | \- OpenDKIM statistics update tool 5 | .SH SYNOPSIS 6 | .B opendkim-modtotals.pl 7 | [options] 8 | .SH DESCRIPTION 9 | .B opendkim-modtotals 10 | collates data accumulated by the OpenDKIM statistics feature about 11 | today's flow of mail, updating stored values about data observed so far 12 | in the current day. The OpenDKIM filter can then use this information and 13 | the output of the 14 | .I opendkim-genrates 15 | script to apply reputation-based filtering of signing domains. 16 | 17 | For a detailed description of the algorithms, see the white paper 18 | "Enforcing Rate Limits Based on Authenticated Sender Reputation." 19 | 20 | This work is experimental. 21 | 22 | .SH OPTIONS 23 | .TP 24 | .I --dbhost=host 25 | Attempts to connect to the database server on the named 26 | .I host. 27 | The default is "localhost". 28 | .TP 29 | .I --dbname=name 30 | Requests a connection to the database called 31 | .I name. 32 | The default is "opendkim". 33 | .TP 34 | .I --dbpasswd=password 35 | Attempts to authenticate to the database server using the specified 36 | .I password. 37 | The default is "opendkim". 38 | .TP 39 | .I --dbport=port 40 | Tries to connect to the database at the specified TCP 41 | .I port. 42 | The default is 3306. 43 | .TP 44 | .I --dbuser=user 45 | Attempts to authenticate to the database server as the specified 46 | .I user. 47 | The default is "opendkim". 48 | .TP 49 | .I --help 50 | Prints a usage message and exits. 51 | .TP 52 | .I --verbose 53 | Requests verbose output. 54 | .TP 55 | .I --version 56 | Prints version number and exits. 57 | .SH VERSION 58 | This man page covers the version of 59 | .I opendkim-modtotals 60 | that shipped with version @VERSION@ of 61 | .I OpenDKIM. 62 | .SH COPYRIGHT 63 | Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 64 | .SH SEE ALSO 65 | .I opendkim(8), 66 | .I opendkim-genrates(8), 67 | .I opendkim-importstats(8) 68 | .P 69 | RFC6376 - DomainKeys Identified Mail 70 | -------------------------------------------------------------------------------- /reputation/opendkim-rephistory.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-rephistory 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-rephistory 4 | \- OpenDKIM reputation history recording tool 5 | .SH SYNOPSIS 6 | .B opendkim-rephistory 7 | [options] 8 | .SH DESCRIPTION 9 | .B opendkim-rephistory 10 | copies the current reputation data for all domains into a history table 11 | to enable observation of the evolution of the reputations of domains over 12 | time. 13 | .SH OPTIONS 14 | .TP 15 | .I --dbhost=host 16 | Attempts to connect to the database server on the named 17 | .I host. 18 | The default is "localhost". 19 | .TP 20 | .I --dbname=name 21 | Requests a connection to the database called 22 | .I name. 23 | The default is "opendkim". 24 | .TP 25 | .I --dbpasswd=password 26 | Attempts to authenticate to the database server using the specified 27 | .I password. 28 | The default is "opendkim". 29 | .TP 30 | .I --dbport=port 31 | Tries to connect to the database at the specified TCP 32 | .I port. 33 | The default is 3306. 34 | .TP 35 | .I --dbuser=user 36 | Attempts to authenticate to the database server as the specified 37 | .I user. 38 | The default is "opendkim". 39 | .TP 40 | .I --expire=days 41 | Indicates the number of days of data to keep. The default is 180. 42 | .TP 43 | .I --help 44 | Prints a usage message and exits. 45 | .TP 46 | .I --verbose 47 | Requests verbose output. 48 | .TP 49 | .I --version 50 | Prints version number and exits. 51 | .SH VERSION 52 | This man page covers the version of 53 | .I opendkim-rephistory 54 | that shipped with version @VERSION@ of 55 | .I OpenDKIM. 56 | .SH COPYRIGHT 57 | Copyright (c) 2011-2013, The Trusted Domain Project. All rights reserved. 58 | .SH SEE ALSO 59 | .I opendkim(8), 60 | .I opendkim-genrates(8), 61 | .I opendkim-importstats(8) 62 | .P 63 | RFC6376 - DomainKeys Identified Mail 64 | -------------------------------------------------------------------------------- /reputation/repute-config.php: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /reputation/repute.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2011-2013, The Trusted Domain Project. All rights reserved. 3 | */ 4 | 5 | #ifndef _REPUTE_H_ 6 | #define _REPUTE_H_ 7 | 8 | /* system includes */ 9 | #include 10 | #include 11 | 12 | /* constants */ 13 | #ifndef FALSE 14 | # define FALSE 0 15 | #endif /* ! FALSE */ 16 | #ifndef TRUE 17 | # define TRUE 1 18 | #endif /* ! TRUE */ 19 | 20 | /* status codes */ 21 | #define REPUTE_STAT_UNKNOWN (-1) /* unknown status */ 22 | #define REPUTE_STAT_OK 0 /* successful completion */ 23 | #define REPUTE_STAT_INTERNAL 1 /* internal error */ 24 | #define REPUTE_STAT_PARSE 2 /* parse failure */ 25 | #define REPUTE_STAT_QUERY 3 /* query failure */ 26 | 27 | #define REPUTE_CACHE 86400 /* XXX -- make this configurable */ 28 | 29 | typedef int REPUTE_STAT; 30 | 31 | /* constant strings */ 32 | #define REPUTE_NAME_REPUTATION "reputation" 33 | #define REPUTE_NAME_REPUTON "reputon" 34 | 35 | #define REPUTE_URI_APPLICATION "email-id" 36 | #define REPUTE_URI_SCHEME "http" 37 | #define REPUTE_URI_TEMPLATE "{scheme}://{service}/.well-known/repute-template" 38 | 39 | #define REPUTE_APPLICATION "application" 40 | #define REPUTE_REPUTONS "reputons" 41 | #define REPUTE_RATER "rater" 42 | #define REPUTE_ASSERTION "assertion" 43 | #define REPUTE_RATED "rated" 44 | #define REPUTE_RATING "rating" 45 | #define REPUTE_CONFIDENCE "confidence" 46 | #define REPUTE_SAMPLE_SIZE "sample-size" 47 | #define REPUTE_GENERATED "generated" 48 | #define REPUTE_EXT_IDENTITY "identity" 49 | #define REPUTE_EXT_RATE "rate" 50 | 51 | #define REPUTE_APPLICATION_VAL "email-id" 52 | #define REPUTE_ID_DKIM "dkim" 53 | #define REPUTE_ASSERT_SPAM "spam" 54 | 55 | /* other types */ 56 | struct repute_handle; 57 | typedef struct repute_handle * REPUTE; 58 | 59 | /* prototypes */ 60 | extern void repute_close(REPUTE); 61 | extern const char * repute_curlversion(REPUTE); 62 | extern const char *repute_error(REPUTE); 63 | extern void repute_init(void); 64 | extern REPUTE repute_new(const char *, unsigned int); 65 | extern REPUTE_STAT repute_query(REPUTE, const char *, float *, 66 | float *, unsigned long *, unsigned long *, 67 | time_t *); 68 | extern void repute_set_timeout(long); 69 | extern void repute_useragent(REPUTE, const char *); 70 | 71 | #endif /* ! _REPUTE_H_ */ 72 | -------------------------------------------------------------------------------- /reputation/repute.pc.in: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a pkg-config metadata file. 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: REPUTE query library 9 | Description: Library for performing REPUTE queries for spammy domains 10 | URL: http://opendkim.org 11 | Version: @VERSION@ 12 | Libs: -L${libdir} @PTHREAD_CFLAGS@ -lrepute 13 | Libs.private: @LIBRESOLV@ @PTHREAD_LIBS@ 14 | Cflags: -I${includedir} @PTHREAD_CFLAGS@ 15 | 16 | -------------------------------------------------------------------------------- /stats/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | opendkim*.[58] 3 | *.lo 4 | *.la 5 | *.a 6 | *~ 7 | *.pc 8 | *.gcda 9 | *.gcno 10 | t-*[0-9] 11 | t-verifyperf 12 | t-signperf 13 | t-cleanup 14 | t-setup 15 | .deps/ 16 | .libs/ 17 | autom4te.cache/ 18 | autoscan-*.log 19 | build-config.h.in 20 | compile 21 | stamp-h* 22 | Makefile.in 23 | Makefile 24 | .deps 25 | .libs 26 | core 27 | *.core 28 | opendkim-anonstats 29 | opendkim-importstats 30 | opendkim-modtotals.pl 31 | opendkim-genstats 32 | opendkim-gengraphs 33 | opendkim-reportstats 34 | opendkim-expire 35 | -------------------------------------------------------------------------------- /stats/Makefile.am: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010-2014, The Trusted Domain Project. All rights reserved. 2 | 3 | exampledir = @docdir@ 4 | dist_example_DATA = mkdb.mysql 5 | 6 | dist_doc_DATA = README README.opendkim-reportstats 7 | dist_sbin_SCRIPTS = opendkim-expire opendkim-gengraphs opendkim-genstats \ 8 | opendkim-reportstats 9 | 10 | man_MANS = opendkim-expire.8 opendkim-gengraphs.8 opendkim-genstats.8 11 | 12 | if USE_ODBX 13 | 14 | sbin_PROGRAMS = opendkim-importstats 15 | 16 | opendkim_importstats_SOURCES = opendkim-importstats.c 17 | opendkim_importstats_CPPFLAGS = $(LIBODBX_CPPFLAGS) -I$(srcdir)/../libopendkim -I$(srcdir)/../opendkim 18 | opendkim_importstats_CFLAGS = $(LIBODBX_CFLAGS) $(COV_CFLAGS) 19 | opendkim_importstats_LDFLAGS = $(LIBODBX_LDFLAGS) $(COV_LDFLAGS) 20 | opendkim_importstats_LDADD = $(LIBODBX_LIBS) $(LIBDL_LIBS) $(COV_LIBADD) 21 | 22 | man_MANS += opendkim-importstats.8 23 | 24 | endif 25 | -------------------------------------------------------------------------------- /stats/opendkim-expire.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-expire 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-expire 4 | \- OpenDKIM statistics data expiration tool 5 | .SH SYNOPSIS 6 | .B opendkim-expire 7 | [options] 8 | .SH DESCRIPTION 9 | .B opendkim-expire 10 | expires old records from the database that is part of the OpenDKIM statistics 11 | feature. 12 | .SH OPTIONS 13 | .TP 14 | .I --dbhost=host 15 | Attempts to connect to the database server on the named 16 | .I host. 17 | The default is "localhost". 18 | .TP 19 | .I --dbname=name 20 | Requests a connection to the database called 21 | .I name. 22 | The default is "opendkim". 23 | .TP 24 | .I --dbpasswd=password 25 | Attempts to authenticate to the database server using the specified 26 | .I password. 27 | The default is "opendkim". 28 | .TP 29 | .I --dbport=port 30 | Tries to connect to the database at the specified TCP 31 | .I port. 32 | The default is 3306. 33 | .TP 34 | .I --dbuser=user 35 | Attempts to authenticate to the database server as the specified 36 | .I user. 37 | The default is "opendkim". 38 | .TP 39 | .I --expire=days 40 | Indicates the number of days of data to keep. The default is 180. 41 | .TP 42 | .I --help 43 | Prints a usage message and exits. 44 | .TP 45 | .I --verbose 46 | Requests verbose output. 47 | .TP 48 | .I --version 49 | Prints version number and exits. 50 | .SH VERSION 51 | This man page covers the version of 52 | .I opendkim-expire 53 | that shipped with version @VERSION@ of 54 | .I OpenDKIM. 55 | .SH COPYRIGHT 56 | Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 57 | .SH SEE ALSO 58 | .I opendkim(8), 59 | .I opendkim-importstats(8) 60 | .P 61 | RFC6376 - DomainKeys Identified Mail 62 | -------------------------------------------------------------------------------- /stats/opendkim-gengraphs.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-gengraphs 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-gengraphs 4 | \- OpenDKIM statistics graph generation tool 5 | .SH SYNOPSIS 6 | .B opendkim-gengraphs 7 | [options] 8 | .SH DESCRIPTION 9 | .B opendkim-gengraphs collates data accumulated by the OpenDKIM statistics 10 | feature into an HTML report including graphs about the daily behaviour of 11 | specific domains of interest. 12 | 13 | Requires access to 14 | .B gnuplot(1). 15 | .SH OPTIONS 16 | .TP 17 | .I --dbhost=host 18 | Attempts to connect to the database server on the named 19 | .I host. 20 | The default is "localhost". 21 | .TP 22 | .I --dbname=name 23 | Requests a connection to the database called 24 | .I name. 25 | The default is "opendkim". 26 | .TP 27 | .I --dbpasswd=password 28 | Attempts to authenticate to the database server using the specified 29 | .I password. 30 | The default is "opendkim". 31 | .TP 32 | .I --dbport=port 33 | Tries to connect to the database at the specified TCP 34 | .I port. 35 | The default is 3306. 36 | .TP 37 | .I --dbuser=user 38 | Attempts to authenticate to the database server as the specified 39 | .I user. 40 | The default is "opendkim". 41 | .TP 42 | .I --domain={ domain | file } 43 | Adds the named 44 | .I domain, 45 | or domains extracted from the named 46 | .I file, 47 | to the set of domains for which a graph should be generated. Strings that 48 | start with "/" or "./" are assumed to be files from which domain naems 49 | should be read. 50 | .TP 51 | .I --help 52 | Prints a usage message and exits. 53 | .TP 54 | .I --nocircles 55 | Prevents the script from requesting circles in graphs to show point magnitude 56 | (also known as a bubble graph) for installations that have versions of 57 | .B gnuplot(1) 58 | that don't support it. 59 | .TP 60 | .I --nounsigned 61 | Suppresses generation of a graph for unsigned mail. 62 | .TP 63 | .I --output=file 64 | Writes an HTML report to the specified 65 | .I file. 66 | Graphs will be generated in the same directory. 67 | .TP 68 | .I --verbose 69 | Requests verbose output. 70 | .TP 71 | .I --version 72 | Prints version number and exits. 73 | .SH VERSION 74 | This man page covers the version of 75 | .I opendkim-gengraphs 76 | that shipped with version @VERSION@ of 77 | .I OpenDKIM. 78 | .SH COPYRIGHT 79 | Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 80 | .SH SEE ALSO 81 | .I opendkim(8), 82 | .I opendkim-importstats(8) 83 | .P 84 | RFC6376 - DomainKeys Identified Mail 85 | -------------------------------------------------------------------------------- /stats/opendkim-genstats.8.in: -------------------------------------------------------------------------------- 1 | .TH opendkim-genstats 8 "The Trusted Domain Project" 2 | .SH NAME 3 | .B opendkim-genstats 4 | \- OpenDKIM statistics report generation tool 5 | .SH SYNOPSIS 6 | .B opendkim-genstats 7 | [options] 8 | .SH DESCRIPTION 9 | .B opendkim-genstats 10 | collates data accumulated by the OpenDKIM statistics feature into an HTML 11 | report. 12 | .SH OPTIONS 13 | .TP 14 | .I --dbhost=host 15 | Attempts to connect to the database server on the named 16 | .I host. 17 | The default is "localhost". 18 | .TP 19 | .I --dbname=name 20 | Requests a connection to the database called 21 | .I name. 22 | The default is "opendkim". 23 | .TP 24 | .I --dbpasswd=password 25 | Attempts to authenticate to the database server using the specified 26 | .I password. 27 | The default is "opendkim". 28 | .TP 29 | .I --dbport=port 30 | Tries to connect to the database at the specified TCP 31 | .I port. 32 | The default is 3306. 33 | .TP 34 | .I --dbuser=user 35 | Attempts to authenticate to the database server as the specified 36 | .I user. 37 | The default is "opendkim". 38 | .TP 39 | .I --help 40 | Prints a usage message and exits. 41 | .TP 42 | .I --output=file 43 | Writes an HTML report to the specified 44 | .I file. 45 | .TP 46 | .I --verbose 47 | Requests verbose output. 48 | .TP 49 | .I --version 50 | Prints version number and exits. 51 | .SH VERSION 52 | This man page covers the version of 53 | .I opendkim-genstats 54 | that shipped with version @VERSION@ of 55 | .I OpenDKIM. 56 | .SH COPYRIGHT 57 | Copyright (c) 2011, 2012, The Trusted Domain Project. All rights reserved. 58 | .SH SEE ALSO 59 | .I opendkim(8), 60 | .I opendkim-importstats(8) 61 | .P 62 | RFC6376 - DomainKeys Identified Mail 63 | --------------------------------------------------------------------------------