~cel

https://celehner.com/

SSB: @f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519


#453 could not read header: message: malformed MIME header line a month ago

Ticket created by ~cel on ~sircmpwn/aerc2

I'm subscribed to one mailing list whose messages have a weird long header, like this:

X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedujedrvdeggdekhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogetfedtuddqtdduucdludehmdenucfjughrpefhtgggfffukffvofesrgdtmherhhdtjeenucfhrhhomhepffhonhhnrgcuoeguohhnnhgrughinhhgihhllhhoudestghomhgtrghsthdrnhgvtheqnecuggftrfgrthhtvghrnhepfeevhfelieevffejvddtvdevgfdvhefhtdffgfefkefgleevgeefgfevvdeigeetnecuffhomhgrihhnpehinhhsthhithhuthgvtghhrhhishhttghonhhstghiohhushhnvghsshdrohhrghdpiihoohhmrdhushenucfkphepudefjedruddtfedrvddvtddrvdehudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddrgegnpdhinhgvthepudefjedruddtfedrvddvtddrvdehuddpmhgrihhlfhhrohhmpeguohhnnhgrughinhhgihhllhhoudestghomhgtrghsthdrnhgvthdprhgtphhtthhopeguohhnnhgrughinhhgihhllhhoudestghomhgtrghsthdrnhgvthdprhgtphhtthhopehjihhmtghlvghvvghlrghnugesmhgvrdgtohhmpdhrtghpthhtoheprhgvtghorhgushholhhuthhiohhnshesrgholhdrtghomhdprhgtphhtth
 hopegtrghthhgrrhhtvghmphhlvgesghhmrghilhdrtghomhdprhgtphhtthhopegsohhnghhlrggtshhonhesihgvvhholhhvvghphhdrtghomhdprhgtphhtthhopegrmhgsvghrghgvnhgvsehssggtghhlohgsrghlrdhnvghtpdhrtghpthhtohepmhgvrhhmrghiughlohhrvgesihgtlhhouhgurdgtohhmpdhrtghpthhtoheprghnnhgrlhihnhehiedvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjhgrtghquhgvshdrrhgvvhgvrhhsvggruhesghhmrghilhdrtghomhdprhgtphhtthhopegurghnihgvlhgprhhivhejjeeshigrhhhoohdrtghomhdprhgtphhtthhopehqohhinhhsthdvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepghhrvggvshgvleesmhhsnhdrtghomhdprhgtphhtthhopehtlhhuvhhlhihlihhghhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuhgsrdhomhgrhhgrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjhgrnhgvthgpfhgrlhgsohesmhgrtgdrtghomhdprhgtphhtthhopeguhihlrghnrheshiejmhgrihhlrdgtohhmpdhrtghpthhtohepohhnohhjrghfrhhiuggrhidvtddtgeesghhmrghilhdrtghomhdprhgtphhtthhopehmlhhorhgvlhhlvdelsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghilhhlhihgrhgrnhhtgiesghhmrghilhdrtghomhdprhgtphhtthhopehsrghrshhurhhsuhhmseihrghhohhordgtohhmpdhrtghpthhtohephhiivghrudestggvnhh
 tuhhrhihlihhnkhdrnhgvthdprhgtphhtthhopehhvggrthhhvghr
tggrrhhriedtieesihgtlhhouhgurdgtohhmpdhrtghpthhtoheprghrtghshhhivghlughstghtsehfrhhonhhtihgvrhdrtghomhdprhgtphhtthhopegshihrohhnsehorhhighhinhhprhgvshhsrdgtohhmpdhrtghpthhtoheprhhosghinhhsmhhitghhrggvlhduudduudeshigrhhhoohdrtghomhdprhgtphhtthhopehiuggvrghlnhgvthifohhrkhhprhhojhgvtghtshesghhmrghilhdrtghomhdprhgtphhtthhopegrnhgurhgvrgdrlhhishhsvghnsggvrhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnnhhsrghfvgesjhhunhhordgtohhmpdhrtghpthhtohepughrghhnohhrrghtohesvhgvrhhiiihonhdrnhgvthdprhgtphhtthhopehknhhighhhthhguhgrrhguihgrnhdusehgmhgrihhlrdgtohhmpdhrtghpthhtohepughouhgslhgvmhgvrhhkrggsrgeshhhothhmrghilhdrtghomhdprhgtphhtthhopehjrggtvhgrihhllhgrnhgtohhurhhtseihrghhohhordgtrgdprhgtphhtthhopehfthhlvggrshhttghhrghmsggvrheshigrhhhoohdrtghomhdprhgtphhtthhopehgvghrrghlughtfhgrrhhlvgihsehhohhtmhgrihhlrdgtohhmpdhrtghpthhtohepsgguvghruhihthgvrheshigrhhhoohdrtghomhdprhgtphhtthhopehjvghsrghikhgrfhhithiiseihrghhohhordgtohhmpdhrtghpthhtohepnhhuthhrihhvvggurgeshhhothhmrghilhdrtghomhdprhgtphhtthhopehjoh
 hhnhhfudehfeeshigrhhhoohdrtghomhdprhgtphhtthhopehlrghhrhgvvggusehhohhtmhgrihhlrdgtohhmpdhrtghpthhtohepshgsihguihgrkhhithgvseihrghhohhordgtohhmpdhrtghpthhtoheprggtkhhuudesohhuthhlohhokhdrtghomhdprhgtphhtthhopehphhhilhhiphhtvggthhhpohhinhhtseihrghhohhordgtohhmpdhrtghpthhtohepohgrkhhlvgihvddvsegsvghllhhsohhuthhhrdhnvghtpdhrtghpthhtoheptghoohhkihgvmhhonhhsthgvrhdtjeejkeesghhmrghilhdrtghomhdprhgtphhtthhopehjohhsvghphhdrvhgrtghkrgihihhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhovhgvjhgvnhhnrgesghhmrghilhdrtghomhdprhgtphhtthhopegsvggtkhholhgrjeejseihrghhohhordgtohhmpdhrtghpthhtohepvhhmrggtkhhkieelsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvggumhhunhgukhhuvghllhesghhmrghilhdrtghomhdprhgtphhtthhopehmihgthhgvlhhlvghrvghiugdufedufeeshigrhhhoohdrtghomhdprhgtphhtthhopehmsggrrhhkvghrmhhorhhrihhsseihrghhohhordgtohhmpdhrtghpthhtoheprhefmhhilhhlvghrsegtohhmtggrshhtrdhnvghtpdhrtghpthhtoheptggrrhhlrggtlhgrshhonhesghhmrghilhdrtghomhdprhgtphhtthhopeguvggvshhtihgtkhestghomhgtrghsthdrnhgvthdprhgtphhtthhopeifvghrohg
 tkhifvghrohhllhesghhmrghilhdrtghomhdprhgtphhtthhopehj
rghnlhgrphhpfeejfeejsehgmhgrihhlrdgtohhmpdhrtghpthhtohepughonhhsmhihthhhgedvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgrrhhivggsihhtvghnghesghhmrghilhdrtghomhdprhgtphhtthhopegsrghrsghoohhoohegsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhinhgurghlohhruggrnheshigrhhhoohdrtghomhdprhgtphhtthhopehsthgttgdrtggvlhestggvlhgvhhhnvghrrdgtohhmpdhrtghpthhtoheplhgvohhnrdhvrghnuggvrhhpohhlsehgmhgrihhlrdgtohhmpdhrtghpthhtohepihgrmhhlrghurhgrmhgrhhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopegrthhsvghrvghmrgesshgrrhhsrdhgohhvrdiirgdprhgtphhtthhopegvughlohhvvgdvsehouhhtlhhoohhkrdgtohhmpdhrtghpthhtohepghholhguvghnthhimhgviiejjeesghhmrghilhdrtghomhdprhgtphhtthhopehkrgihuhhmrghnghhgihhorhhgrghnihgtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgrrhihlhhivhhinhhgshhtohhnsehushgrrdhnvghtpdhrtghpthhtoheplhgruhhrihgvieeljeestghomhgtrghsthdrnhgvthdprhgtphhtthhopegslhhuvghmohhonheggeegsehssggtghhlohgsrghlrdhnvghtpdhrtghpthhtohepghhgsehgvghrrghlhihnrdhushdprhgtphhtthhopehkrghgtddvleeksehhohhtmhgrihhlrdgtohhmpdhrtghpthhtohepmhhsrghlth

The problem appears to be that the header is broken into multiple lines, some of which do not start with a space. It seems that this header - along with a shorter X-Xfinity-VMeta header - is added by the sender's MTA, Comcast. The result is that aerc shows this error in the status line at the bottom and proceeds to not render the message list for that mailbox any further. I then use another mail program to move the offending message out of the way, and restart aerc.

I agree that this header is malformed. But it would be nice if this didn't break things. I am able to view the message normally in Sylpheed, Claws Mail, and K-9 Mail. In Claws Mail when I choose "Show All Headers", it appears to try to interpret the subsequent lines as additional headers. But Sylpheed and K-9 Mail show the whole thing as one long header.

Possible solutions:

  • Treat the additional unindented header lines as part of the same header.
  • Treat the additional unindented header lines as separate headers without a value.
  • Discard the additional unindented header lines, maybe showing a warning.
  • Continue to abort rendering this message, but continue processing other messages in the mailbox, and support operations like moving the message to another mailbox, or piping/saving it to a file.

Non-aerc solutions:

  • I configure my postfix MDA to ignore or repair the broken header
  • Comcast MTA - or whatever is doing it - stops adding this broken header
  • Sender stops using Comcast MTA

#22 Status line printed after body a month ago

Comment by ~cel on ~sircmpwn/gmni

Thanks, ~ecs!

#22 Status line printed after body a month ago

Comment by ~cel on ~sircmpwn/gmni

Ticket resolved: fixed

Thanks, ~sircmpwn

#22 Status line printed after body a month ago

Comment by ~cel on ~sircmpwn/gmni

Still happens for me on 174fbd5. Using Debian Testing, x64_64, glibc, bash.

It is because of mixing write with buffered I/O (printf). The text output with printf ends up buffered until after the body is already written. Any of the following should fix it:

  • Disable output buffering: setvbuf(stdout, NULL, _IONBF, 0)
  • Call fflush(stdout) after each printf before write
  • Use unbuffered formatted output functions to print status line: dprintf instead of printf
  • Use buffered I/O to write body: fwrite instead of write

#22 Status line printed after body a month ago

Ticket created by ~cel on ~sircmpwn/gmni

Hello,

When using gmni -i, I find that the status line is printed after the body if the output is not a TTY.

Example:

$ gmni -i gemini://celehner.com/hi.txt
20 text/plain
Hello, world!
$ gmni -i gemini://celehner.com/hi.txt | cat
Hello, world!
20 text/plain