Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 707

How to convert Postfix email log mail to proper html content to show in web view

$
0
0

Below is the Postfix log for a received email. I want to render this content in my application, but I seem unable to do so.

When I use the content with the header: Content-Type: text/plain; charset="UTF-8" it does not render a fully functional HTML page with proper styling and links.

On the other hand, if I use the content with the header: Content-Transfer-Encoding: quoted-printable, it renders with incorrect HTML tags and content, such as =>, 3D, and it also includes wrong HTML tags. I attempted to manually replace these using string manipulation, but this is not a viable solution for handling multiple types of emails.

From abcAbc@gmail.com  Fri Oct 11 18:53:02 2024Return-Path: <abcAbc@gmail.com>X-Original-To: w123@cosyhome.cloudDelivered-To: root@cosyhome.cloudReceived: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47])        by cosyhome.cloud (Postfix) with ESMTPS id 7A1A440011        for <w123@cosyhome.cloud>; Fri, 11 Oct 2024 18:53:02 +0000 (UTC)Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a99c0c203f0so116440266b.2        for <w123@cosyhome.cloud>; Fri, 11 Oct 2024 11:53:02 -0700 (PDT)DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20230601; t=1728672779; x=1729277579; darn=cosyhome.cloud;        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject         :date:message-id:reply-to;        bh=oQaO5RO6Ym5PMYtEFtzdpKgrGUmnUwSkiyXGFtVu/Xg=;        b=QfDMySSFVtZOw7R/vSSXWx/jt/g1j1+n4tDDdsRLIbhLX8/9nd2L4i3axXgj8Wp8Gy         gZsPfwkh7wThYT2JZawU9WB7VLficDNgJvc1tfihVYrsLKMydA8gblm5cp+dJ3FWaGiQ         04wbvHG+y6nofBVLEnkLM1u12zFiaMLyorwxb5Cj+wUXra/kbEAh7DhDwKlUqppoVHHV         uRqW8IS3FzelDLdXbrk8TqlmveTW1/uohMrhBhFv/VtAEcMXLXw3CEIY1n8jhIbOGYJv         Rny/dp6+oaUGOI7kfe3+Fiy0lh6VnXhAK4FxKbns9ctIe6kCdFIeG/PduRycawyNo15H         lD4A==X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20230601; t=1728672779; x=1729277579;        h=to:subject:message-id:date:from:mime-version:x-gm-message-state         :from:to:cc:subject:date:message-id:reply-to;        bh=oQaO5RO6Ym5PMYtEFtzdpKgrGUmnUwSkiyXGFtVu/Xg=;        b=iszP8pqB6F/LVrGCFAabjHDagGgi6sdb/106fSUvuxDSYa9luAXkxTxoPMYjdTUix1         /J9ZFA9OICjGXkyE+CLXIxwdgTAdLUq9j3BRKgqKowWzOe6ZJayF0sE47o+wRQuwnxQh         9VhLve18rAIrj+xd8/p6LthoiBuEvzgIENcmHeV5po0o1oPKPe2Zs0q+XcnDTo0Us9EW         sDpK2s/lDiR9PYygwDspOf4tc/kk79rmO4idhwRUJH7UoJ5t0aXx0dGQI7KrwhGU74R6         C6V11AEv4EAm5txkE/6CKUDYXFmbPjPgiJgZ40PAhymvcx4LVQZKQmwwh3WauD1LUI/n         JGPA==X-Gm-Message-State: AOJu0Yw8v83eWmLvQptFNjIO+AenK8gZs+RtRlZ5qv3nugVW0qM+BDSB        mai/kMQEu1dhQ+p/5TNvxQInCzGCSKMtX+FyFhApxIKJb5RwK/4GksCT/v8MpWM3Hu61sQ3q2Zy        Rew16AdofHlyUmEafaVoxZXVlD9htY3GDMZI=X-Google-Smtp-Source: AGHT+IFfHQouTWujRz/MYsx0bMfPOJTTJeSu7XEHADhZQMygD9HeP+Q0AGJNoa85g6/ggVMVNsDUQYQS2dggcY+/5t0=X-Received: by 2002:a17:907:e614:b0:a99:446f:4c1 with SMTP id a640c23a62f3a-a99e3cf8061mr46754366b.33.1728672779204; Fri, 11 Oct 2024 11:52:59 -0700 (PDT)MIME-Version: 1.0From: Abc Cde Abewicrama <abcAbc@gmail.com>Date: Sat, 12 Oct 2024 02:52:48 +0800Message-ID: <CAOzeRSXT35-xfHijtJNT0tq7qEnfRAu358JPqN9npo64PH221w@mail.gmail.com>Subject: wTo: w123@cosyhome.cloudContent-Type: multipart/alternative; boundary="000000000000f005c0062437fed6"--000000000000f005c0062437fed6Content-Type: text/plain; charset="UTF-8"sddsBest Regards,Abc CdeLinkedin <https://lk.linkedin.com/in/Abc-Cde-abeywickrama-7a8379a9> | Github <https://github.com/abcAbc>--000000000000f005c0062437fed6Content-Type: text/html; charset="UTF-8"Content-Transfer-Encoding: quoted-printable<div dir=3D"ltr">sdds<br clear=3D"all"><div><div dir=3D"ltr" class=3D"gmail=_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><div d=ir=3D"ltr"><div><div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-size:s=mall;font-family:&quot;trebuchet ms&quot;,sans-serif;color:rgb(0,0,0)"><br>=</div><div style=3D"font-size:small;font-family:&quot;trebuchet ms&quot;,sa=ns-serif;color:rgb(0,0,0)"><br></div><div style=3D"font-size:small;font-fam=ily:&quot;trebuchet ms&quot;,sans-serif;color:rgb(0,0,0)">Best Regards,</di=v><div style=3D"font-size:small;font-family:&quot;trebuchet ms&quot;,sans-s=erif;color:rgb(0,0,0)">Abc Cde</div><div style=3D"font-size:small;f=ont-family:&quot;trebuchet ms&quot;,sans-serif;color:rgb(0,0,0)"><a href=3D="https://lk.linkedin.com/in/Abc-Cde-abeywickrama-7a8379a9" style=3D="color:rgb(17,85,204)" target=3D"_blank">Linkedin</a>=C2=A0|=C2=A0<a href==3D"https://github.com/abcAbc" target=3D"_blank"><font face=3D"Aria=l, Helvetica, sans-serif">G</font>ithub</a>=C2=A0</div></div></div></div></=div></div></div></div></div></div>--000000000000f005c0062437fed6--

Does anyone have any ideas or proper methods to render this content?

Below is the relevant log file related to inbox emails.


Viewing all articles
Browse latest Browse all 707


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>