-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Content-ID:
On Sat, 13 Nov 2021 23:31, Carlos E. R.
wrote: El 2021-11-13 a las 23:20 +0100, Yamaban escribió:
On Sat, 13 Nov 2021 22:20, Carlos E. R.
wrote: <snip> The result should be an mbox file:
...
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.
No, sorry, I don't understand what you are trying to say.
My purpose is very simple: fetch some mail with fetchmail and put it directly into a single mbox folder, no filtering done, no sorting at all. Just read from remote folder and put on local folder. Simple.
I have copied the recipe from here:
https://unix.stackexchange.com/questions/206628/fetchmail-fetch-sent-mail-to...
He does in fetchmail:
poll mail.example.com protocol imap user "me.there" password "password" is "me.here"
and in procmail:
MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log"
# [cut several lines]
: 0 * ^List-Id:.*macports-changes.lists.macosforge.org macports-changes/
: 0 * ^List-Id:.*macports-users.lists.macosforge.org macports-users/
# [etc.]
That's all, and it is not working. He is using maildir, and I need mbox; but the result I get is not mbox.
It is the first time I use 'mda' in fetchmail and "-m".
in your .procmailrc before the deliver to folder part:
[your code] # Everything goes to a single folder.
# testing. : 0 $HOME/Mail/alpine_r_tl_tmp [/your code]
with my pipe: (formail is called as $FORMAIL in your case) [new code] # Everything goes to a single folder. : 0 fhw | $FORMAIL -cfz
# testing. : 0 $HOME/Mail/alpine_r_tl_tmp [/new code]
more clear / non-ambiguous now?
Ok, I see what you want me to do, but not why O:-)
I just tried as you say.
I now have:
...
:0
* ^X-Spam-Status: Yes
$HOME/Mail/alpine_r_tl_tmp_spam
# Everything goes to a single folder.
:0 fhw
| $FORMAIL -cfz
# testing.
:0
$HOME/Mail/alpine_r_tl_tmp
And run the fetch. Mail is put there, but it still is not an mbox, so
neither Alpine or Thunderbird reads it.
cer@minas-tirith:~> l ~/Mail/alpine_r_tl_tmp
-rw-r--r-- 1 cer users 544 Nov 14 00:22 /home/cer/Mail/alpine_r_tl_tmp
cer@minas-tirith:~> l ~/Mail/alpine_r_tl_tmp
-rw-r--r-- 1 cer users 263427 Nov 14 00:22 /home/cer/Mail/alpine_r_tl_tmp
cer@minas-tirith:~>
You see there is content. But wrong content, the error is where you see the **
From MAILER_DAEMON Sun Nov 14 00:22:02 2021
Date: Sun, 14 Nov 2021 00:22:02 +0100
From: Mail System Internal Data