procmail
[Top] [All Lists]

AW: file saving

2001-12-04 05:49:12
hey,

thanks for your quick response but we get 
2 attached files where we do not know the filename, it differs each
time.


i'd need to write both files down to disk. would be nice if you can
gimme more detailed
information on the complex variants for saving my files to the disk.

-andy

-----Ursprüngliche Nachricht-----
Von: procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE] Im Auftrag von 
Gary Funck
Gesendet: Monday, December 03, 2001 6:09 PM
An: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Betreff: RE: file saving



Andreas asks:
Sent: Monday, December 03, 2001 12:11 AM

we are getting 2 files every 3 week to an existing
email address, and i dont know how to configure
procmail so i can save those to files automatically
to system disk. the file that are incoming are acsii
files.

There are many ways this can be done.  Some simple, some complex. Your
approach may depend upon whether you'll settle for just saving the
entire e-mail message as it came in (simple) or whether you want to
extract and save one/more file attachments in the message (more
complex).  You may settle for simply having a unique file name generated
for each message as it is delivered/saved (simple) or you may want to
construct the saved filename from information found in the message
itself (more complex).

Here's something simple, using procmail's delivery to directory facility
outlined in the "procmailrc" man page:

          Anything else will be taken as  a  mailbox  name  (either  a
          filename or a directory, absolute or relative to the current
          directory  (see  MAILDIR)).   If  it  is  a  (possibly   yet
          nonexistent) filename, the mail will be appended to it.

          If it is a directory, the mail will be delivered to a  newly
          created,  guaranteed  to be unique file named $MSGPREFIX* in
          the specified directory.  If  the  directory  name  ends  in
          "/.",  then  this  directory is presumed to be an MH folder;
          i.e. procmail will use the next number it  finds  available.
          When  procmail is delivering to directories, you can specify
          multiple directories to deliver  to  (procmail  will  do  so
          utilising hardlinks).


Using the directoy-level save capability, and letting procmail choose
the next message number, the recipe looks like this:

#
# Look for something in the mail header that tells us that it contains a
# message to be saved.  Here, we look for "bi-weekly data release" in
the # subject, and that the mail is from "data-server(_at_)bluesky(_dot_)com".
This is just # an example.  The choice of filter criteria is up to you.
# # If the criteria matches, the mail message is saved under the
directory # named "bluesky_data". The file name used is derived as the
next available # number, taken from the list of already existing files.
#
:0:
* ^Subject:.*bi-weekly data release
* ^From:(_dot_)*data-server(_at_)bluesky(_dot_)com
bluesky_data/.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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