bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: decode in mail


From: Alain Magloire
Subject: Re: decode in mail
Date: Thu, 26 Jul 2001 20:11:19 -0400 (EDT)

> 
> > An did a very quick and dirty implementation.
> > But any idea How handle mime, attachements etc ... ?
> 
> The first idea that comes to mind is the ability to store message
> parts in files, like this:
> 
>       decode MSG-NO PART [OUT-FILE]
> 
> Afterwards one would be able to view the part with an appropriate
> program..
> 
> Maybe we can also keep some kind of association table, for example:
> 
>       Content-Type        Program
>       ------------------    -------
>       application/x-gzip    gzip -d
>       text/html                   lynx
>       text/plain          <internal>
>       etc...
> 
> then, when one issues a  command like `decode 1 2' and there is an
> entry corresponding to the content-type of part 2, then the part 2
> is stored in a temporary file and the program listed in the entry is
> started with the filename as its argument. 

While attempting to implement the ideas exchange. I found this
note in util.c(util_expand_msglist) from Jakob:

 else if (strchr (argv[i], '[') != NULL)
        {
          /* attachments - GNU extension */
          /*
           * This is a general extension to the msglist format. Basicallay,
           * it adds C-like array subscripting to msg numbers to allow access
           * to just a single part of a MIME multipart message. I.e.:
           * print 7[1],8[1-2]
           * should print the first attachment of message 7 and the first
           * and second attachments of message 8. The format inside the
           * brackets is the same as a msglist, so we should be able to
           * reuse this function for its expansion. This will primarily
           * be used by the new decode command, which needs discussion on
           * the mailing list to nail its syntax down (should it default to
           * saving to a file, printing to stdout, or piping?)
           * -- sparky
           */
        }
      else

It is a good idea but to be able to do this the way msglist is expand
will have to be change to return a structure:

struct {
 int msgno;
 int partno;
}

Comments?

--
alain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]