commit fe371fc9cc4ef64169b33e6a02b6b37a26bbc86d from: Martijn van Duren date: Thu Sep 5 13:03:09 2019 UTC Rename to filter-dkimsign commit - 6dd298d155641a9ec3379a8eeace13ef6e24d149 commit + fe371fc9cc4ef64169b33e6a02b6b37a26bbc86d blob - 351d3a8bad629f0d2f585ae542b2c396d7abf7c9 blob + 48f333aa54bb04f3f59bb8e51387c1fe971be3a0 --- Makefile +++ Makefile @@ -1,5 +1,5 @@ -PROG= filter-dkim -MAN= filter-dkim.8 +PROG= filter-dkimsign +MAN= filter-dkimsign.8 BINDIR= ${LOCALBASE}/libexec/smtpd/ MANDIR= ${LOCALBASE}/man/man blob - 182d56b62d3c619f22ddd56554f3d1792d5f0406 (mode 644) blob + /dev/null --- filter-dkim.8 +++ /dev/null @@ -1,78 +0,0 @@ -.\" $OpenBSD$ -.\" -.\" Copyright (c) 2019 Martijn van Duren -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.Dd $Mdocdate$ -.Dt FILTER-DKIM 8 -.Os -.Sh NAME -.Nm filter-dkim -.Nd add dkim signature to messages -.Sh SYNOPSIS -.Nm -.Op Fl tz -.Op Fl a Ar algorithm -.Op Fl c Ar canonicalization -.Op Fl h Ar headers -.Op Fl x Ar seconds -.Fl d Ar domain -.Fl k Ar file -.Fl s Ar selector -.Sh DESCRIPTION -.Nm -adds a dkim signature to the message. -The following flags are supported: -.Bl -tag -width Ds -.It Fl a Ar algorithm -The algorithm to use. -This implementation only supports rsa cryptography. -Only sha256 should be used for hashing, since other algorithms are most likely -not supported by verifiers. -Defaults to -.Ar rsa-sha256 . -.It Fl c Ar canonicalization -The canonicalization algorithm used to sign the messge. -Defaults to -.Ar simple/simple . -.It Fl d Ar domain -The domain where the public key can be found. -.It Fl h Ar headers -The email headers which are included in the mail signature. -Per RFC this option requires at least the from header to be included. -The headers are specified by separating them with a colon. -The default is -from:reply-to:subject:date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to:references:list-id:list-help:list-unsubscribe:list-subscribe:list-post:list-owner:list-archive . -.It Fl k Ar file -.Ar file -should point to a file containing the RSA private key to sign the messages. -.It Fl s Ar selector -The selector within the _domainkey subdomain of -.Ar domain -where the public key can be found. -.It Fl t -Add the time of signing to the dkim header. -.It Fl x Ar seconds -Add the amount of -.Ar seconds -the signature is valid to the dkim header. -.It Fl z -Add the mail headers used in the dkim signature to the dkim header. -If a second -.Fl z -is specified all headers will be included in the dkim header. -Useful for debugging purposes. -.El -.Sh SEE ALSO -.Xr smtpd 8 blob - /dev/null blob + c1fd990650431bd9f6ff9d6e22c3b0722455f84e (mode 644) --- /dev/null +++ filter-dkimsign.8 @@ -0,0 +1,78 @@ +.\" $OpenBSD$ +.\" +.\" Copyright (c) 2019 Martijn van Duren +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate$ +.Dt FILTER-DKIMSIGN 8 +.Os +.Sh NAME +.Nm filter-dkimsign +.Nd add dkim signature to messages +.Sh SYNOPSIS +.Nm +.Op Fl tz +.Op Fl a Ar algorithm +.Op Fl c Ar canonicalization +.Op Fl h Ar headers +.Op Fl x Ar seconds +.Fl d Ar domain +.Fl k Ar file +.Fl s Ar selector +.Sh DESCRIPTION +.Nm +adds a dkim signature to the message. +The following flags are supported: +.Bl -tag -width Ds +.It Fl a Ar algorithm +The algorithm to use. +This implementation only supports rsa cryptography. +Only sha256 should be used for hashing, since other algorithms are most likely +not supported by verifiers. +Defaults to +.Ar rsa-sha256 . +.It Fl c Ar canonicalization +The canonicalization algorithm used to sign the messge. +Defaults to +.Ar simple/simple . +.It Fl d Ar domain +The domain where the public key can be found. +.It Fl h Ar headers +The email headers which are included in the mail signature. +Per RFC this option requires at least the from header to be included. +The headers are specified by separating them with a colon. +The default is +from:reply-to:subject:date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to:references:list-id:list-help:list-unsubscribe:list-subscribe:list-post:list-owner:list-archive . +.It Fl k Ar file +.Ar file +should point to a file containing the RSA private key to sign the messages. +.It Fl s Ar selector +The selector within the _domainkey subdomain of +.Ar domain +where the public key can be found. +.It Fl t +Add the time of signing to the dkim header. +.It Fl x Ar seconds +Add the amount of +.Ar seconds +the signature is valid to the dkim header. +.It Fl z +Add the mail headers used in the dkim signature to the dkim header. +If a second +.Fl z +is specified all headers will be included in the dkim header. +Useful for debugging purposes. +.El +.Sh SEE ALSO +.Xr smtpd 8 blob - 5a258366c31fcf1c07bdb19fc046fa0d549a4eea blob + 0ee853af531167044f8e3c0c723db75fafa4ea51 --- main.c +++ main.c @@ -796,8 +796,8 @@ dkim_signature_need(struct dkim_message *message, size __dead void usage(void) { - fprintf(stderr, "usage: filter-dkim [-tz] [-a signalg] " - "[-c canonicalization] [-h headerfields]\n " + fprintf(stderr, "usage: filter-dkimsign [-tz] [-a signalg] " + "[-c canonicalization] \n [-h headerfields]" "[-x seconds] -d domain -k keyfile -s selector\n"); exit(1); }