On Sat, 13 Nov 2021 22:20, Carlos E. R.
The result should be an mbox file:
cer@minas-tirith:~> l Mail/alpine_r_tl_tmp -rw-r--r-- 1 cer users 266791 Nov 13 21:38 Mail/alpine_r_tl_tmp cer@minas-tirith:~> file Mail/alpine_r_tl_tmp Mail/alpine_r_tl_tmp: SMTP mail, ASCII text, with very long lines cer@minas-tirith:~>
But look at the format, it is wrong, mail programs can not use it:
cer@minas-tirith:~> head -n 20 Mail/alpine_r_tl_tmp Return-Path:
Delivered-To: robin.listas@telefonica.net Received: from imap.telefonica.net [86.109.99.71] by minas-tirith.valinor with IMAP (fetchmail-6.3.26 polling imap.telefonica.net account robin.listas2 folder temporary) for (single-drop); Sat, 13 Nov 2021 21:38:16 +0100 (CET) Received: from dovector01.e.movistar.es ([217.116.1.119]) by lda06.e.movistar.es (Dovecot) with LMTP id 61IFOAfUiWHeLgAAdnA+5w for ; Tue, 09 Nov 2021 02:51:03 +0100 Received: from asavin03.e.movistar.es ([217.116.1.119]) by dovector01.e.movistar.es with LMTP id OPVJOAfUiWFdQQAAMW5kXg (envelope-from ) for ; Tue, 09 Nov 2021 02:51:03 +0100 Received: from relayin04.e.movistar.es (217-116-1-119.redes.acens.net [217.116.1.119]) by asavin03.e.movistar.es (Postfix) with ESMTP id 4Hp9tb58VczvQC1 for ; Tue, 9 Nov 2021 02:51:03 +0100 (CET) X-Tnet-ASAV: Yes Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by relayin04.e.movistar.es (Postfix) with ESMTP id 4Hp9tb3fBYzXdy0 for ; Tue, 9 Nov 2021 02:51:03 +0100 (CET) cer@minas-tirith:~> While a normal mbox file looks this way:
cer@minas-tirith:~> head -n 20 Mail/alpine_r_tl From MAILER-DAEMON Sat Nov 13 21:08:23 2021 Date: 13 Nov 2021 21:08:23 +0100 From: Mail System Internal Data
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA Message-ID: <1636834103@minas-tirith.valinor> X-IMAP: 1636834103 0000180411 NonJunk mio $Forwarded $label3 $label1 z-half-jerk $label4 jerk interesting $label5 junk $label2 $MDNSent hecho mark curio investigate googlegroups Status: RO This text is part of the internal format of your mail folder, and is not a real message. It is created automatically by the mail system software. If deleted, important folder data will be lost, and it will be re-created with the data reset to initial values.
From cer@Telcontar.valinor Fri Aug 28 23:28:22 2020 Return-Path:
Delivered-To: robin.listas@telefonica.net Received: from dovector01.e.movistar.es ([217.116.1.119]) by lda04.e.movistar.es (Dovecot) with LMTP id 8653AvZ2SV+8VAAAEdfVVg for ; Fri, 28 Aug 2020 23:28:22 +0200 Received: from asavin02.e.movistar.es ([217.116.1.119]) cer@minas-tirith:~>
Hint: man procmail, quote: "To make `egrepping' of headers more consistent, procmail concatenates all continued header fields; but only internally. When delivering the mail, line breaks will appear as before." IFAIKS procmail itself has no option to make this concatenation permanent. The tool you look fot is "formail" esp. with the "-c" option. man formail, quote: "-c Concatenate continued fields in the header. Might be convenient when postprocessing mail with standard (line oriented) text utilities." In my personal .procmailrc after sorting out hard spam, I use a recipy to pipe every mail through formail with the -c -f and -z options, example: [code] # ======================================END of SPAM, unfold header lines. :0 fhw | formail -cfz [/code] I hope this gives you an idea to go forward. - Yamaban.