Re: [Dbmail] dbmail breaks PGP/MIME mails
Casper Langemeijer <[email protected]> Mon, 23 Apr 2018 11:05:53 +0200
| Newsgroups | gmane.mail.imap.dbmail.devel,gmane.mail.imap.dbmail |
|---|---|
| Message-ID | <[email protected]> |
--===============1419663669== Content-Type: multipart/alternative; boundary=5adda1f1_17769aef_e90 --5adda1f1_17769aef_e90 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline I've started working on porting dbmail to gmime3. My work is public, but not finished. https://github.com/langemeijer/dbmail/tree/upgrade-to-gmime3 (https://link.getmailspring.com/link/1524473037.local-204e8f4e-7406-v1.2.1-7e7447b6-E3tajizDSjuh9fD6BarwBgC/[email protected]/0?redirect=https%3A%2F%2Fgithub.com%2Flangemeijer%2Fdbmail%2Ftree%2Fupgrade-to-gmime3&recipient=ZGJtYWlsLWRldkBkYm1haWwub3Jn) I am not a C developer by profession, and I lack experience. Most of the work I do on dbmail will be trivial coding though. There are some changes that require a little more work on dbmail source code, but I think it's not to big for me to handle. I would very much appreciate it if someone could review my work when it's done. Meeting face-to-face would have my preference over working online. On Apr 21 2018, at 12:44 pm, Reindl Harald <[email protected]> wrote: > > well, and here we are back at the bad or non existing maintainance state > of dbmail: configure: error: Unable to locate gmime development files > > [builduser@testserver:~]$ rpm -qa | grep gmime > gmime-devel-3.0.5-1.fc27.20180421.rh.x86_64 > gmime-3.0.5-1.fc27.20180421.rh.x86_64 > > Am 21.04.2018 um 12:35 schrieb Reindl Harald: > > the header mangeling is gmime > > https://bugzilla.gnome.org/show_bug.cgi?id=776825 > > ftp://ftp.gnome.org/pub/GNOME/sources/gmime/3.0/ > > > > DKIM verifyication/scoring normally happens before dbmail-lmtpd and > > forwardings should also not touch the spilt/reconstruct code > > > > as far as i can see the GPG breakage happens around the "signature.asc" > > with different types of new-lines and headers are typicall not part of > > the gpg-signature > > > > aynways, any difference between the inbound message and what you get > > back from dbmail is harmful except the headers aded by lmtpd itself on > > top (which was also wrong, Return-Path before the patch i requested > > where on bottom while every hop touching a mail is supposed to add his > > headers on top and don't touch any present headers) > > > > Am 21.04.2018 um 11:01 schrieb Casper Langemeijer: > > > I fired up my facebook account, and added a few email addresses to send > > > mails to my accounts. I found that mails sent to my gmail account > > > directly differ from the mails I receive with my dbmail server in one > > > important way: The 'Content-Type; header has a different format. > > > > > > Sent (and received with gmail): > > > Content-Type: multipart/alternative; > > > boundary="b1_67a90b8ff6c9e9d71d8464cdb1c370fc" > > > > > > As received with a mail client through dbmail: > > > Content-Type: multipart/alternative; > > > boundary=b1_a639100bff13cf3e25a329d562f419ee > > > > > > The difference: It's originally sent as single-line header, but dbmail > > > touches it and reformats it. Removing the quotes and making it a > > > multi-line header. > > > > > > For DKIM I know this is a problem. Facebook (and most other senders) > > > sends DKIM signatures with the h parameter set to > > > 'Date:To:Subject:From:MIME-Version:Content-Type'. This means that the > > > signature is calculated on the body and these headers. Therefore any > > > modifications to these headers are an alteration of the message and > > > cause DKIM to fail. > > > > > > I can imagine this could possibly break PGP/MIME, if it checks the > > > integrity in a similar way. > > > > > > > > > On Fri, Apr 20, 2018 at 6:14 PM Casper Langemeijer > > > <[email protected] <mailto:[email protected]>> wrote: > > > > > > I'm not sure this is related, and I probably should investigate > > > further before posting this here, but in my setup, dbmail seems to > > > break DKIM signatures. > > > > > > I've seen that mails from booking.com <http://booking.com> and > > > facebook.com <http://facebook.com> have broken DKIM signatures > > > according to google's gmail, when forwarded by my mailserver. This > > > happens both for mail I forward to a gmail mail address, and email > > > that POPped by gmail. (Where forwarded mail doesn't get delivered > > > because of DMARC policies) > > > > > > As I stated, I haven't really investigated, but this could be caused > > > by dbmail doing any kind of 'normalization' on mail message headers. > > > > > > Does anyone here know if there an easy way to log raw incoming email > > > messages for a specific user or from a specific domain? I use a > > > fairly standard postfix/dbmail setup. Ideally I get to 'record' a > > > DKIM-correct message, that can be fed into dbmail-lmtp for testing > > > > _______________________________________________ > DBmail mailing list > [email protected] > http://lists.nfg.nl/mailman/listinfo/dbmail > --5adda1f1_17769aef_e90 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <div>I've started working on porting dbmail to gmime3. My work is public,= but not finished.</div><div><div><a href=3D=22https://link.getmailspring= .com/link/1524473037.local-204e8f4e-7406-v1.2.1-7e7447b6=40getmailspring.= com/0=3Fredirect=3Dhttps%3A%2=46%2=46github.com%2=46langemeijer%2=46dbmai= l%2=46tree%2=46upgrade-to-gmime3&recipient=3DZGJtYWlsLWRldkBkYm1haWwu= b3Jn=22 title=3D=22https://github.com/langemeijer/dbmail/tree/upgrade-to-= gmime3=22>https://github.com/langemeijer/dbmail/tree/upgrade-to-gmime3</a= ></div></div><div>I am not a C developer by profession, and I lack experi= ence. Most of the work I do on dbmail will be trivial coding though. Ther= e are some changes that require a little more work on dbmail source code,= but I think it's not to big for me to handle.</div><br><div>I would very= much appreciate it if someone could review my work when it's done. Meeti= ng face-to-face would have my preference over working online. </div><br><= div class=3D=22gmail=5Fquote=5Fattribution=22>On Apr 21 2018, at 12:44 pm= , Reindl Harald <h.reindl=40thelounge.net> wrote:</div><blockquote>= <br><div><div>well, and here we are back at the bad or non existing maint= ainance state</div><div>of dbmail: configure: error: Unable to locate gmi= me development files</div><br><div>=5Bbuilduser=40testserver:=7E=5D=24 rp= m -qa =7C grep gmime</div><div>gmime-devel-3.0.5-1.fc27.20180421.rh.x86=5F= 64</div><div>gmime-3.0.5-1.fc27.20180421.rh.x86=5F64</div><br><div>Am 21.= 04.2018 um 12:35 schrieb Reindl Harald:</div><blockquote><div>the header = mangeling is gmime</div><div>https://bugzilla.gnome.org/show=5Fbug.cgi=3F= id=3D776825</div><div>ftp://ftp.gnome.org/pub/GNOME/sources/gmime/3.0/</d= iv><br><div>DKIM verifyication/scoring normally happens before dbmail-lmt= pd and</div><div>forwardings should also not touch the spilt/reconstruct = code</div><br><div>as far as i can see the GPG breakage happens around th= e =22signature.asc=22</div><div>with different types of new-lines and hea= ders are typicall not part of</div><div>the gpg-signature</div><br><div>a= ynways, any difference between the inbound message and what you get</div>= <div>back from dbmail is harmful except the headers aded by lmtpd itself = on</div><div>top (which was also wrong, Return-Path before the patch i re= quested</div><div>where on bottom while every hop touching a mail is supp= osed to add his</div><div>headers on top and don't touch any present head= ers)</div><br><div>Am 21.04.2018 um 11:01 schrieb Casper Langemeijer:</di= v><blockquote><div>I fired up my facebook account, and added a few email = addresses to send</div><div>mails to my accounts. I found that mails sent= to my gmail account</div><div>directly differ from the mails I receive w= ith my dbmail server in one</div><div>important way: The 'Content-Type; h= eader has a different format.</div><br><div>Sent (and received with gmail= ):</div><div>Content-Type: multipart/alternative;</div><div>boundary=3D=22= b1=5F67a90b8ff6c9e9d71d8464cdb1c370fc=22</div><br><div>As received with a= mail client through dbmail:</div><div>Content-Type: multipart/alternativ= e;</div><div>boundary=3Db1=5Fa639100bff13cf3e25a329d562f419ee</div><br><d= iv>The difference: It's originally sent as single-line header, but dbmail= </div><div>touches it and reformats it. Removing the quotes and making it= a</div><div>multi-line header.</div><br><div>=46or DKIM I know this is a= problem. =46acebook (and most other senders)</div><div>sends DKIM signat= ures with the h parameter set to</div><div>'Date:To:Subject:=46rom:MIME-V= ersion:Content-Type'. This means that the</div><div>signature is calculat= ed on the body and these headers. Therefore any</div><div>modifications t= o these headers are an alteration of the message and</div><div>cause DKIM= to fail.</div><br><div>I can imagine this could possibly break PGP/MIME,= if it checks the</div><div>integrity in a similar way.</div><br><br><div= >On =46ri, Apr 20, 2018 at 6:14 PM Casper Langemeijer</div><div><caspe= r=40langemeijer.eu <mailto:casper=40langemeijer.eu>> wrote:</div= ><br><div>I'm not sure this is related, and I probably should investigate= </div><div>further before posting this here, but in my setup, dbmail seem= s to</div><div>break DKIM signatures.</div><br><div>I've seen that mails = from booking.com <http://booking.com> and</div><div>facebook.com &l= t;http://facebook.com> have broken DKIM signatures</div><div>according= to google's gmail, when forwarded by my mailserver. This</div><div>happe= ns both for mail I forward to a gmail mail address, and email</div><div>t= hat POPped by gmail. (Where forwarded mail doesn't get delivered</div><di= v>because of DMARC policies)</div><br><div>As I stated, I haven't really = investigated, but this could be caused</div><div>by dbmail doing any kind= of 'normalization' on mail message headers.</div><br><div>Does anyone he= re know if there an easy way to log raw incoming email</div><div>messages= for a specific user or from a specific domain=3F I use a</div><div>fairl= y standard postfix/dbmail setup. Ideally I get to 'record' a</div><div>DK= IM-correct message, that can be fed into dbmail-lmtp for testing</div></b= lockquote></blockquote><div>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F</div><div>DBmail mailing list</div><div>DBmail=40db= mail.org</div><div>http://lists.nfg.nl/mailman/listinfo/dbmail</div></div= ></blockquote> --5adda1f1_17769aef_e90-- --===============1419663669== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Dbmail-dev mailing list [email protected] http://lists.nfg.nl/mailman/listinfo/dbmail-dev --===============1419663669==--