Coder Social home page Coder Social logo

Comments (3)

rayfordshire avatar rayfordshire commented on June 2, 2024 1

You are close. I think the missing piece is the line ending: It's CRLF (\r\n) for a mail. I guess you are on Linux where the files are stored with a LF (\n) line ending. If you change the line ending it should work(tm) at least I could verify your example message successfully.

Here is a sed(1) command, but unix2dos(1), awk(1), perl(1) or similar should work, too:

gpg --verify msg.asc <(sed 's/$/\r/' msg)

Another note (for future self):
From the MIME part everything including the headers but excluding the last empty line and the MIME delimiters must be included in the message file msg. A potential Content-Transfer-Encoding (e.g. quoted-printable) must not be stripped/decoded.

(Strange Oddity: One of my test mails was verified successfully with both CRLF and LF as line ending of msg. I have no clue how this can happen ... maybe sometimes(?) GnuPG applies some line ending transformation???)

For completeness, here is the output of xxd(1) of msg

$ xxd msg
00000000: 436f 6e74 656e 742d 5479 7065 3a20 7465  Content-Type: te
00000010: 7874 2f70 6c61 696e 3b20 7072 6f74 6563  xt/plain; protec
00000020: 7465 642d 6865 6164 6572 733d 7631 3b20  ted-headers=v1;
00000030: 6368 6172 7365 743d 7574 662d 380d 0a43  charset=utf-8..C
00000040: 6f6e 7465 6e74 2d44 6973 706f 7369 7469  ontent-Dispositi
00000050: 6f6e 3a20 696e 6c69 6e65 0d0a 4461 7465  on: inline..Date
00000060: 3a20 4d6f 6e2c 2031 2041 7072 2032 3032  : Mon, 1 Apr 202
00000070: 3420 3231 3a34 303a 3034 202b 3032 3030  4 21:40:04 +0200
00000080: 0d0a 4672 6f6d 3a20 416c 656a 616e 6472  ..From: Alejandr
00000090: 6f20 436f 6c6f 6d61 7220 3c61 6c78 4061  o Colomar <alx@a
000000a0: 6c65 6a61 6e64 726f 2d63 6f6c 6f6d 6172  lejandro-colomar
000000b0: 2e65 733e 0d0a 546f 3a20 7370 616d 4061  .es>..To: spam@a
000000c0: 6c65 6a61 6e64 726f 2d63 6f6c 6f6d 6172  lejandro-colomar
000000d0: 2e65 730d 0a53 7562 6a65 6374 3a20 4166  .es..Subject: Af
000000e0: 7465 720d 0a0d 0a53 7570 706f 7365 646c  ter....Supposedl
000000f0: 792c 206d 6967 6164 7520 6973 2066 6978  y, migadu is fix
00000100: 6564 206e 6f77 2e20 204c 6574 2773 2073  ed now.  Let's s
00000110: 6565 0d0a                                ee..

from neomutt.

alejandro-colomar avatar alejandro-colomar commented on June 2, 2024

Thanks! It works as you say.

$ gpg --verify msg.asc <(sed 's/$/\r/' msg)
gpg: Signature made Mon Apr  1 21:40:04 2024 CEST
gpg:                using RSA key EA3A87F0A4EBA030E45DF2409E8C1AFBBEFFDB32
gpg: Good signature from "Alejandro Colomar <[email protected]>" [ultimate]
gpg:                 aka "Alejandro Colomar <[email protected]>" [ultimate]
gpg:                 aka "Alejandro Colomar Andres <[email protected]>" [ultimate]

Re: Strange Oddity: Hmmm, weird. If you can reproduce the test, it would be interesting to see it. Maybe gpg(1) has a bug...

from neomutt.

alejandro-colomar avatar alejandro-colomar commented on June 2, 2024

Closing as resolved; but it would be interesting to continue with the strange oddity.

from neomutt.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.