|Tue 1998-11-10 Jesus Gonzalez <joliden(_at_)cedetel(_dot_)com(_dot_)mx>
list.procmail
|
|
| I want to know if it possible to extract the file name of an attachement
| appended to an incoming e-mail, and then assign it to a variable.
For MIME, it's fairly simple.
RC_MIME = $PMSRC/pm-jamime.rc # See X-info's mail server and pm-code.shar
...
INCLUDERC = $RC_MIME
--> It will return values
o MIME_H_ATTACHEMENT, contains the filename if there was attachement
filename in the header. Content-Disposition: attachment;
filename="..."
o MIME_B_ATTACHEMENT. `body' file attachement. Note however that
this is the match of first string in the body. There may be
several attachements. MIME_B_ATTACHEMENT_FILE_COUNT tells you
how many filenames are in the body.
But this ONLY FOR Messages that contain one attachement. You want to
check this variable too:
o MIME_BOUNDARY_COUNT is the number of boundary strings found
from the body. The value is 3 if there is two mime sections,
and 4 if 3 etc. MIME_BOUNDARY_COUNT -1 = count of sections.
Nothing bulletproof here. For MIME handling in general I suggest looking
at metamail package or Perl packages that know the structure of mime.
jari