[oS-en] fetchmail-procmail problem
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Content-ID: <578bc7ac-29ef-ce25-f78d-8a1287a3bc21@minas-tirith.valinor> Hi, I'm trying to fetch mail from an imap folder at my ISP, and put it on a local folder; no sorting, no filtering. But I am having a problem: the result is not an mbox file. I have not seen this before. Fetching script - it appears to work correctly: cer@minas-tirith:~> cat ~/bin/recogercorreo_TL_tmp #!/bin/bash # 20211111 # Uses "/home/cer/.fetchmail_TLtmp/.fetchmailrc", which uses ~/.procmailrc_TLtmp # Purpose: fetch mail from telefonica temporary folder and put into local folder on disk. CUAL=TLtmp DATE=`date --iso=ns` SECS1=`date +%s` cd $HOME/.fetchmail_$CUAL FETCHMAILHOME=$HOME/.fetchmail_$CUAL fetchmail -v --fetchmailrc .fetchmailrc & PID=$! wait # PID is blank if run is not in background, it has finished the process when it gets to that line. # And I need that number to do the grep sucessfully. Thus I have to wait after it. DATE=`date --iso=ns` SECS2=`date +%s` DIFF=`expr $SECS2 - $SECS1` echo "$DATE Done fetchmail $CUAL (PID: $PID) in $DIFF seconds" grep fetchmail /var/log/mail | grep $PID | grep "message.*for .* at .*" | cut -d" " -f6- cer@minas-tirith:~> The result of a run is as expected: cer@minas-tirith:~> recogercorreo_TL_tmp 2021-11-13T21:38:20,174755076+01:00 Done fetchmail TLtmp (PID: 3717) in 4 seconds 3717 - - 197 messages for CARLOS at imap.telefonica.net (folder temporary) cer@minas-tirith:~> fetchmail file: cer@minas-tirith:~> cat /home/cer/.fetchmail_TLtmp/.fetchmailrc set syslog set no spambounce # 20211111 # Called by "recogercorreo_TL_tmp", and uses ~/.procmailrc_TLtmp # Purpose: fetch mail from telefonica temporary folder and put into local folder on disk. poll imap.telefonica.net with proto imap timeout 20, and tracepolls user *****, with password *****, is cer here, and fetchall, fetchlimit 25, keep, expunge 20, folders temporary mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" cer@minas-tirith:~> The procmail recipe file is this - it seems more complicated than needed because it is copy pasted from a big one, last used long ago. This is the one that is failing, ie, not generating the expected result: cer@minas-tirith:~> cat .procmailrc_TLtmp LOGFILE=$HOME/procmail_TLtmp.log # 20211111 # Everything goes to a single folder. # This file is used by /home/cer/.fetchmail_TLtmp/.fetchmailrc, because apparently fetchmail can not put mail directly into a folder. # http://pm-doc.sourceforge.net/doc/#variables_used_in_recipes # Pure newline NL = " " # Some useful date stamps TODAYISO = `date '+%Y-%m-%d %H:%M:%S.%N%:z'` #TODAY = `date '+%Y-%m-%d'` #THISMONTH = `date '+%Y-%m'` THISWEEK = `date '+%Y-%m_%W'` #LOG = "+++··· GOT $TODAYISO === $TODAY === $THISMONTH $NL" # 2.4 Procmail module library project # get it from here http://freecode.com/projects/procmail-lib # There is a "pm-jadate.rc" file somewhere that sets MM and DD etc. See ~/bin/cosas/procmail/ VERBOSE=off VERBOSE=on DELIVER = "/usr/lib/dovecot/dovecot-lda" FORMAIL = "/usr/bin/formail" :0 h * ^Message-ID: MESSAGEID=| $FORMAIL -c -xMessage-ID: LOG="$NL+++----> STARTING LOG at $HOST $TODAYISO (msgid: $MESSAGEID) $NL" dummy = "you can use this dummy to tell things on the log - when verbose is on" :0 * ^X-Spam-Status: Yes $HOME/Mail/alpine_r_tl_tmp_spam # Everything goes to a single folder. # testing. :0 $HOME/Mail/alpine_r_tl_tmp # No good, creates single mail. File has wrong format. cer@minas-tirith:~> The log is this - maybe. Each entry ends really at the " Folder:" line: procmail: [3718] Sat Nov 13 21:38:16 2021 procmail: Assigning "DELIVER=/usr/lib/dovecot/dovecot-lda" procmail: Assigning "FORMAIL=/usr/bin/formail" procmail: Match on "^Message-ID:" procmail: Assigning "MESSAGEID=" procmail: Executing "/usr/bin/formail,-c,-xMessage-ID:" procmail: Assigning "LOG= +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.702260932+01:00 (msgid: <20211109015055.1547604-2-david@fromorbit.com>) " +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.702260932+01:00 (msgid: <20211109015055.1547604-2-david@fromorbit.com>) procmail: Assigning "dummy=you can use this dummy to tell things on the log - when verbose is on" procmail: No match on "^X-Spam-Status: Yes" procmail: Assigning "LASTFOLDER=/home/cer/Mail/alpine_r_tl_tmp" procmail: Opening "/home/cer/Mail/alpine_r_tl_tmp" procmail: Acquiring kernel-lock Subject: [PATCH 01/16] xfs: factor out the CIL transaction header building Folder: /home/cer/Mail/alpine_r_tl_tmp 7988 procmail: [3732] Sat Nov 13 21:38:16 2021 procmail: Assigning "DELIVER=/usr/lib/dovecot/dovecot-lda" procmail: Assigning "FORMAIL=/usr/bin/formail" procmail: Match on "^Message-ID:" procmail: Assigning "MESSAGEID=" procmail: Executing "/usr/bin/formail,-c,-xMessage-ID:" procmail: Assigning "LOG= +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.813368222+01:00 (msgid: <20211109015055.1547604-5-david@fromorbit.com>) " +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.813368222+01:00 (msgid: <20211109015055.1547604-5-david@fromorbit.com>) procmail: Assigning "dummy=you can use this dummy to tell things on the log - when verbose is on" procmail: No match on "^X-Spam-Status: Yes" procmail: Assigning "LASTFOLDER=/home/cer/Mail/alpine_r_tl_tmp" procmail: Opening "/home/cer/Mail/alpine_r_tl_tmp" procmail: Acquiring kernel-lock Subject: [PATCH 04/16] xfs: embed the xlog_op_header in the commit record Folder: /home/cer/Mail/alpine_r_tl_tmp 7494 procmail: [3748] Sat Nov 13 21:38:16 2021 procmail: Assigning "DELIVER=/usr/lib/dovecot/dovecot-lda" procmail: Assigning "FORMAIL=/usr/bin/formail" procmail: Match on "^Message-ID:" procmail: Assigning "MESSAGEID=" procmail: Executing "/usr/bin/formail,-c,-xMessage-ID:" +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.908540742+01:00 (msgid: <20211109015055.1547604-4-david@fromorbit.com>) " +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.908540742+01:00 (msgid: <20211109015055.1547604-4-david@fromorbit.com>) Mail syslog only contains fetchmail verbose log, everything seems normal. <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - 6.3.26 querying imap.telefonica.net (protocol IMAP) at 2021-11-13T21:38:16 CET: poll started <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - Trying to connect to 86.109.99.71/143... <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=CRAM-MD5] e.movistar.es. <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - will idle after poll <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP> A0001 STARTTLS <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< A0001 OK Begin TLS negotiation now. ... <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP> A0006 FETCH 1 RFC822.HEADER <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< * 1 FETCH (RFC822.HEADER {4102} <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - reading message **********.net:1 of 197 (log message incomplete) <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< ) <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< A0006 OK Fetch completed (0.022 + 0.000 + 0.021 secs). <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP> A0007 FETCH 1 BODY.PEEK[TEXT] <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< * 1 FETCH (BODY[TEXT] {3826} <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - (3826 body octets) (log message incomplete) <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< ) <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< A0007 OK Fetch completed (0.001 + 0.000 secs). <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - not flushed <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP> A0008 STORE 1 +FLAGS (\Seen) <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< A0008 OK Store completed (0.003 + 0.000 + 0.002 secs). <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP> A0009 FETCH 2 RFC822.HEADER <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - IMAP< * 2 FETCH (RFC822.HEADER {4101} <2.6> 2021-11-13 21:38:16 minas-tirith fetchmail 3717 - - reading message*******.net:2 of 197 (log message incomplete) ... <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP< A0079 OK Fetch completed (0.001 + 0.000 secs). <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - not flushed <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP> A0080 STORE 25 +FLAGS (\Seen) <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP< A0080 OK Store completed (0.003 + 0.000 + 0.002 secs). <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - fetchlimit 25 reached; 172 messages left on server imap.telefonica.net account ***** <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP> A0081 LOGOUT <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP< * BYE Logging out <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - IMAP< A0081 OK Logout completed (0.000 + 0.000 secs). <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - 6.3.26 querying imap.telefonica.net (protocol IMAP) at 2021-11-13T21:38:20 CET: poll completed <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - Query status=13 (MAXFETCH) <2.6> 2021-11-13 21:38:20 minas-tirith fetchmail 3717 - - normal termination, status 13 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: <linux-xfs-owner@vger.kernel.org> 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 <cer@localhost> (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 <robin.listas@telefonica.net>; 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 <linux-xfs-owner@vger.kernel.org>) for <robin.listas@telefonica.net>; 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 <robin.listas@telefonica.net>; 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 <robin.listas@telefonica.net>; 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 <MAILER-DAEMON@minas-tirith.valinor> 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: <linux-xfs-owner@vger.kernel.org> 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 <robin.listas@telefonica.net>; Fri, 28 Aug 2020 23:28:22 +0200 Received: from asavin02.e.movistar.es ([217.116.1.119]) cer@minas-tirith:~> The first line: From MAILER-DAEMON Sat Nov 13 21:08:23 2021 is the key, it separates one mail from the other. It is missing in the file newly generated by procmail. Something is wrong. Either something changed in the code (I have not used procmail in months), or I made a config mistake, but I need a fresh pair of eyes ;-) - -- Cheers, Carlos E. R. (from openSUSE Leap 15.2 x86_64 (Minas Tirith)) -----BEGIN PGP SIGNATURE----- iJIEAREIADoWIQQt/vKEw5659AgM/X2NrxRtxRYzXAUCYZAsDxwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJEI2vFG3FFjNckIAA/3KigKecZnNf2KkjDl90 0T20R5uRLFA3Jb3EyINePYKUAP4k0XWgHZCjfK5Ua47JIrNEA7lPsB6rWp8YYPsL snixDw== =SfdB -----END PGP SIGNATURE-----
On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> wrote: <snip>
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: <linux-xfs-owner@vger.kernel.org> 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 <cer@localhost> (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 <robin.listas@telefonica.net>; 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 <linux-xfs-owner@vger.kernel.org>) for <robin.listas@telefonica.net>; 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 <robin.listas@telefonica.net>; 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 <robin.listas@telefonica.net>; 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 <MAILER-DAEMON@minas-tirith.valinor> 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: <linux-xfs-owner@vger.kernel.org> 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 <robin.listas@telefonica.net>; 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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2021-11-13 a las 23:20 +0100, Yamaban escribió:
On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> 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-sent-folder-or-fetch-to-a-target-folder> 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". - -- Cheers Carlos E. R. (from openSUSE Leap 15.2 x86_64 (Minas Tirith)) -----BEGIN PGP SIGNATURE----- iJIEAREIADoWIQQt/vKEw5659AgM/X2NrxRtxRYzXAUCYZA80Bwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJEI2vFG3FFjNcc/EBAImNvqzOxRJO/nnhGWUi rIh+PGhj5po5odpCR6RqJXvyAP0WMn6AVfovDZUNqU7ddjCWv7jvmEBOdNDk5e5a oqoCqw== =14hO -----END PGP SIGNATURE-----
On Sat, 13 Nov 2021 23:31, Carlos E. R. <robin.listas@...> wrote:
El 2021-11-13 a las 23:20 +0100, Yamaban escribió:
On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> 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:
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? - Yamaban
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Content-ID: <a1cdb88-fb7d-40d4-a0bb-10627e30d5e3@minas-tirith.valinor> El 2021-11-13 a las 23:55 +0100, Yamaban escribió:
On Sat, 13 Nov 2021 23:31, Carlos E. R. <robin.listas@...> wrote:
El 2021-11-13 a las 23:20 +0100, Yamaban escribió:
On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> 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:
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 <MAILER-DAEMON@minas-tirith> Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA Message-ID: <1636845722@minas-tirith> X-IMAP: 1635554333 0000000002 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. ** Return-Path: <linux-xfs-owner@vger.kernel.org> 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 <cer@localhost> (single-drop); Sun, 14 Nov 2021 00:22:17 +0100 (CET) Received: from dovector01.e.movistar.es ([217.116.1.119]) by lda06.e.movistar.es (Dovecot) with LMTP id 61IFOAfUiWHeLgAAdnA+5w for <robin.listas@telefonica.net>; 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 <linux-xfs-owner@vger.kernel.org>) for <robin.listas@telefonica.net>; Tue, 09 Nov 2021 02:51:03 +0100 The "From_" is missing. I tried also removing the spam recipe, no change. I also changed: # testing. :0 $HOME/Mail/alpine_r_tl_tmp to # testing. : 0 $HOME/Mail/alpine_r_tl_tmp Same problem, no change. - -- Cheers Carlos E. R. (from openSUSE Leap 15.2 x86_64 (Minas Tirith)) -----BEGIN PGP SIGNATURE----- iJIEAREIADoWIQQt/vKEw5659AgM/X2NrxRtxRYzXAUCYZBL7hwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJEI2vFG3FFjNcVUQA/jjpYYN0gZCc6GCkuJDn iyeMWOVTrdyu1qv+YYEVqrRtAP97QDW6pALgnxSbnurpoIdug0X7vBQgHbW//dKm dbZ8Lg== =5bYK -----END PGP SIGNATURE-----
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <36d79691-45ce-2c9d-5af3-4983e218a8da@telefonica.net> Date & Time: Sat, 13 Nov 2021 23:31:43 +0100 (CET) [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: CER> El 2021-11-13 a las 23:20 +0100, Yamaban escribió: CER> > On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> wrote: CER> > <snip> [...] CER> > [code] CER> > # ======================================END of SPAM, unfold header lines. CER> > : 0 fhw CER> > | formail -cfz CER> > [/code] CER> > CER> > I hope this gives you an idea to go forward. CER> No, sorry, I don't understand what you are trying to say. Me, too. CER> My purpose is very simple: fetch some mail with fetchmail and CER> put it directly into a single mbox folder, no filtering done, no CER> sorting at all. Just read from remote folder and put on local CER> folder. Simple. I understand. CER> I have copied the recipe from here: CER> <https://unix.stackexchange.com/questions/206628/fetchmail-fetch-sent-mail-to-sent-folder-or-fetch-to-a-target-folder> CER> He does in fetchmail: CER> poll mail.example.com CER> protocol imap CER> user "me.there" password "password" is "me.here" This is without mda, as you wrote; In the Message; Subject : [oS-en] fetchmail-procmail problem Message-ID : <3e4bc76c-d81a-b97a-5f51-4ae67deeb@telefonica.net> Date & Time: Sat, 13 Nov 2021 22:20:15 +0100 (CET) [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER>> code (I have not used procmail in months), or I made a config mistake, but I CER>> need a fresh pair of eyes ;-) But, you wrote; CER> and in procmail: CER> MAILDIR="$HOME/Dropbox/Mail" CER> DEFAULT="inbox/" CER> LOGFILE="$HOME/.procmail.log" CER> # [cut several lines] CER> :0 CER> * ^List-Id:.*macports-changes.lists.macosforge.org CER> macports-changes/ CER> :0 CER> * ^List-Id:.*macports-users.lists.macosforge.org CER> macports-users/ CER> # [etc.] What? You don't use procmail, do you? [...] CER> It is the first time I use 'mda' in fetchmail and "-m". fetchmail isn't a mda. You can solve the issue; add mda in .fetchmailrc poll mail.example.com protocol imap user "me.there" password "password" is "me.here" mda "/usr/bin/procmail" <-- THIS!! or You can use fetchmail witout a mda. Regads. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Tim Cook, the C.E.O. of Apple, said earlier this year that he would not let his nephew join social networks. Bill Gates banned cellphone until his children were teenagers, and Melinda Gates wrote that she wished they had waited even longer. Steve Jobs would not let his young children near iPads." -- The New York Times --
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2021-11-14 a las 08:06 +0900, Masaru Nomiya escribió:
Hello,
In the Message;
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
CER> El 2021-11-13 a las 23:20 +0100, Yamaban escribió: CER> > On Sat, 13 Nov 2021 22:20, Carlos E. R. <robin.listas@...> wrote: CER> > <snip> [...] CER> > [code] CER> > # ======================================END of SPAM, unfold header lines. CER> > : 0 fhw CER> > | formail -cfz CER> > [/code] CER> > CER> > I hope this gives you an idea to go forward.
CER> No, sorry, I don't understand what you are trying to say.
Me, too.
CER> My purpose is very simple: fetch some mail with fetchmail and CER> put it directly into a single mbox folder, no filtering done, no CER> sorting at all. Just read from remote folder and put on local CER> folder. Simple.
I understand.
CER> I have copied the recipe from here:
CER> He does in fetchmail:
CER> poll mail.example.com CER> protocol imap CER> user "me.there" password "password" is "me.here"
This is without mda, as you wrote;
In the Message;
Subject : [oS-en] fetchmail-procmail problem Message-ID : <3e4bc76c-d81a-b97a-5f51-4ae67deeb@telefonica.net> Date & Time: Sat, 13 Nov 2021 22:20:15 +0100 (CET)
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER>> code (I have not used procmail in months), or I made a config mistake, but I CER>> need a fresh pair of eyes ;-)
But, you wrote;
CER> and in procmail:
CER> MAILDIR="$HOME/Dropbox/Mail" CER> DEFAULT="inbox/" CER> LOGFILE="$HOME/.procmail.log"
CER> # [cut several lines]
CER> :0 CER> * ^List-Id:.*macports-changes.lists.macosforge.org CER> macports-changes/
CER> :0 CER> * ^List-Id:.*macports-users.lists.macosforge.org CER> macports-users/
CER> # [etc.]
What? You don't use procmail, do you?
I have to. I don't know another way.
[...] CER> It is the first time I use 'mda' in fetchmail and "-m".
fetchmail isn't a mda.
You can solve the issue;
add mda in .fetchmailrc
poll mail.example.com protocol imap user "me.there" password "password" is "me.here" mda "/usr/bin/procmail" <-- THIS!!
But that is exactly what I am doing: poll imap.telefonica.net with proto imap timeout 20, and tracepolls user *****, with password *****, is cer here, and fetchall, fetchlimit 25, keep, expunge 20, folders temporary mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" Only that I need to specify the exact procmail to use, can't be the default one.
or
You can use fetchmail witout a mda.
How? Remember, I want to direct all mail it fetches to a single folder. Can't use the default method with postfix handling. - -- Cheers Carlos E. R. (from openSUSE Leap 15.2 x86_64 (Minas Tirith)) -----BEGIN PGP SIGNATURE----- iJIEAREIADoWIQQt/vKEw5659AgM/X2NrxRtxRYzXAUCYZBH+xwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJEI2vFG3FFjNc/AcA/0MiA25Dt2WUdlpzdmmf LzTHol8N9eILLGpQ7Ob8nqfRAP47pr5fuULlZBITSn661KeivX1e6BW4hJ7JVCrp acyLuw== =YuZu -----END PGP SIGNATURE-----
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <d9a3ff5c-8617-560-bd37-4ceadf5389@telefonica.net> Date & Time: Sun, 14 Nov 2021 00:19:23 +0100 (CET) [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> > > It is the first time I use 'mda' in fetchmail and "-m". CER> > CER> > fetchmail isn't a mda. CER> > CER> > You can solve the issue; CER> > CER> > add mda in .fetchmailrc CER> > CER> > poll mail.example.com CER> > protocol imap CER> > user "me.there" password "password" is "me.here" CER> > mda "/usr/bin/procmail" <-- THIS!! CER> But that is exactly what I am doing: CER> poll imap.telefonica.net with proto imap timeout 20, and tracepolls CER> user *****, with password *****, is cer here, and fetchall, fetchlimit 25, keep, expunge 20, folders temporary CER> mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" Ah, this is your typo. In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <36d79691-45ce-2c9d-5af3-4983e218a8da@telefonica.net> Date & Time: Sat, 13 Nov 2021 23:31:43 +0100 (CET) [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> He does in fetchmail: CER> poll mail.example.com CER> protocol imap CER> user "me.there" password "password" is "me.here" CER> and in procmail: [...] MN>> or MN> > You can use fetchmail witout a mda. CER> How? Cf. https://unix.stackexchange.com/questions/5103/fetchmail-without-an-mda CER> Remember, I want to direct all mail it fetches to a single CER> folder. Can't use the default method with postfix handling. I can't understand the meaning of "fetches to a single folder". Because, yout setting tells; CER> > and in procmail: CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > CER> > # [cut several lines] CER> > CER> > :0 CER> > * ^List-Id:.*macports-changes.lists.macosforge.org CER> > macports-changes/ CER> > CER> > :0 CER> > * ^List-Id:.*macports-users.lists.macosforge.org CER> > macports-users/ CER> > CER> > # [etc.] That is; put mails with List-Id:.*macports-changes.lists.macosforge.org into $MAILDIR/macports-changes folder, and put mails with List-Id:,*macports-users.lists.macosforge.org into $MAILDIR/macports-changes folder. You set 2 folders, and you can fetch mails which match these conditions. But, you can't fetch other mails with this setting in ~/.procmailrc. Change this; 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/ :0 inbox/ Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 14/11/2021 01.18, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <d9a3ff5c-8617-560-bd37-4ceadf5389@telefonica.net> Date & Time: Sun, 14 Nov 2021 00:19:23 +0100 (CET)
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> > > It is the first time I use 'mda' in fetchmail and "-m". CER> > CER> > fetchmail isn't a mda. CER> > CER> > You can solve the issue; CER> > CER> > add mda in .fetchmailrc CER> > CER> > poll mail.example.com CER> > protocol imap CER> > user "me.there" password "password" is "me.here" CER> > mda "/usr/bin/procmail" <-- THIS!!
CER> But that is exactly what I am doing:
CER> poll imap.telefonica.net with proto imap timeout 20, and tracepolls CER> user *****, with password *****, is cer here, and fetchall, fetchlimit 25, keep, expunge 20, folders temporary CER> mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp"
Ah, this is your typo.
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <36d79691-45ce-2c9d-5af3-4983e218a8da@telefonica.net> Date & Time: Sat, 13 Nov 2021 23:31:43 +0100 (CET)
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> He does in fetchmail:
CER> poll mail.example.com CER> protocol imap CER> user "me.there" password "password" is "me.here"
CER> and in procmail: [...]
MN>> or
MN> > You can use fetchmail witout a mda.
CER> How?
Cf.
https://unix.stackexchange.com/questions/5103/fetchmail-without-an-mda
Reading... says: Use the mda option in your .fetchmailrc to specify maildrop or procmail as your MDA. mda "/usr/bin/maildrop" I don't have it installed and I probably don't want to install it., if it needs my installing courier. As the site says, again this is using fetchmail *with* and mda. The other recipe is: mda "/bin/sh -c 'cat > INBOX/new/$(date +%''s_%N)'" I suspect this will again fail to produce an mbox file, it is a direct copy of one imap email.
CER> Remember, I want to direct all mail it fetches to a single CER> folder. Can't use the default method with postfix handling.
I can't understand the meaning of "fetches to a single folder".
I want to copy or move all mail from user@imap.remote.example, folder temporary, to /home/carlos/Mail/temporary mbox file. Just as simple as that. Using fetchmail, of course. Copy one remote imap folder to one local mbox file.
Because, yout setting tells;
That's not mine, it is the example from <https://unix.stackexchange.com/questions/206628/fetchmail-fetch-sent-mail-to-sent-folder-or-fetch-to-a-target-folder>
CER> > and in procmail: CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > CER> > # [cut several lines] CER> > CER> > :0 CER> > * ^List-Id:.*macports-changes.lists.macosforge.org CER> > macports-changes/ CER> > CER> > :0 CER> > * ^List-Id:.*macports-users.lists.macosforge.org CER> > macports-users/ CER> > CER> > # [etc.]
That is;
put mails with List-Id:.*macports-changes.lists.macosforge.org into $MAILDIR/macports-changes folder, and put mails with List-Id:,*macports-users.lists.macosforge.org into $MAILDIR/macports-changes folder.
Forgets what he does.
You set 2 folders, and you can fetch mails which match these conditions. But, you can't fetch other mails with this setting in ~/.procmailrc.
Change this;
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/
:0 inbox/
He is using maildir. I want mbox. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
* Carlos E. R. <robin.listas@telefonica.net> [11-13-21 19:47]:
On 14/11/2021 01.18, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <d9a3ff5c-8617-560-bd37-4ceadf5389@telefonica.net> Date & Time: Sun, 14 Nov 2021 00:19:23 +0100 (CET)
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> > > It is the first time I use 'mda' in fetchmail and "-m".
MUCH trimmed this is what I do on my server: poll imap.gmail.com with interval 0 proto imap port 993 timeout 150 \ auth any, and tracepolls user '<me>', with password "<passwd>", is <ME> here, and ssl, and \ fetchall sslcertck mda '/usr/lib/sendmail -i -oem -f %F %T' user '<me>', with password "<passwd>", is <ME> here, and ssl, and \ fetchall sslcertck mda '/usr/lib/sendmail -i -oem -f %F %T' and I only use mbox (forever) but the fetches are from an imap server. I have sendmail hand off to procmail for sorting -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode What sort of day was it? A day like all days, filled with those events that alter and illuminate our times... all things are as they were then, but were you there?
On 14/11/2021 01.55, Patrick Shanahan wrote:
* Carlos E. R. <> [11-13-21 19:47]:
MUCH trimmed
this is what I do on my server:
poll imap.gmail.com with interval 0 proto imap port 993 timeout 150 \ auth any, and tracepolls
user '<me>', with password "<passwd>", is <ME> here, and ssl, and \ fetchall sslcertck mda '/usr/lib/sendmail -i -oem -f %F %T'
user '<me>', with password "<passwd>", is <ME> here, and ssl, and \ fetchall sslcertck mda '/usr/lib/sendmail -i -oem -f %F %T'
and I only use mbox (forever) but the fetches are from an imap server.
I have sendmail hand off to procmail for sorting
I don't want any sorting. I can not use sendmail, which is actually postfix, because that uses the default procmail file, which does sorting according to different criteria. I have to tel fetchmail to call procmail with a certain temporary procmail file, not the default one. What I want is everything fetchmail reads to go into /home/cer/temporary, no questions, no filtering, no sorting. Something like: poll imap.gmail.com blablabla user '<me>', bla bla bla writeto /home/cer/temporary Only that option "writeto" does not exist :-/ What I am thinking is perhaps use a different user for this purpose and damn it all. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
From: "Carlos E. R." <robin.listas@telefonica.net> Date: Sun, 14 Nov 2021 01:42:17 +0100 . . . Reading... says: Use the mda option in your .fetchmailrc to specify maildrop or procmail as your MDA. . . . I also think the MDA thing is not necessary. I don't use either fetchmail or procmail myself, but it seems to me you should be able to get procmail to generate the "From " lines directly. According to "man procmail", When in explicit delivery mode, procmail will generate a leading `From ' line if none is present . . . And it appears that you can force procmail into "explicit delivery mode" with "-d username" (which will work if you use your username). -- Bob Rogers http://www.rgrjr.com/
On 14/11/2021 01.56, Bob Rogers wrote:
From: "Carlos E. R." <robin.listas@telefonica.net> Date: Sun, 14 Nov 2021 01:42:17 +0100
. . .
Reading... says:
Use the mda option in your .fetchmailrc to specify maildrop or procmail as your MDA.
. . .
I also think the MDA thing is not necessary. I don't use either fetchmail or procmail myself, but it seems to me you should be able to get procmail to generate the "From " lines directly. According to "man procmail",
Procmail normally generates those lines correctly, it simply doesn't for some reason. I have a working procmail recipe system, very big. But this time, for reasons of my own, I need to bypass them and use an specific procmail file. I'm thinking that the "fetchmail ... mda procmail" method only works with Maildir folders.
When in explicit delivery mode, procmail will generate a leading `From ' line if none is present . . .
And it appears that you can force procmail into "explicit delivery mode" with "-d username" (which will work if you use your username).
-d cer? Ok, trying. ... mda "/usr/bin/procmail -d cer -m $HOME/.procmailrc_TLtmp" Does not work. It ignores the -m part, and delivers using the default recipe, /home7cer/.procmailrc and does the sorting that it thinks proper, which is not the one I want this time. I now have to find those 20 mails it sorted and delete them. Fortunately in this case it is a single folder. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <4d1e7754-b93c-6e43-5b4e-515776716ccb@telefonica.net> Date & Time: Sun, 14 Nov 2021 01:42:17 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> > Change this; CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > CER> > # [cut several lines] CER> > CER> > :0 CER> > * ^List-Id:.*macports-changes.lists.macosforge.org CER> > macports-changes/ CER> > CER> > :0 CER> > * ^List-Id:.*macports-users.lists.macosforge.org CER> > macports-users/ CER> > CER> > :0 CER> > inbox/ CER> He is using maildir. I want mbox. Ah, I see. MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log" [...] :0 inbox I DO recommend you to use mh format. Because, you should use a lock if you store a message using mbox form to prevent accidents such as "which the next message is written in at before a message before" is stored. Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Three young men died for Rationalization. Yet, Margaret Bloody Thatcher LIVES!" 'Brassed Off'
On 14/11/2021 02.28, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <4d1e7754-b93c-6e43-5b4e-515776716ccb@telefonica.net> Date & Time: Sun, 14 Nov 2021 01:42:17 +0100
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> > Change this; CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > CER> > # [cut several lines] CER> > CER> > :0 CER> > * ^List-Id:.*macports-changes.lists.macosforge.org CER> > macports-changes/ CER> > CER> > :0 CER> > * ^List-Id:.*macports-users.lists.macosforge.org CER> > macports-users/ CER> > CER> > :0 CER> > inbox/
CER> He is using maildir. I want mbox.
Ah, I see.
MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log" [...] :0 inbox
I DO recommend you to use mh format. Because, you should use a lock if you store a message using mbox form to prevent accidents such as "which the next message is written in at before a message before" is stored.
I know all that, I have been using mbox for more than two decades without a problem, and I do not want to change. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <50887dfd-fcad-ef00-0107-f0b9efa2ae09@telefonica.net> Date & Time: Sun, 14 Nov 2021 02:31:34 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER>>> He is using maildir. I want mbox. CER> > CER> > Ah, I see. CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > [...] CER> > :0 CER> > inbox CER> > CER> > I DO recommend you to use mh format. CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored. CER> I know all that, I have been using mbox for more than two decades CER> without a problem, and I do not want to change. Do you understand this settings change? MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log" [...] :0 inbox This is mbox format folder. THanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <87ee7j5xdc.wl-nomiya@galaxy.dti.ne.jp> Date & Time: Sun, 14 Nov 2021 10:39:27 +0900 [MN] == Masaru Nomiya <nomiya@galaxy.dti.ne.jp> has written: MN> Hello, MN> In the Message; MN> Subject : Re: [oS-en] fetchmail-procmail problem MN> Message-ID : <50887dfd-fcad-ef00-0107-f0b9efa2ae09@telefonica.net> MN> Date & Time: Sun, 14 Nov 2021 02:31:34 +0100 MN> [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: MN> [...] CER>>> He is using maildir. I want mbox. CER> > CER> > Ah, I see. CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > [...] CER> > :0 CER> > inbox CER> > CER> > I DO recommend you to use mh format. CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored. CER> I know all that, I have been using mbox for more than two decades CER> without a problem, and I do not want to change. Do you really understand the issue which I wrote; Because, you should use a lock if you store a message using mbox form to prevent accidents such as "which the next message is written in at before a message before" is stored. This relate to procmail. You wrote; In the Message; Subject : [oS-en] fetchmail-procmail problem Message-ID : <3e4bc76c-d81a-b97a-5f51-4ae67deeb@telefonica.net> Date & Time: Sat, 13 Nov 2021 22:20:15 +0100 (CET) [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [..] CER> code (I have not used procmail in months), ... [...] Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 14/11/2021 02.51, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <87ee7j5xdc.wl-nomiya@galaxy.dti.ne.jp> Date & Time: Sun, 14 Nov 2021 10:39:27 +0900
[MN] == Masaru Nomiya <nomiya@galaxy.dti.ne.jp> has written:
MN> Hello,
MN> In the Message;
MN> Subject : Re: [oS-en] fetchmail-procmail problem MN> Message-ID : <50887dfd-fcad-ef00-0107-f0b9efa2ae09@telefonica.net> MN> Date & Time: Sun, 14 Nov 2021 02:31:34 +0100
MN> [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
MN> [...] CER>>> He is using maildir. I want mbox. CER> > CER> > Ah, I see. CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > [...] CER> > :0 CER> > inbox CER> > CER> > I DO recommend you to use mh format. CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored.
CER> I know all that, I have been using mbox for more than two decades CER> without a problem, and I do not want to change.
Do you really understand the issue which I wrote;
Because, you should use a lock if you store a message using mbox form to prevent accidents such as "which the next message is written in at before a message before" is stored.
This relate to procmail.
Yes, I do. It is not an issue, because we are talking of a single folder, not any other process is writing to that folder, and there is indeed a lock: +++----> STARTING LOG at minas-tirith.valinor 2021-11-13 21:38:16.702260932+01:00 (msgid: <20211109015055.1547604-2-david@fromorbit.com>) procmail: Assigning "dummy=you can use this dummy to tell things on the log - when verbose is on" procmail: No match on "^X-Spam-Status: Yes" procmail: Assigning "LASTFOLDER=/home/cer/Mail/alpine_r_tl_tmp" procmail: Opening "/home/cer/Mail/alpine_r_tl_tmp" ** procmail: Acquiring kernel-lock -- Saludos/Cheers Carlos E. R.
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <c6adfb24-ec2c-f059-2224-9c26e4752136@gmx.es> Date & Time: Sun, 14 Nov 2021 03:03:53 +0100 [CER] == "Carlos E.R." <robin.listas@gmx.es> has written: [...] CER> > Do you really understand the issue which I wrote; CER> > CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored. CER> > CER> > This relate to procmail. CER> Yes, I do. It is not an issue, because we are talking of a single CER> folder, not any other process is writing to that folder, and there is CER> indeed a lock: Please read the man of procmail, and understand the meanings and usage of "lock". THanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "No Windows, no gains!" ..... "Why, I am wrong?" -- Bill --
On 14/11/2021 03.15, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <c6adfb24-ec2c-f059-2224-9c26e4752136@gmx.es> Date & Time: Sun, 14 Nov 2021 03:03:53 +0100
[CER] == "Carlos E.R." <robin.listas@gmx.es> has written:
[...] CER> > Do you really understand the issue which I wrote; CER> > CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored. CER> > CER> > This relate to procmail.
CER> Yes, I do. It is not an issue, because we are talking of a single CER> folder, not any other process is writing to that folder, and there is CER> indeed a lock:
Please read the man of procmail, and understand the meanings and usage of "lock".
I did. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 14/11/2021 02.39, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <50887dfd-fcad-ef00-0107-f0b9efa2ae09@telefonica.net> Date & Time: Sun, 14 Nov 2021 02:31:34 +0100
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER>>> He is using maildir. I want mbox. CER> > CER> > Ah, I see. CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > [...] CER> > :0 CER> > inbox CER> > CER> > I DO recommend you to use mh format. CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored.
CER> I know all that, I have been using mbox for more than two decades CER> without a problem, and I do not want to change.
Do you understand this settings change?
MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log" [...] :0 inbox
This is mbox format folder.
AFAIK, "inbox/" is maildir, and "inbox" is mbox. And you are defining "MAILDIR=...", so it does maildir, not mbox. The problem is precisely that mbox is not working, when procmail is invoked directly by fetchmail. I fact, if I leave everything as it was from the start, first post, and I change this line in the .procmailrc_TLtmp file: # testing. : 0 $HOME/Mail/alpine_r_tl_tmp with: # testing. : 0 $HOME/Mail/alpine_r_tl_tmp Everything works, except one little detail: the folder is now maildir, not mbox. As a consequence, dovecot goes bonkers, but Alpine can read it if I bypass dovecot. -- Saludos/Cheers Carlos E. R.
On 14/11/2021 02.59, Carlos E.R. wrote:
On 14/11/2021 02.39, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <50887dfd-fcad-ef00-0107-f0b9efa2ae09@telefonica.net> Date & Time: Sun, 14 Nov 2021 02:31:34 +0100
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER>>> He is using maildir. I want mbox. CER> > CER> > Ah, I see. CER> > CER> > MAILDIR="$HOME/Dropbox/Mail" CER> > DEFAULT="inbox/" CER> > LOGFILE="$HOME/.procmail.log" CER> > [...] CER> > :0 CER> > inbox CER> > CER> > I DO recommend you to use mh format. CER> > Because, you should use a lock if you store a message using mbox form CER> > to prevent accidents such as "which the next message is written in at CER> > before a message before" is stored.
CER> I know all that, I have been using mbox for more than two decades CER> without a problem, and I do not want to change.
Do you understand this settings change?
MAILDIR="$HOME/Dropbox/Mail" DEFAULT="inbox/" LOGFILE="$HOME/.procmail.log" [...] :0 inbox
This is mbox format folder.
AFAIK, "inbox/" is maildir, and "inbox" is mbox. And you are defining "MAILDIR=...", so it does maildir, not mbox.
The problem is precisely that mbox is not working, when procmail is invoked directly by fetchmail.
I fact, if I leave everything as it was from the start, first post, and I change this line in the .procmailrc_TLtmp file:
# testing. : 0 $HOME/Mail/alpine_r_tl_tmp
with:
# testing. : 0 $HOME/Mail/alpine_r_tl_tmp
typpo. $HOME/Mail/alpine_r_tl_tmp/
Everything works, except one little detail: the folder is now maildir, not mbox. As a consequence, dovecot goes bonkers, but Alpine can read it if I bypass dovecot.
-- Saludos/Cheers Carlos E. R.
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <df6d8e0a-a5db-2ca7-6967-59ab4c122465@gmx.es> Date & Time: Sun, 14 Nov 2021 02:59:47 +0100 [CER] == "Carlos E.R." <robin.listas@gmx.es> has written: [...] CER> Everything works, except one little detail: the folder is now maildir, CER> not mbox. As a consequence, dovecot goes bonkers, but Alpine can read it CER> if I bypass dovecot. It's hard to understand your mails. If you used devcot, mda is mda "/usr/libexec/dovecot/deliver" But, your mda is procmail..... (_ _? Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Bill! You married with Computer. Not with Me!" "No..., with money."
On 14/11/2021 03.23, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <df6d8e0a-a5db-2ca7-6967-59ab4c122465@gmx.es> Date & Time: Sun, 14 Nov 2021 02:59:47 +0100
[CER] == "Carlos E.R." <robin.listas@gmx.es> has written:
[...] CER> Everything works, except one little detail: the folder is now maildir, CER> not mbox. As a consequence, dovecot goes bonkers, but Alpine can read it CER> if I bypass dovecot.
It's hard to understand your mails.
If you used devcot, mda is
mda "/usr/libexec/dovecot/deliver"
But, your mda is procmail..... (_ _?
Procmail can do both. If the name of the destination folder ends in "/", procmail creates a maildir folder structure: cer@minas-tirith:~> tree Mail/alpine_r_tl_tmp/ Mail/alpine_r_tl_tmp/ ├── cur │ ├── 1636854896.17011_0.minas-tirith.valinor,u=1:2, │ ├── 1636854896.17020_0.minas-tirith.valinor,u=2:2, ... │ ├── 1636854900.17253_0.minas-tirith.valinor,u=24:2, │ └── 1636854900.17263_0.minas-tirith.valinor,u=25:2, ├── new └── tmp 3 directories, 25 files cer@minas-tirith:~> My alpine can read those folders directly, but my dovecot can not read them because it expects an mbox structure. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
Am 14.11.21 um 12:44 schrieb Carlos E. R.:
On 14/11/2021 03.23, Masaru Nomiya wrote: My alpine can read those folders directly, but my dovecot can not read them because it expects an mbox structure.
my dovecot can¹. Greetings Wilhelm ¹ https://doc.dovecot.org/configuration_manual/mail_location/Maildir/
On 14/11/2021 12.52, list.kwb@e.mail.de wrote:
Am 14.11.21 um 12:44 schrieb Carlos E. R.:
On 14/11/2021 03.23, Masaru Nomiya wrote: My alpine can read those folders directly, but my dovecot can not read them because it expects an mbox structure.
my dovecot can¹.
¹ https://doc.dovecot.org/configuration_manual/mail_location/Maildir/
I am aware. But my current dovecot structure is mbox, I have hundreds of mbox folders. Having *one* maildir folder inside a large mbox folder does not work. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <14afefe1-3938-d7bb-4777-e89d4fbfaafe@telefonica.net> Date & Time: Sun, 14 Nov 2021 12:44:58 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> My alpine can read those folders directly, but my dovecot can not read CER> them because it expects an mbox structure. Did you use the peculiar dovecot? The ordinay dovecot can treat mbox format, Maildir format, and dbox format. Moreover, you wrote; In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <4d1e7754-b93c-6e43-5b4e-515776716ccb@telefonica.net> Date & Time: Sun, 14 Nov 2021 01:42:17 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> He is using maildir. I want mbox. [...] Are you sure? Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 14/11/2021 13.06, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <14afefe1-3938-d7bb-4777-e89d4fbfaafe@telefonica.net> Date & Time: Sun, 14 Nov 2021 12:44:58 +0100
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> My alpine can read those folders directly, but my dovecot can not read CER> them because it expects an mbox structure.
Did you use the peculiar dovecot?
The ordinay dovecot can treat mbox format, Maildir format, and dbox format.
I am aware. See my other answer to Wilhelm.
Moreover, you wrote;
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <4d1e7754-b93c-6e43-5b4e-515776716ccb@telefonica.net> Date & Time: Sun, 14 Nov 2021 01:42:17 +0100
[CER] == "Carlos E. R." <robin.listas@telefonica.net> has written:
[...] CER> He is using maildir. I want mbox. [...]
Are you sure?
Absolutely. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 14.11.2021 00:20, Carlos E. R. wrote: ...
cer@minas-tirith:~> cat /home/cer/.fetchmail_TLtmp/.fetchmailrc ... mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" cer@minas-tirith:~>
...
cer@minas-tirith:~> cat .procmailrc_TLtmp
...
# testing. :0 $HOME/Mail/alpine_r_tl_tmp
...
But look at the format, it is wrong, mail programs can not use it:
...
The first line:
From MAILER-DAEMON Sat Nov 13 21:08:23 2021
is the key, it separates one mail from the other. It is missing in the file newly generated by procmail.
Either use procmail -f - ... when invoking procmail or use | formail >> $HOME/.procmailrc_TLtmp in procmail recipe. Read procmail man page for meaning of "-f".
Hello, In the Message; Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <5392f10e-419f-684e-4340-9e9469d46846@gmail.com> Date & Time: Sun, 14 Nov 2021 12:25:44 +0300 [AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written: AB> On 14.11.2021 00:20, Carlos E. R. wrote: AB> ... AB> > cer@minas-tirith:~> cat /home/cer/.fetchmail_TLtmp/.fetchmailrc AB> ... AB> > mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" AB> > cer@minas-tirith:~> AB> > AB> ... AB> > AB> > cer@minas-tirith:~> cat .procmailrc_TLtmp AB> ... AB> > AB> > # testing. AB> > :0 AB> > $HOME/Mail/alpine_r_tl_tmp AB> > AB> ... AB> > AB> > But look at the format, it is wrong, mail programs can not use it: AB> ... AB> > AB> > The first line: AB> > AB> > From MAILER-DAEMON Sat Nov 13 21:08:23 2021 AB> > AB> > AB> > is the key, it separates one mail from the other. It is missing in the AB> > file newly generated by procmail. AB> Either use AB> procmail -f - ... AB> when invoking procmail or use AB> | formail >> $HOME/.procmailrc_TLtmp AB> in procmail recipe. Read procmail man page for meaning of "-f". That't it! If he changes .procmailrc_TLtmp to .procmailrc, he can use the proper script; mda "/usr/bin/procmail" Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Tim Cook, the C.E.O. of Apple, said earlier this year that he would not let his nephew join social networks. Bill Gates banned cellphone until his children were teenagers, and Melinda Gates wrote that she wished they had waited even longer. Steve Jobs would not let his young children near iPads." -- The New York Times --
On 14/11/2021 11.23, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] fetchmail-procmail problem Message-ID : <5392f10e-419f-684e-4340-9e9469d46846@gmail.com> Date & Time: Sun, 14 Nov 2021 12:25:44 +0300
[AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written:
AB> On 14.11.2021 00:20, Carlos E. R. wrote: AB> ... AB> > cer@minas-tirith:~> cat /home/cer/.fetchmail_TLtmp/.fetchmailrc AB> ... AB> > mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" AB> > cer@minas-tirith:~> AB> > AB> ... AB> > AB> > cer@minas-tirith:~> cat .procmailrc_TLtmp AB> ... AB> > AB> > # testing. AB> > :0 AB> > $HOME/Mail/alpine_r_tl_tmp AB> > AB> ... AB> > AB> > But look at the format, it is wrong, mail programs can not use it: AB> ... AB> > AB> > The first line: AB> > AB> > From MAILER-DAEMON Sat Nov 13 21:08:23 2021 AB> > AB> > AB> > is the key, it separates one mail from the other. It is missing in the AB> > file newly generated by procmail.
AB> Either use
AB> procmail -f - ...
AB> when invoking procmail or use
AB> | formail >> $HOME/.procmailrc_TLtmp
AB> in procmail recipe. Read procmail man page for meaning of "-f".
That't it!
If he changes .procmailrc_TLtmp to .procmailrc, he can use the proper script;
mda "/usr/bin/procmail"
No way. .procmailrc exists and serves a totally different sorting and clasification, that doesn't fit my purpose this time.
Thanks.
--- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Tim Cook, the C.E.O. of Apple, said earlier this year that he would not let his nephew join social networks. Bill Gates banned cellphone until his children were teenagers, and Melinda Gates wrote that she wished they had waited even longer. Steve Jobs would not let his young children near iPads." -- The New York Times --
-- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 14/11/2021 10.25, Andrei Borzenkov wrote:
On 14.11.2021 00:20, Carlos E. R. wrote: ...
cer@minas-tirith:~> cat /home/cer/.fetchmail_TLtmp/.fetchmailrc ... mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" cer@minas-tirith:~>
...
cer@minas-tirith:~> cat .procmailrc_TLtmp
...
# testing. :0 $HOME/Mail/alpine_r_tl_tmp
...
But look at the format, it is wrong, mail programs can not use it:
...
The first line:
From MAILER-DAEMON Sat Nov 13 21:08:23 2021
is the key, it separates one mail from the other. It is missing in the file newly generated by procmail.
Either use
procmail -f - ...
when invoking procmail or use
mda "/usr/bin/procmail -f cer -m $HOME/.procmailrc_TLtmp" [...] Works! Folder starts: From cer Sun Nov 14 13:06:25 2021 Return-Path: <linux-xfs-owner@vger.kernel.org> Delivered-To: robin.listas@telefonica.net Received: from imap.telefonica.net [86.109.99.71] by minas-...
| formail >> $HOME/.procmailrc_TLtmp
in procmail recipe.
Let me see, that would be: # testing. :0 | formail >> $HOME/Mail/alpine_r_tl_tmp [...] Works! File starts: From linux-xfs-owner@vger.kernel.org Sun Nov 14 12:59:10 2021 Return-Path: <linux-xfs-owner@vger.kernel.org> Delivered-To: robin.listas@telefonica.net Received: from imap.telefonica.net [86.109.99.71] by minas-... Comparing to another older folder: From cer@Telcontar.valinor Fri Aug 28 23:28:22 2020 Return-Path: <linux-xfs-owner@vger.kernel.org> 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 <robin.listas@telefonica.net>; Fri, 28 Aug 2020 23:28:22 +0200
Read procmail man page for meaning of "-f".
Thanks. Both methods work :-) -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 14/11/2021 13.12, Carlos E. R. wrote:
On 14/11/2021 10.25, Andrei Borzenkov wrote:
On 14.11.2021 00:20, Carlos E. R. wrote: ...
There are three methods. Method 1 fetchmail: mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" procmail: : 0 $HOME/Mail/alpine_r_tl_tmp/ Results in a maildir structure, which I can read with alpine, but not with the _existing_ dovecot, because the rest of the hundred folders are mbox. I could accept this, though. Method 2 fetchmail: mda "/usr/bin/procmail -m $HOME/.procmailrc_TLtmp" procmail: : 0 | formail >> $HOME/Mail/alpine_r_tl_tmp Or Method 3: fetchmail: mda "/usr/bin/procmail -f cer -m $HOME/.procmailrc_TLtmp" procmail: $HOME/Mail/alpine_r_tl_tmp Methods 2 and 3 produce the wanted mbox structure. Perhaps method 3 might be a bit faster to run, not involving a third program. Maybe safer because of locking, unsure. Thanks everybody, but Andrei Borzenkov nailed the answer :-) -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On Sat, 13 Nov 2021 22:20:15 +0100 (CET) "Carlos E. R." <robin.listas@telefonica.net> wrote:
I'm trying to fetch mail from an imap folder at my ISP, and put it on a local folder; no sorting, no filtering. But I am having a problem: the result is not an mbox file. I have not seen this before. [snip]
This thread seems to be running forever. I don't know much about mail systems but it appears you can do whatever you want except the result is maildir instead of mbox? And also you use dovecot? So why not use dovecot's instructions to convert the maildir to mbox? See https://wiki.dovecot.org/Migration/MailFormat "Converting from Maildir to mbox".
On 14/11/2021 12.52, Dave Howorth wrote:
On Sat, 13 Nov 2021 22:20:15 +0100 (CET) "Carlos E. R." <robin.listas@telefonica.net> wrote:
I'm trying to fetch mail from an imap folder at my ISP, and put it on a local folder; no sorting, no filtering. But I am having a problem: the result is not an mbox file. I have not seen this before. [snip]
This thread seems to be running forever. I don't know much about mail systems but it appears you can do whatever you want except the result is maildir instead of mbox?
Yes. See the [solved] post.
And also you use dovecot?
So why not use dovecot's instructions to convert the maildir to mbox? See https://wiki.dovecot.org/Migration/MailFormat "Converting from Maildir to mbox".
Oh, it is far easier than that. I just have to copy the mails from the single maildir folder to any other folder, using Alpine. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
participants (9)
-
Andrei Borzenkov
-
Bob Rogers
-
Carlos E. R.
-
Carlos E.R.
-
Dave Howorth
-
list.kwb@e.mail.de
-
Masaru Nomiya
-
Patrick Shanahan
-
Yamaban