procmail
[Top] [All Lists]

A workaround for Netscape append-to-file deficiencies

1996-08-08 21:52:16
I am a procmail newbie; therefore, I apologize in advance for any errors
I may make (please let me know -- be nice).  

Based on helpful hints provided by Alan Stebbens (stebbens(_at_)sgi(_dot_)com) 
in
his recent procmail(_at_)Informatik(_dot_)* message titled "Help: running a C 
program
when mail arrives", I wrote the following recipe to solve a Netscape 
Navigator deficiency.

Netscape Navigator is incapable of appending to files.

This procmail recipe, in my tests, worked around that deficiency. 

Instead of a user pressing Netscape's [File][Save As...] menu, they
simply press [File][Mail Document].

Can someone critique this recipe or help with enhancements?

          +-------------------------------------------------+
          | # Netscape Navigator append-to-file workaround. |
          | :0Hb                                            |
          | * From.*jjg                                     |
          | * ^TOjjg                                        |
          | * X-URL:.*http                                  |
          | * ! ^Subject: *Re:                              |
          | /tmp/foo.txt                                    |
          +-------------------------------------------------+

I'd like to provide it to our internal Cadence users and then, to external 
users on "comp.infosystems.www.browsers.x" for their benefit. 

Thanks,
John Gianni
Cadence Design Systems, Inc, (software for design of chips/boards)
http://www.cadence.com    comp.cad.cadence

-------< READ ON ONLY if you desire more detailed information >---------

==============================================================================
SUMMARY:
  Enclosed is a simple procmail recipe that works around the well-known
  Netscape Navigator append-to-files deficiency.
==============================================================================
Problem:
  A typical USENET search will yield multiple documents, some of which one
  may wish to save to a compendium file.

  For example:
      1) Point your web browser to http://www.dejanews.com/forms/dnq.html
      2) Search for any topic in the world, e.g., "foo"
         This will quickly reveal all relevant articles posted to USENET
         newsgroups containing the word "foo".
      3) Click on various articles, decide which to save, and then try to
         save any article using Netscape's [File][Save As...] pulldown menu.

           Choose [Text] and select any name, e.g.,  "/tmp/foo.txt"
           (or, keep the default name of "/tmp/getdoc.xp".

           Then, try to append any other article into that compendium.

           When you enter the same name, Netscape Navigator will only provide 
           the option of "overwrite" or "cancel". 

           Amazingly, there is no "append" in Netscape Navigator.

  Therefore, Netscape Navigator (any version, any platform) is incapable 
  itself of creating a relevant compendium file on the topic "foo".

  Netscape Navigator (any version, any platform) can only create new files, 
  or overwrite an existing file when the user selects the [File][Save As...]
  pulldown menu.
==============================================================================
Simple Solution:

  After running internet searches, instead of pressing on [File][Save As...], 
  the user selects [File][Mail Document] or [File][New Mail Message], and
  mails the document to himself.

  The file will never make it to the mail spool file; instead, the header is
  stripped off (it is not needed) and the body is immediately appended to the 
  desired compendium file (which is automatically created if it doesn't exist).
 
  The user never sees the mail message in his mail user agent; all that
  is done is that a compendium file is automatically created. 
==============================================================================
Procmail recipe:

  Simply place this procmail recipe in your procmail $INCLUDERC file:
==============================================================================
  # Netscape Navigator append-to-file workaround.
  :0Hb
  * From.*jjg
  * ^TOjjg
  * X-URL:.*http
  * ! ^Subject: *Re:
  /tmp/foo.txt
  #     :0                 -Begin a recipe;
  #     b                  -Save only the body (strip off the email header),
  #     H                  -but egrep the email header (default) in order to,
  #     * From.*jjg        -catch all messages from "jjg",
  #     * ^TOjjg           -to "jjg",
  #     * X-URL:.*http     -with an "X-URL:" header line containing "http",
  #     * ! ^Subject: *Re: -but not a reply to any of those messages,
  #     /tmp/foo.txt       -and append the results to /tmp/foo.txt.
  # Note: The "X-URL:" is in the header of all messages from Netscape Navigator 
  #       that are sent via either the [File][Mail Document] or the 
  #       [File][New Mail Message] menu selections.
  # Possible Enhancements:
  #   a) Run an HTML-to-text conversion for those files sent as HTML [Source].
  #   b) Add the capability to specify the file name to append to.
==============================================================================

<Prev in Thread] Current Thread [Next in Thread>
  • A workaround for Netscape append-to-file deficiencies, John Gianni <=