You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Paul Griffith <pa...@cse.yorku.ca> on 2007/12/05 15:59:36 UTC

SpamAssassin and LaTeX

Greetings SA users,

I have been looking for any hints or suggestions on tweaking SA when it  
comes to handling  LaTeX files, but I can't find anything. Does anyone has  
any suggestions ? Usually the problem happens when a e-mail client places  
the text .tex file inline the e-mail/


I guess I could write rules that verify a valid .tex and .bib document and  
then assign a minus score, it would be better if e-mail clients actually  
send attachments as true attachments.


A .tex file example:
\documentclass[12pt]{article}
\title{\LaTeX}
\date{}
\begin{document}
   \maketitle \LaTeX{} is a document preparation system for the \TeX{}
   typesetting program. It offers programmable desktop publishing
   features and extensive facilities for automating most aspects of
   typesetting and desktop publishing, including numbering and
   cross-referencing, tables and figures, page layout, bibliographies,
   and much more. \LaTeX{} was originally written in 1984 by Leslie
   Lamport and has become the dominant method for using \TeX; few
   people write in plain \TeX{} anymore. The current version is
   \LaTeXe.
   \newline
   % This is a comment, it is not shown in the final output.
   % The following shows a little of the typesetting power of LaTeX
   \begin{eqnarray}
     E = mc^2                              \\
     m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
   \end{eqnarray}
\end{document}

For more info on LaTEx see: http://en.wikipedia.org/wiki/LaTeX

Thanks
Paul
-- 
Paul Griffith |Dept. of Computer Science and Engineering
CSE Technical Team |4700 Keele Street, Toronto, ON, Canada M3J-1P3
paulg@cse.yorku.ca |CSE1003A|Tel: 416-736-2100 x70258|Fax: 416-736-5872

Re: SpamAssassin and LaTeX

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Wed, 2007-12-05 at 09:59 -0500, Paul Griffith wrote:
> Usually the problem happens when a e-mail client places  
> the text .tex file inline the e-mail/
                     ^^^^^^
> it would be better if e-mail clients actually  
> send attachments as true attachments.

What is a "true" attachment? I believe you are talking about
attachments, whose contents are not displayed [1] by default, right?
That would be "Content-Disposition: attached". As opposed to "inline"
rather than "attached" in the example above...

However, this is merely a suggestion for the receiving MUA, how to
handle and display the attachment by default. Both are actually the
same, with the only exception of the above mentioned disposition -- and
thus displaying the attachment.

Unless I am seriously mistaken, this doesn't make any difference to
SpamAssassin. It scans it anyway...


(Since you are getting a TeX attachment in expanded state by default,
the sending MUA seems to set inline disposition.)

  guenther


[1] in an expanded way, not talking about preview thumbnails

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: SpamAssassin and LaTeX

Posted by Paul Griffith <pa...@cse.yorku.ca>.
On Wed, 05 Dec 2007 21:33:49 -0500, Olivier Nicole <on...@cs.ait.ac.th> wrote:

> Hi
>
>> I guess I could write rules that verify a valid .tex and .bib document  
>> and
>> then assign a minus score,
>
> Except trying to run the document through LaTeX, I cannot see how you
> can realy verify the validity.

Let me rephrase that, I could write some rules that look for common  
markups that I expect to find in laTeX files. I could for example look for  
the an attachment signature and look for file LaTeX filename (.tex, .bib,  
.sty, etc..) and assign negative scores. Not what I call fun, but it might  
be able to help someone else.

---i.e-----
Content-Type: application/x-tex; name="color-package-demo.tex"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="color-package-demo.tex"

Oh the joy.....

>> it would be better if e-mail clients actually send attachments as
>> true attachments.
>
> That is really a matter of taste, when it is pure ascii, i prefer it
> inline myself :)
>
> Best regards,
>
> Olivier

Thanks Paul



-- 
Paul Griffith |Dept. of Computer Science and Engineering - York University
CSE Technical Team |4700 Keele Street, Toronto, ON, Canada M3J-1P3
paulg@cse.yorku.ca |CSE1003A|Tel: 416-736-2100 x70258|Fax: 416-736-5872

Re: SpamAssassin and LaTeX

Posted by Olivier Nicole <on...@cs.ait.ac.th>.
Hi

> I guess I could write rules that verify a valid .tex and .bib document and  
> then assign a minus score, 

Except trying to run the document through LaTeX, I cannot see how you
can realy verify the validity.

> it would be better if e-mail clients actually send attachments as
> true attachments.

That is really a matter of taste, when it is pure ascii, i prefer it
inline myself :)

Best regards,

Olivier

Re: SpamAssassin and LaTeX

Posted by Paul Griffith <pa...@cse.yorku.ca>.
On Wed, 05 Dec 2007 20:36:22 -0500, John D. Hardin <jh...@impsec.org>  
wrote:

> On Wed, 5 Dec 2007, Paul Griffith wrote:
>
>> I guess I could write rules that verify a valid .tex and .bib
>> document and then assign a minus score, it would be better if
>> e-mail clients actually send attachments as true attachments.
>
> Not too hard to do...
>
>> \title{\LaTeX}
>> \date{}
>> \begin{document}
>> \end{document}
>
> Take off some points for having all of those in the body.
>
> --
>  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
>  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
>  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
> -----------------------------------------------------------------------

I figure I would have end up writing some rules to handle this issue,  
LaTeX is used widely in our environment. I was just hoping ;-) someone had  
something out there already.

Thanks
Paul

-- 
Paul Griffith |Dept. of Computer Science and Engineering - York University
CSE Technical Team |4700 Keele Street, Toronto, ON, Canada M3J-1P3
paulg@cse.yorku.ca |CSE1003A|Tel: 416-736-2100 x70258|Fax: 416-736-5872

Re: SpamAssassin and LaTeX

Posted by "John D. Hardin" <jh...@impsec.org>.
On Wed, 5 Dec 2007, Paul Griffith wrote:

> I guess I could write rules that verify a valid .tex and .bib
> document and then assign a minus score, it would be better if
> e-mail clients actually send attachments as true attachments.

Not too hard to do...

> \title{\LaTeX}
> \date{}
> \begin{document}
> \end{document}

Take off some points for having all of those in the body.

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  We have to realize that people who run the government can and do
  change. Our society and laws must assume that bad people -
  criminals even - will run the government, at least part of the
  time.                                               -- John Gilmore
-----------------------------------------------------------------------
 10 days until Bill of Rights day