Gnus development mailing list
 help / color / mirror / Atom feed
* how to sort (filter) msg which contain MS word documents
@ 2008-04-14  9:51 Uwe Brauer
  2008-04-14 20:34 ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Brauer @ 2008-04-14  9:51 UTC (permalink / raw)
  To: ding

Hello


I would like to sort my messages in a given group such that the
message which contain attachments of word documents are separated form
the rest. I know that for new message I could use the gnus-splitting
group and specify the 
content type like:
    ("Content-type" "application/msword" "DOC")

But what can I do for other groups?

thanks

Uwe Brauer 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-14  9:51 how to sort (filter) msg which contain MS word documents Uwe Brauer
@ 2008-04-14 20:34 ` Reiner Steib
  2008-04-24 14:48   ` Uwe Brauer
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2008-04-14 20:34 UTC (permalink / raw)
  To: ding

On Mon, Apr 14 2008, Uwe Brauer wrote:

> I would like to sort my messages in a given group such that the
> message which contain attachments of word documents are separated form
> the rest. I know that for new message I could use the gnus-splitting
> group and specify the 
> content type like:
>     ("Content-type" "application/msword" "DOC")

Does this actually work?  I think that nnmail-split-methods only apply
to the headers...

,----[ (info "(gnus)Splitting Mail") ]
| The `nnmail-split-methods' variable says how the incoming mail is to be
| split into groups.
| [...]
|    [...], and the second element is
| a regular expression used on the header of each mail to determine if it
| belongs in this mail group. [...]
| 
|    The second element can also be a function.  In that case, it will be
| called narrowed to the headers with the first element of the rule as the
| argument.  [...]
`----

... an for "Content-type: multipart/mixed message", the Content-type
of the sub-part (application/msword) is in the body.

> But what can I do for other groups?

Maybe...

,----[ (info "(gnus)Mail Group Commands") ]
|    If you move (or copy) articles regularly, you might wish to have Gnus
| suggest where to put the articles.  `gnus-move-split-methods' is a
| variable that uses the same syntax as `gnus-split-methods' (*note
| Saving Articles::).
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-14 20:34 ` Reiner Steib
@ 2008-04-24 14:48   ` Uwe Brauer
  2008-04-24 18:43     ` Reiner Steib
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Brauer @ 2008-04-24 14:48 UTC (permalink / raw)
  To: ding

>>>>> "Reiner" == Reiner Steib <reinersteib+gmane@imap.cc> writes:

   > On Mon, Apr 14 2008, Uwe Brauer wrote:
   >> I would like to sort my messages in a given group such that the
   >> message which contain attachments of word documents are separated form
   >> the rest. I know that for new message I could use the gnus-splitting
   >> group and specify the 
   >> content type like:
   >> ("Content-type" "application/msword" "DOC")

   > Does this actually work?  I think that nnmail-split-methods only apply
   > to the headers...


You are right! So there is no way to split DOC attachments?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-24 14:48   ` Uwe Brauer
@ 2008-04-24 18:43     ` Reiner Steib
  2008-04-25 10:40       ` Uwe Brauer
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2008-04-24 18:43 UTC (permalink / raw)
  To: ding

On Thu, Apr 24 2008, Uwe Brauer wrote:

>>>>>> "Reiner" == Reiner Steib <reinersteib+gmane@imap.cc> writes:
>    > On Mon, Apr 14 2008, Uwe Brauer wrote:
>    >> I know that for new message I could use the gnus-splitting
>    >> group and specify the content type like: ("Content-type"
>    >> "application/msword" "DOC")
>
>    > Does this actually work?  I think that nnmail-split-methods only apply
>    > to the headers...
>
> You are right! So there is no way to split DOC attachments?

You need to widen the buffer during the splitting and search for
application/msword.  There's an example in (info "(gnus)Fancy Mail
Splitting") from where you can start:

,----[ (info "(gnus)Fancy Mail Splitting") ]
| `(: FUNCTION ARG1 ARG2 ...)'
|      If the split is a list, and the first element is `:', then the
|      second element will be called as a function with ARGS given as
|      arguments.  The function should return a SPLIT.
| 
|      For instance, the following function could be used to split based
|      on the body of the messages:
| 
|           (defun split-on-body ()
|             (save-excursion
|               (save-restriction
|                 (widen)
|                 (goto-char (point-min))
|                 (when (re-search-forward "Some.*string" nil t)
|                   "string.group"))))
| 
|      The buffer is narrowed to the header of the message in question
|      when FUNCTION is run.  That's why `(widen)' needs to be called
|      after `save-excursion' and `save-restriction' in the example
|      above.  Also note that with the nnimap backend, message bodies will
|      not be downloaded by default.  You need to set
|      `nnimap-split-download-body' to `t' to do that (*note Splitting in
|      IMAP::).
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-24 18:43     ` Reiner Steib
@ 2008-04-25 10:40       ` Uwe Brauer
  2008-04-25 16:17         ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Brauer @ 2008-04-25 10:40 UTC (permalink / raw)
  To: ding

>>>>> "Reiner" == Reiner Steib <reinersteib+gmane@imap.cc> writes:

   >> 
   >> You are right! So there is no way to split DOC attachments?

   > You need to widen the buffer during the splitting and search for
   > application/msword.  There's an example in (info "(gnus)Fancy Mail
   > Splitting") from where you can start:


Thanks!
   > ,----[ (info "(gnus)Fancy Mail Splitting") ]
   > | `(: FUNCTION ARG1 ARG2 ...)'
   > |      If the split is a list, and the first element is `:', then the
   > |      second element will be called as a function with ARGS given as
   > |      arguments.  The function should return a SPLIT.
   > | 
   > |      For instance, the following function could be used to split based
   > |      on the body of the messages:
   > | 
   > |           (defun split-on-body ()
   > |             (save-excursion
   > |               (save-restriction
   > |                 (widen)
   > |                 (goto-char (point-min))
   > |                 (when (re-search-forward "Some.*string" nil t)
   > |                   "string.group"))))
   > | 
   > |      The buffer is narrowed to the header of the message in question
   > |      when FUNCTION is run.  That's why `(widen)' needs to be called
   > |      after `save-excursion' and `save-restriction' in the example
   > |      above.  Also note that with the nnimap backend, message bodies will
   > |      not be downloaded by default.  You need to set
   > |      `nnimap-split-download-body' to `t' to do that (*note Splitting in
   > |      IMAP::).
The problem is that I have to set nnimap-split-download-body to t, and
that will slow down the downloaded considerably which is slow enough.

I tried out,

(gnus-summary-limit-to-bodies "application/msword" nil)
in a given group and that seems to work ok.


Uwe 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-25 10:40       ` Uwe Brauer
@ 2008-04-25 16:17         ` Ted Zlatanov
  2008-04-25 17:22           ` Uwe Brauer
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-04-25 16:17 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: ding

On Fri, 25 Apr 2008 12:40:40 +0200 Uwe Brauer <oub@mat.ucm.es> wrote: 

UB> The problem is that I have to set nnimap-split-download-body to t,
UB> and that will slow down the downloaded considerably which is slow
UB> enough.

If you have control over mail delivery (e.g. procmail) you can insert a
header in the message if there's a particular pattern within it, and
then split based on that header.

I wonder if IMAP has a way to check quickly if an article has a
particular attachment.  That would be nice too, just ask the server.

Ted



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-25 16:17         ` Ted Zlatanov
@ 2008-04-25 17:22           ` Uwe Brauer
  2008-04-25 18:47             ` Ted Zlatanov
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Brauer @ 2008-04-25 17:22 UTC (permalink / raw)
  To: ding

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:


   > If you have control over mail delivery (e.g. procmail) you can
   > insert a header in the message if there's a particular pattern
   > within it, and then split based on that header.

I have not!

   > I wonder if IMAP has a way to check quickly if an article has a
   > particular attachment.  That would be nice too, just ask the
   > server.

How to find out?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-25 17:22           ` Uwe Brauer
@ 2008-04-25 18:47             ` Ted Zlatanov
  2008-04-25 21:01               ` James Cloos
  0 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2008-04-25 18:47 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: ding, Simon Josefsson

On Fri, 25 Apr 2008 19:22:35 +0200 Uwe Brauer <oub@mat.ucm.es> wrote: 

>>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

>> I wonder if IMAP has a way to check quickly if an article has a
>> particular attachment.  That would be nice too, just ask the
>> server.

UB> How to find out?

Look at the IMAP RFCs, which I found hard to understand.  Maybe Simon
can answer this with a yes/no and if yes, I can dig further.

Simon: "particular" means a particular type, we don't care about the
name (but it would be nice to get as much information as possible for
splitting rules, including name and size besides MIME type).

Ted



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to sort (filter) msg which contain MS word documents
  2008-04-25 18:47             ` Ted Zlatanov
@ 2008-04-25 21:01               ` James Cloos
  0 siblings, 0 replies; 9+ messages in thread
From: James Cloos @ 2008-04-25 21:01 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: Uwe Brauer, ding, Simon Josefsson

>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

>>> I wonder if IMAP has a way to check quickly if an article has a
>>> particular attachment.  That would be nice too, just ask the
>>> server.

The sexp imapd returns on the FETCH BODY which nnimap issues when
opening the *Summary* buffer contains all of the MIME data for each
FETCHed article.

FETCH BODYSTRUCTURE is similar and may provide more data.

I don't see any way of searching for all articles which match a given
mime type.  You can SEARCH for any string, but there will, of course, be
false positives.  So I suppose you'd have to SEARCH for the mime type as
a string and use FETCH BODY calls to rule out the false positives.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-25 21:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-14  9:51 how to sort (filter) msg which contain MS word documents Uwe Brauer
2008-04-14 20:34 ` Reiner Steib
2008-04-24 14:48   ` Uwe Brauer
2008-04-24 18:43     ` Reiner Steib
2008-04-25 10:40       ` Uwe Brauer
2008-04-25 16:17         ` Ted Zlatanov
2008-04-25 17:22           ` Uwe Brauer
2008-04-25 18:47             ` Ted Zlatanov
2008-04-25 21:01               ` James Cloos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).