דוגמאות לתגובות באימייל

הנה כמה דוגמאות של הודעות תגובה באימייל תקינות ולא חוקיות.

בתוקף בין השעות multipart/alternative

תגובות באימייל כוללות בדרך כלל שלושה חלקים:

  • text/plain: גרסת הטקסט הפשוט של ההודעה.
  • text/vnd.google.email-reaction+json: שלב התגובה.
  • text/html: גרסת ה-HTML של ההודעה.

לדוגמה:

From: test@google.com
Message-ID: <884457408.1.1697791227669@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/alternative;
        boundary="----=_Part_0_2012232625.1697791227635"

------=_Part_0_2012232625.1697791227635
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Text body content
------=_Part_0_2012232625.1697791227635
Content-Type: text/vnd.google.email-reaction+json; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1}
------=_Part_0_2012232625.1697791227635
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<h1>HTML body content</h1>
------=_Part_0_2012232625.1697791227635--

איבר גוף חוקי אחד

תגובות באימייל יכולות לכלול גם חלק גוף אחד, כמו:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1}

חשוב לשים לב שהקידוד של Content-Transfer-Encoding יכול להיות סטנדרטי:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64

ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==

בקידודים בינאריים, כמו base64, צריך לקודד את קובץ ה-JSON כ-UTF-8.

חוקי בתוך multipart/alternative בתוך multipart/related

אם התגובה היא להודעה שמכילה קבצים מצורפים, אפשר ליצור הודעה עם חלק גוף multipart/related שמכיל את הקבצים המצורפים וגם חלק multipart/alternative כמו בדוגמה הקודמת.

From: test@google.com
Message-ID: <913190639.2.1697793303663@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/related;
        boundary="----=_Part_0_2012232625.1697793303618"

------=_Part_0_2012232625.1697793303618
Content-Type: multipart/alternative;
        boundary="----=_Part_1_984213526.1697793303621"

------=_Part_1_984213526.1697793303621
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Text body content
------=_Part_1_984213526.1697793303621
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64

ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==
------=_Part_1_984213526.1697793303621
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<h1>HTML body content</h1>
------=_Part_1_984213526.1697793303621--

------=_Part_0_2012232625.1697793303618
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="1x1.png"

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMA
QObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=
------=_Part_0_2012232625.1697793303618--

(שימו לב שהחלק הגוף multipart/related צריך לכלול שדות אחרים שמצוינים על ידי RFC2387, אבל הם לא רלוונטיים כדי לקבוע אם תגובה באימייל היא חוקית).

פורמט JSON לא חוקי

התגובה הבאה לא חוקית כי ב-JSON חסר סוגר סוגריים מסולסלים:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1

התגובה הבאה לא חוקית כי ב-JSON יש פסיק בסוף:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1,}

השדה version לא חוקי

התגובה הבאה לא חוקית כי חסר בה השדה version:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83"}

התגובה הבאה לא תקינה כי השדה version אינו 1:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":2}

השדה emoji לא חוקי

התגובה הבאה לא חוקית כי השדה emoji ריק:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"","version":1}

התגובה הבאה לא תקינה כי השדה emoji לא מכיל אמוג'י תקין.

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"A","version":1}

התגובה הבאה לא תקינה כי האמוג'י ❤ חסר בין שני התווים של האיחוד (ZWJ) ברוחב אפס. שימו לב שהתו = בסוף שורת התוכן הראשונה מייצג מעבר שורה רך בקידוד Quoted-Printable.

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=91=A9=F0=9F=8F=BC=E2=80=8D=E2=80=8D=F0=9F=91=A8=F0=9F=8F=BE",=
"version":1}