Thread View: news.software.readers
3 messages
3 total messages
Started by Robert Nicholson
Fri, 18 Mar 1994 22:32
Trn elm suggestion. mbox.saver hack.
Author: Robert Nicholson
Date: Fri, 18 Mar 1994 22:32
Date: Fri, 18 Mar 1994 22:32
38 lines
1937 bytes
1937 bytes
I archive my news in unix mail folders from trn using the macro.
:S) %(%m=[ap]?s ~/Mail/%C
Now that I've changed elm so that it supports 'N' status I thought I'd
share this with you.
If I save a message to a folder, specifically a news folder then I
don't want to regard that message as New.
So I've changed things a bit.
In mbox.saver...
/usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /"
I changed this line to
/usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /" | /usr/local/bin/formail -a "Status: RO"
formail is a utility that comes with the excellent procmail mail
filtering package. One of the many things it allows me to do is add a
custom header to a message.
If you have a sed rule to do this I'd like to hear it, just for the sake of
it. I'm ok with substitutions but the man page doesn't realy help
when you want to add text to an input stream in a specific location.
I assume it's something like
sed '/^\n/aStatus: RO/' or something like that I'm no good with
double barrel sed lines.
--
"You know what's wrong with you?" (Audrey Hepburn, Cary Grant)
"No, what?"
"Nothing" (Charade, 1963)
(ASCII for text only messages)
Re: Trn elm suggestion. mbox.saver hack.
Author: David W. Tamkin
Date: Fri, 18 Mar 1994 23:17
Date: Fri, 18 Mar 1994 23:17
31 lines
2024 bytes
2024 bytes
robert@steffi.demon.co.uk (Robert Nicholson) wrote in
<2mda5g$v2@steffi.demon.co.uk>:
| I changed this line to
|
| /usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /" | /usr/local/bin/formail -a "Status: RO"
Do you really want to lose the "From " from the first line? formail can
re-create a From_ header but it will preserve the original one if given one.
/bin/sed '/^$/,$ s/^From />&/' | /usr/local/bin/formail -I "Status: RO"
[I should think you'd want to force RO Status even if a Status: header
already exists, hence -I instead of -a.]
| If you have a sed rule to do this I'd like to hear it, just for the sake of
| it. I'm ok with substitutions but the man page doesn't realy help
| when you want to add text to an input stream in a specific location.
Getting the job done right with sed is complicated; I've been burned too many
times by posting answers to sed questions and then getting flamed by people
who copy them wrong and blame me for posting lies.
sed can do it, but it seems to me that the only reason you're calling sed
is to defuse body lines beginning with "From ". formail should do that if
you don't use its -b flag to suppress the behavior. Ergo
/usr/local/bin/formail -I "Status: RO"
ought to be enough.
Re: Trn elm suggestion. mbox.saver hack.
Author: Robert Nicholson
Date: Sat, 19 Mar 1994 10:11
Date: Sat, 19 Mar 1994 10:11
48 lines
2603 bytes
2603 bytes
dattier@MCS.COM (David W. Tamkin) wrote in comp.mail.elm,news.software.readers
>robert@steffi.demon.co.uk (Robert Nicholson) wrote in
><2mda5g$v2@steffi.demon.co.uk>:
>
>| I changed this line to
>|
>| /usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /" | /usr/local/bin/formail -a "Status: RO"
>
>Do you really want to lose the "From " from the first line? formail can
>re-create a From_ header but it will preserve the original one if given one.
Well the first From_ doesn't actually exist yet.. since trn adds it
later. So that's not a problem.
>
>/bin/sed '/^$/,$ s/^From />&/' | /usr/local/bin/formail -I "Status: RO"
>
>[I should think you'd want to force RO Status even if a Status: header
> already exists, hence -I instead of -a.]
When would the status header already exist though.. It's an Elm
concept. I'll adopt -I just in case though.
>
>| If you have a sed rule to do this I'd like to hear it, just for the sake of
>| it. I'm ok with substitutions but the man page doesn't realy help
>| when you want to add text to an input stream in a specific location.
>
>Getting the job done right with sed is complicated; I've been burned too many
>times by posting answers to sed questions and then getting flamed by people
>who copy them wrong and blame me for posting lies.
>
>sed can do it, but it seems to me that the only reason you're calling sed
>is to defuse body lines beginning with "From ". formail should do that if
>you don't use its -b flag to suppress the behavior. Ergo
>
> /usr/local/bin/formail -I "Status: RO"
>
>ought to be enough.
Yes it is.
--
"You know what's wrong with you?" (Audrey Hepburn, Cary Grant)
"No, what?"
"Nothing" (Charade, 1963)
(ASCII for text only messages)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads