Opendkim - Postfix : mails signés deux fois par opendkim

Bonjour,

Cela fait plusieurs jours que je me prends la tête avec les signatures opendkim.
Tous mes mails sont signés 2 fois par opendkim. J’ai suivi tous les tutos que j’ai trouvé et bien que tous préconisent de faire la même chose… je ne comprends pas pourquoi mon serveur signe les mails 2 fois.

voici un exemple de source d’un mail que je me suis envoyé

Delivered-To: ******.******@gmail.com
Received: by 10.80.140.100 with SMTP id p91csp3169595edp;
Thu, 6 Oct 2016 06:13:34 -0700 (PDT)
X-Received: by 10.28.66.1 with SMTP id p1mr13458058wma.53.1475759614520;
Thu, 06 Oct 2016 06:13:34 -0700 (PDT)
Return-Path: <******.******@######.fr>
Received: from mail.######.fr (5-49-55-40.hfc.dyn.abo.bbox.fr. [5.49.55.40])
by mx.google.com with ESMTP id hu9si16932820wjb.5.2016.10.06.06.13.34
for ******.******@gmail.com;
Thu, 06 Oct 2016 06:13:34 -0700 (PDT)
Received-SPF: pass (google.com: domain of ******.******@######.fr designates 5.49.55.40 as permitted sender) client-ip=5.49.55.40;
Authentication-Results: mx.google.com;
dkim=neutral (invalid public key) header.i=@######.fr;
dkim=neutral (invalid public key) header.i=@######.fr;
spf=pass (google.com: domain of ******.******@######.fr designates 5.49.55.40 as permitted sender) smtp.mailfrom=******.******@######.fr;
dmarc=pass (p=NONE dis=NONE) header.from=######.fr
Received: from localhost (localhost.localdomain [127.0.0.1])
by mail.######.fr (Postfix) with ESMTP id 6DDB0221400
for ******.******@gmail.com; Thu, 6 Oct 2016 15:13:12 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.9.2 mail.######.fr 6DDB0221400
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=######.fr; s=mail;
t=1475759592; bh=875q4ditf6tDMynKibB4PKZ/YyQHF1GwPdzNBKCp5sA=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=Z+lfS+cxRpSAW1hd+E0lvrXsU7LhxznCvPgSJiJ3+UYfsy3q+yEP+6AasZ8LeClS+
lwUCo3RZygl7m9DB3VMBDSk3liudI9yDsUy67GKcIU3186PWxbe6F/EXVYHQONRY0y
rQybKbjd1gRNGww13905qOBO2sSGvGsyLGmrh57g=
X-Virus-Scanned: Debian amavisd-new at ######.fr
Received: from mail.######.fr ([127.0.0.1])
by localhost (serveur.######.fr [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 91KLCXZTS72Z for ******.******@gmail.com;
Thu, 6 Oct 2016 15:13:08 +0200 (CEST)
Received: from [127.0.0.1] (bbox.lan [192.168.1.254])
by mail.######.fr (Postfix) with ESMTPSA id A25B62213FE
for ******.******@gmail.com; Thu, 6 Oct 2016 15:13:08 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.9.2 mail.######.fr A25B62213FE
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=######.fr; s=mail;
t=1475759588; bh=875q4ditf6tDMynKibB4PKZ/YyQHF1GwPdzNBKCp5sA=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=ezv1U8DI4eC7TKFgpArf7N10CY3JGcRpvYlrVFOvrhsdu7N3LkWPEhfAEGC+atOIk
DicKAsA0AxrsyoqQ/b7MrVsJArSdOeYDAmyOo/yjnpCXBBXqzVlLq1ZT0xLKXXVo8V
167HEb+5sDgys2r+RjThMg4QuP3Heux4A33btWnU=
Subject: Re: tkehfkha
To: ******.******@gmail.com
References: <59d431c8-e306-ca6e-9b88-e97a26830199@######.fr>
<eb1bb84e-1896-08ba-8c9c-28e1af702583@######.fr>
<c4ec2b1d-4475-33e0-09e4-86aa00e4494b@######.fr>
<61d612a3-a662-cbf2-59c5-a3099b338bc6@######.fr>
<8988ac64-bb6f-8738-db40-086f121e5734@######.fr>
From: ****** <******.******@######.fr>
Message-ID: <8a2c3116-6890-f327-9f50-3880caf9d609@######.fr>
Date: Thu, 6 Oct 2016 15:13:23 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
MIME-Version: 1.0
In-Reply-To: <8988ac64-bb6f-8738-db40-086f121e5734@######.fr>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Antivirus: avast! (VPS 161006-0, 06/10/2016), Outbound message
X-Antivirus-Status: Clean
X-Antivirus: avast! (VPS 161006-0, 06/10/2016), Inbound message
X-Antivirus-Status: Clean

Le 06/10/2016 à 14:46, ****** a écrit :

Le 06/10/2016 à 14:37, ****** a écrit :

Le 06/10/2016 à 14:31, ****** a écrit :

Le 06/10/2016 à 14:30, ****** a écrit :

Le 06/10/2016 à 10:58, ****** a écrit :

lhflzùejflkhezj lfhcm zahfnmlahef ùahjfùiaenfaùjnhe mjz f

Merci de votre aide

Si vous avez besoin de voir certains de mes fichiers de config, je peux vous les mettre à dispo

Salut,
Première question toute conne mais si tu arrête ton service DKIM tu es sur que ton mail n’est plus signé ?
Passe tu par un relai pour ton courrier ?
Quel est la config que tu as mis en place pour la signature ?

si j’arrête le service opendkim, les mails ne sont plus signés, j’ai fait le test :wink:

pas de relay pour les mails

et pour la configuration de opendkim, j’ai suivi ce tuto

http://lea-linux.org/documentations/DKIM_SPF_Postfix

après relecture de cette doc

http://www.opendkim.org/opendkim-README

j’ai trouvé une solution… en suivant ca :

If you have a content filter in master.cf that feeds it back into a
different smtpd process, you should alter the second smtpd process in
master.cf to contain ‘-o receive_override_options=no_milters’ to
prevent messages being signed or verified twice. For tips on avoiding
DKIM signature breakage, see:
http://www.postfix.org/MILTER_README.html#workarounds

mais un autre problème apparait dans mon test mail-tester maintenant :

La signature DKIM de votre message est :

v=1;
a=rsa-sha256;
c=relaxed/relaxed;
d=********.fr;
s=mail;
t=1475762229;
bh=MMEOBFGbHQ4Z8CmOTnQdwZ4TbdGNRk3o6fS3buXBDN0=;
h=Subject:References:To:From:Date:In-Reply-To:From;
b=UJ49mZsnFNfk75XejYS9stsCK6JNdD4hb+feYMi2yUjpiijPJ3ir3T2R0Pyu4Vg5C9BaLKfVWFS6Z1xL432Jb17uMlO4XyYJ828BQA51ETJsdY84AdeUjF81B1fk8mgZkpZbYi7gp2UnkZ26L/5h5U47DhctNGMzB4YBHVlipd0=
Votre clé publique est :

"v=DKIM1;
k=rsa;
t=y:s;
p=MIICXAIBAAKBgQDQUsRI+jkuC6yo8+LodhaRrs9dofTY3aDd3f16LIk9m3FRE0aJu7i3gCZXdVhpwtHyUTIKnluqWGo1yY1/mZb25BPnwBGuEP9uO7QmAGyp0ez5HJn5lG9I6ll71apduRvxPFi90Cimcnyv2rCYxzJJcDlxjVhblIOqiBBfSQlcjwIDAQABAoGAdfZH+2LlOfOWY10moacshHXOKiDpOlvVGYz4WVQaqm34roYRrTBFGnNQQrnJxKlypJnhki21jjHegnKM0zIvTruXwJBpfnTNFXb1mNzMGSixq037LbTjktkxg3ICBTPPyDvEyx/rnqOP+21o4I6D76kQUz8EdYrZhNQJ8V…"
Votre signature DKIM n’est pas valide

J’ai l’impression que 3 problemes me tombent dessus quand j’en règle un… c’est vraiment fatiguant :frowning:

Content que tu ai trouvé une solution a ton problème.
Pour ton problème suivant tu ne donne pas le message d’erreur … la signature et la clé ne corresponde pas ? Si c’est le cas il faut vérifier/regénérer les différentes clés qui te servent aux signatures.

Je n’ai pas de message d’erreur.

En fait, lorsque je fais un test de mon serveur mail sur www.mail-tester.com, j’obtiens le message ci dessus.

Je viens de regénérer la clé mais j’ai l’impression que cette dernière n’est pas utilisée et qu’une autre clé est générée automatiquement par ??? postfix ? opendkim ? je ne sais pas…

Voici le détail du mail que je viens de m’envoyer :

DKIM-Filter: OpenDKIM Filter v2.9.2 mail..fr 3DA6F221400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
.fr; s=mail; t=1475772383; bh=G6wHHlD4xHWwUcRK/EWYSDoNh/cdpZ4wGU5SQZD7kN8=; h=Date:From:Subject:To; b=GBeIlt0h5t35kg3VirRC1RQIQSP7UORaJs9FMw+S4eGiXdFfOW7F8Z7StXa6i3SDa
DNqD5iyphQpkT/KCIt8pNJBxZmDWOn5/EBJHjugtgSW5UBO+w8dByp7SxmgF3cgjQm
KIdIMr6ln1NEyIAlo1QIwSNrpYxqgHmNm1KwU8yY=

c’est incomprehensible

Il faut que la clé utilisé sur ton serveur soi en accord avec celle déclaré dans ton DNS … et il se peut qu’il y ai un peu de délai de mise à jour des DNS si tu change la clée.

À chaque fois que j’ai généré une nouvelle clé, j’ai changé la zone DNS de mon domaine sur OVH.
Je verrai demain ce que ça donne :wink:

Je viens de faire quelques tests, le site de test que tu donne n’est pas parfait non plus. Par exemple il me dit que ma signature DKIM n’est pas valide et sur la ligne suivante que si … pareil avec DMARC que j’ai bien dans mon DNS mais qu’il me dit qu’il ne le trouve pas …
Bref il y a d’autre site pour tester ton serveur mail … il faut aussi aller les voir pour avoir une idée un peu plus juste je pense.

Je viens d’essayer la vérification de dkim sur un autre site après reparamétrage de opendkim et j’obtiens le meme résultat

DomainKey result: none (no signature)
If DKIM result is passed, you can ignore DomainKey result: none

================================================================
DKIM result: temperror (internal error)

Signed by: *********@########.fr
Expected Body Hash: LH2IqwEiM0pc8THGzM6IjbG6/1z6KUuefVMU9ZPVX70=

PublicKey: dkim._domainkey.########.fr
IN TXT = “v=DKIM1; k=rsa; s=email; h=sha256; p=MIICXAIBAAKBgQDA9MXwWiP3eqFUOn7zTlpJ+WiB+BJc0FxQ+9ZNS3+shXWFyNbqrRCNp4bRIEfEtD2i49DTzRgaJPHZnXz99vXBUja0wo2GWZyG/5hFHg3HJob0kbjgEOmYm6MbCOj+k/Cq0hNtNAE6FCcfKKDWv+izv+fExQYjsI84MmH0CB6M5wIDAQABAoGAJdGT3ij8tau+ZRDWAwAPaEJO/nJNvw1DmsfRV/L9QiYiQ6d6oCJthSYZoXFvP5mIHx4BtxGSsMUe9eUNM4Ws4vDKg5SjL9nwUinKyOViJiz8ZjyAl7XYenYSoCqstO0WSTo+CFVo4ta7xzwfos41FLHc5WDt5plMVp5qMmXj9jECQQDvVYGN6aTSQ440e38L0kJUUHSRGyLIBA+NYgNVG2ZV85u4PsbPyiPHrc2OUFysNtc9fDnXczpxwhRdbDpoNrGvAkEAzmSCzYHkBHbYQ/fzDLseem4UhbEWTZOOtG2msZLPMW2tQRt9SYEzmnKLEBAf4I6MJzBixc7eqJc2EptYuTq+SQJANIZwg2Omj5rR58S+sip38iciHgJ1lK4Hd8Dt+EymHfDz2PC2Ez5KsfT76uLKI+V5QX4094rLZdHxRDuPafWu8wJAVDObTZ4tWUjnCCuzA8GfOJGKW9SYZcPKV3/Ynt9nGiJFqac+YOuOEveiFkaNyr49HYvW8B5qplsyWzr3YnI9yQJBAM/uAhbdqaA2E03XERxiDIywLYVc8KYduTgeWrFFDem023Y/6+d4t60AVybSTghhfPkiNRd9fAnvvMXTOJ/n3q0=;”

—Original Message Header—
x-sender: *********@########.fr
x-receiver: AAAA4AcKCAwA@appmaildev.com
Received: from mail.########.fr ([5.49.55.40]) by mail.appmaildev.com with Microsoft SMTPSVC(7.5.7601.17514);
Sat, 8 Oct 2016 12:31:07 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
by mail.########.fr (Postfix) with ESMTP id 4ED212214EF
for AAAA4AcKCAwA@appmaildev.com; Sat, 8 Oct 2016 18:28:59 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=########.fr; s=dkim;
t=1475944139; bh=LH2IqwEiM0pc8THGzM6IjbG6/1z6KUuefVMU9ZPVX70=;
h=To:From:Subject:Date;
b=rGtYWXeo8sG1TmSA0UcToHuRbAhe4rEin0V8z8DqWPaoxKaZYhXlVeeCcj4dgQfs+
bhT7dL0pIVHRT4Quia4Es/w2wAlmagnUWFBB46uu6FG74K8OmlFGtOd84cPwyW/9J0
gw+6EVd/vD3RJ06RiEjBagvE6F54C5owu6InMLBg=
X-Virus-Scanned: Debian amavisd-new at ########.fr
Received: from mail.########.fr ([127.0.0.1])
by localhost (serveur.########.fr [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Gd2IWkGODrSG for AAAA4AcKCAwA@appmaildev.com;
Sat, 8 Oct 2016 18:28:58 +0200 (CEST)
Received: from [127.0.0.1] (bbox.lan [192.168.1.254])
by mail.########.fr (Postfix) with ESMTPSA id 97F2A2213FF
for AAAA4AcKCAwA@appmaildev.com; Sat, 8 Oct 2016 18:28:58 +0200 (CEST)
To: AAAA4AcKCAwA@appmaildev.com
From: Gadolb <*********@########.fr>
Subject: hra fa
Message-ID: <9d537c55-5775-4327-8a38-2e8e6b6c7cc2@########.fr>
Date: Sat, 8 Oct 2016 18:29:13 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Antivirus: avast! (VPS 161008-2, 08/10/2016), Outbound message
X-Antivirus-Status: Clean
Return-Path: *********@########.fr
X-OriginalArrivalTime: 08 Oct 2016 16:31:07.0875 (UTC) FILETIME=[5F319B30:01D22181]