procmail
[Top] [All Lists]

Re: splitting copies of my accepted posts

1996-08-08 11:29:50
Timothy Luoma asked,

| The NeXT newsgroups can be accessed by email, which is the way I
| normally post to them, because they send a confirmation of posting.
| The confirmation is a message saying that my message was posted
| without any errors, and then quotes the message for me in its
| entirety.
|
| What I would like to do is take these confirmations and put a copy
| of my post (not the message) into a mailbox.
|
| I've tried splitting the mailbox like this:
|
| cat posts | formail +1 -des >> newposts
|
| which splits each message into two, but I don't want the first part
| of the message.

Does the file "posts" contain a number of these confirmations?  Then
what you have there will remove the top of the first one, keep your own
article returned inside the first one, and keep both the return information
and your own text of every other confirmation in the "posts" file.

So if I understand correctly, you want to split the "posts" folder with
formail -s back into individual confirmations, and split each of those with
formail -ds back into the return commentary and your own post, and then throw
out the return commentary and keep your own article, reshaped into mail
format with its own From_ line?  OK ...

 formail -s formail +1 -des < posts >> newposts

| Right now I am matching these messages like this:
|
| :0
| *^Sender: uucp(_at_)antigone(_dot_)com
| *^Subject: Your submission to *

The trailing asterisk does no good and wastes effort.  Remember that we're
working with regular expressions, not with shell globbing patterns.

| {
|       :0BD
|       *Your article, enclosed below, was successfully submitted
| to comp.sys.next.*
|       |appnmail Computer-Stuff/UsenetPosts
| }

  :0
  * ^Sender: uucp(_at_)antigone\(_dot_)com
  * ^Subject: Your submission to
  { # to make `D' flag apply to only one condition, we separate it
   :0BD:
   * Your article, enclosed below, was successfully
   | formail +1 -des >> newposts
  }

will work for individual acknowledgments being fed to procmail.  Also, I
think you could give up the `D' flag and do it in a simple recipe with no
braces (if your version of procmail is recent enough for this syntax):

  :0:
  * ^Sender: uucp(_at_)antigone\(_dot_)com
  * ^Subject: Your submission to
  * B ?? Your article, enclosed below, was successfully
  | formail +1 -des >> newposts

| A rejected message would begin:
|
| "Your article, enclosed below, was NOT submitted to"
|
| and that should end up in $DEFAULT (which it does now)

That won't change, but for rejected messages, did you want to save only the
second part as with successful posts, or did you want to save the entire
confirmation?

<Prev in Thread] Current Thread [Next in Thread>