Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are attachment Content IDs modified by Neomutt or Gmail #4375

Open
hsanson opened this issue Aug 31, 2024 · 0 comments
Open

Are attachment Content IDs modified by Neomutt or Gmail #4375

hsanson opened this issue Aug 31, 2024 · 0 comments
Labels

Comments

@hsanson
Copy link

hsanson commented Aug 31, 2024

I am trying to configure Neomutt to send multipart emails based on the following post:

Additional info here:

So far it works perfectly except when adding some images with multipart/related that show as broken links in Gmail. I have checked and re-checked that the generated HTML has the correct CID references and that the macros call the proper <edit-content-id>xxxxxxxx command but for some reason when receiving the email (via Gmail) the attachment Content-ID differs from the one set by the macro script.

Here is the raw message shown in Gmail:

From: me1 <[email protected]>
MIME-Version: 1.0
Date: Fri, 30 Aug 2024 08:11:37 -0700
Message-ID: <CABgtsQ3-noAhrLwDj717wU2=7jBrvRCaG [email protected]>
Subject: Markdown Test 17
To: me2 <[email protected]>
Content-Type: multipart/mixed; boundary="00000000000007bc8c0620e802a3"

--00000000000007bc8c0620e802a3
Content-Type: multipart/related; boundary="00000000000007bc8b0620e802a2"

--00000000000007bc8b0620e802a2
Content-Type: multipart/alternative; boundary="00000000000007bc8a0620e802a1"

--00000000000007bc8a0620e802a1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello,

This is markdown formatted email with a link <https://www.kde.com> and an
item list:

   - Item 1
   - Item 2
   - Item 3

And some linked images:
[image: Image] Image

And embedded image:
[image: Nak4] Nak4

=E2=80=93 regards, Me1

--00000000000007bc8a0620e802a1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


<html lang=3D"">
<head>
  <meta charset=3D"utf-8">
  <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D=
1.0, user-scalable=3Dyes">
  <style>
    html {
      line-height: 1.5;
      font-family: Georgia, serif;
      font-size: 20px;
      color: #1a1a1a;
      background-color: #fdfdfd;
    }
    body {
      margin: 0 auto;
      max-width: 36em;
      padding-left: 50px;
      padding-right: 50px;
      padding-top: 50px;
      padding-bottom: 50px;
      hyphens: auto;
      overflow-wrap: break-word;
      text-rendering: optimizeLegibility;
      font-kerning: normal;
    }
    @media (max-width: 600px) {
      body {
        font-size: 0.9em;
        padding: 1em;
      }
      h1 {
        font-size: 1.8em;
      }
    }
    @media print {
      body {
        background-color: transparent;
        color: black;
        font-size: 12pt;
      }
      p, h2, h3 {
        orphans: 3;
        widows: 3;
      }
      h2, h3, h4 {
        page-break-after: avoid;
      }
    }
    p {
      margin: 1em 0;
    }
    a {
      color: #1a1a1a;
    }
    a:visited {
      color: #1a1a1a;
    }
    img {
      max-width: 100%;
    }
    h1, h2, h3, h4, h5, h6 {
      margin-top: 1.4em;
    }
    h5, h6 {
      font-size: 1em;
      font-style: italic;
    }
    h6 {
      font-weight: normal;
    }
    ol, ul {
      padding-left: 1.7em;
      margin-top: 1em;
    }
    li > ol, li > ul {
      margin-top: 0;
    }
    blockquote {
      margin: 1em 0 1em 1.7em;
      padding-left: 1em;
      border-left: 2px solid #e6e6e6;
      color: #606060;
    }
    code {
      font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
      font-size: 85%;
      margin: 0;
    }
    pre {
      margin: 1em 0;
      overflow: auto;
    }
    pre code {
      padding: 0;
      overflow: visible;
      overflow-wrap: normal;
    }
    .sourceCode {
     background-color: transparent;
     overflow: visible;
    }
    hr {
      background-color: #1a1a1a;
      border: none;
      height: 1px;
      margin: 1em 0;
    }
    table {
      margin: 1em 0;
      border-collapse: collapse;
      width: 100%;
      overflow-x: auto;
      display: block;
      font-variant-numeric: lining-nums tabular-nums;
    }
    table caption {
      margin-bottom: 0.75em;
    }
    tbody {
      margin-top: 0.5em;
      border-top: 1px solid #1a1a1a;
      border-bottom: 1px solid #1a1a1a;
    }
    th {
      border-top: 1px solid #1a1a1a;
      padding: 0.25em 0.5em 0.25em 0.5em;
    }
    td {
      padding: 0.125em 0.5em 0.25em 0.5em;
    }
    header {
      margin-bottom: 4em;
      text-align: center;
    }
    #TOC li {
      list-style: none;
    }
    #TOC ul {
      padding-left: 1.3em;
    }
    #TOC > ul {
      padding-left: 0;
    }
    #TOC a:not(:hover) {
      text-decoration: none;
    }
    code{white-space: pre-wrap;}
    span.smallcaps{font-variant: small-caps;}
    span.underline{text-decoration: underline;}
    div.column{display: inline-block; vertical-align: top; width: 50%;}
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    ul.task-list{list-style: none;}
    .display.math{display: block; text-align: center; margin: 0.5rem auto;}
  </style>
 =20
</head>
<body>
  <p>Hello,</p>
  <p>This is markdown formatted email with a <a href=3D"https://www.kde.com=
">link</a> and an item list:</p>
  <ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
  </ul>
  <p>And some linked images:</p>
  <figure>
  <img src=3D"https://mdg.imgix.net/assets/images/tux.png?auto=3Dformat&amp=
;fit=3Dclip&amp;q=3D40&amp;w=3D100" alt=3D"Image">
  <figcaption aria-hidden=3D"true">Image</figcaption>
  </figure>
  <p>And embedded image:</p>
  <figure>
  <img src=3D"cid:f70105abb32afea88ffd8c869b047959" alt=3D"Nak4">                 <<---- CID Reference
  <figcaption aria-hidden=3D"true">Nak4</figcaption>
  </figure>
  <p>=E2=80=93 regards, Me1</p>
  </body>
</html>

--00000000000007bc8a0620e802a1--
--00000000000007bc8b0620e802a2
Content-Type: image/gif; name="nak3.gif"
Content-Disposition: inline; filename="nak3.gif"
Content-Transfer-Encoding: base64
Content-ID: <6nzo5uk7og46lsekf70105abb32afea88ffd8c869b047959>                 <<-----  Attachment Conent-ID
X-Attachment-Id: 1e85f7d55a10eaaf_0.0.1


--00000000000007bc8b0620e802a2--
--00000000000007bc8c0620e802a3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Disposition: attachment; filename="signature.asc"
Content-Transfer-Encoding: base64
X-Attachment-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PVExhQ1pkUVowaWcyc1ZZOUROeEVnQVJEbjg2WVpiNE54NzA9
Cj1FbW9LCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo=
--00000000000007bc8c0620e802a3--

You can see the HTML has the CID reference "cid:f70105abb32afea88ffd8c869b047959" but the attachment has Content-ID: <6nzo5uk7og46lsekf70105abb32afea88ffd8c869b047959>. On closer inspection we can see the Content-ID is the same CID in the HTML but with some extra thing added to it: 6nzo5uk7og46lsekf 70105abb32afea88ffd8c869b047959.

The questions is if Neomutt is the one adding the extra 6nzo5uk7og46lsekf string to the Content-ID? is it Gmail? and in either case how can I avoid it so the reference in the attachment and in the HTML match properly?

Additional notes:

Neomutt:

NeoMutt 20240425-108-990b3d
Copyright (C) 2015-2024 Richard Russon and friends
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 6.1.0-23-amd64 (x86_64)
ncurses: ncurses 6.4.20221231 (compiled with 6.4.20221231)
libidn2: 2.3.3 (compiled with 2.3.3)
GPGME: 1.18.0
OpenSSL: OpenSSL 3.0.13 30 Jan 2024
libnotmuch: 5.6.0
storage: lmdb
compression: zstd

I use lieer to send messages from one Gmail account to another.

I am receiving and looking at the email on Gmail and it shows the images as broken links.

@hsanson hsanson added the type:question Question label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant