From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/3084 Path: news.gmane.org!not-for-mail From: Svend Tollak Munkejord Newsgroups: gmane.emacs.gnus.user Subject: Re: Can I split messages based on their size? Date: Wed, 15 Oct 2003 11:56:35 +0200 Organization: The Royal Society for Putting Things on Top of Other Things Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138669299 17569 80.91.229.2 (31 Jan 2006 01:01:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 01:01:39 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:31:40 2006 Original-Path: quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: bacchus.pvv.ntnu.no Original-X-Trace: quimby.gnus.org 1066211796 29450 129.241.210.178 (15 Oct 2003 09:56:36 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Wed, 15 Oct 2003 09:56:36 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (berkeley-unix) X-Face: (2vS>!nr@2"*^KO{^8A<,_lGWx3HpnuA1UCA5vbsLl|2fZAV\T'x(3E`4@UJ >_mn@3S(.`C]g9DoFSSNAB@hftp\f-b#!UjRVfG5e#~H*^RvP+:meH63245"^?Zs7S[dE(SL`cn Cancel-Lock: sha1:ZcanYWCP0WLULOs6afG5bDNAGkE= Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:3225 Original-Lines: 41 X-Gnus-Article-Number: 3225 Tue Jan 17 17:31:40 2006 Xref: news.gmane.org gmane.emacs.gnus.user:3084 Archived-At: I wrote: > On 2003-10-12, Jesper Harder wrote: > >> Svend Tollak Munkejord writes: >> >>> Using nnmail-split-fancy, can I somehow split messages based on >>> their size? My idea is that if they are sent to my "suspicious" >>> e-mail address, and if they are larger than, say, 100 kb, then they >>> are certainly spam. >> >> You can define your own function: >> >> (defun my-> (size group) >> (when (> (buffer-size) size) group)) > > Thanks -- this was elegant. However, it does not seem to take attachments > into account, and those were the ones I was particularly aiming for. Do I > need some further tricks? OK. I only tried "B t" (trace respool), and not actually to respool ("B r"). Respooling worked, and the complete message size seemed to be accounted for. With the following extension, "B t" worked as well (Gnus 5.10.2). (defun my-> (size group) "Return GROUP if message size is larger than SIZE." (save-excursion; necessary? (let ((buf (or (get-buffer nnmail-article-buffer); (" *nnmail incoming*") for email (get-buffer " *nnfolder move*"); for respool (get-buffer gnus-original-article-buffer)))); (" *Original Article*") for trace (B t), (if (not buf) (progn (message "Oops, cannot find message buffer") nil) (set-buffer buf) (when (> (buffer-size) size) group))))) Is it a semi-bug that I had to set the buffer this way? Regards, -- Svend Tollak Munkejord