procmail
[Top] [All Lists]

Re: metamail retrieve the attachment but name it with another name

2005-03-04 05:35:41
On Fri, Mar 04, 2005 at 05:44:30AM -0500, moi el hachmi wrote:

|(mkdir -p $D&&METAMAIL_TMPDIR=$D /usr/bin/metamail -r
-y -w -q -x 2>/dev/null)

This command retrieve 2 files, but any of those files
has the name of the original attached file
for example it retrieve 2 files: 
mm.hOLNtJ(attached image) and mm.WgCO4n(body)
instead of : 
warning.jpg and mm.WgCO4n 

so anyone knows how to retieve the attached files with their
exact names?

This seems to me to be a metamail issue and not a procmail issue.
Although one could find the filename in procmail and save it to
a var for feeding to metamail, that seems not to be required;
that is, metamail seems tweakable.  I skimmed the man pages
and saw this (note that you are already using the w-flag,
but you may be able to fine-tune your use):

   -w      This option tells metamail that instead of consulting a mailcap
           file to decide how to display the data, it should simply decode
           each  part  and write it to a file in its raw (possibly binary)
           format.  Depending on the circumstances in which it is  called,
           metamail may derive the file name to use from the message head-
           ers, by asking the user, or by generating  a  unique  temporary
           file name.

There are also other programs one could use instead of metamail,
that might be more flexible for you in this regard.  One I like is
reformime, part of the courier mail package.

-- 
dman


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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