You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by fe...@dfcom.com.br on 2009/06/25 03:56:10 UTC

user filtering attachments

Hi,

I'm trying to find a solution allowing user filtering attachments. My
environment uses sql user tables.

I was using mimeheader, it works at local.cf but no inside userpref table.
Spamassassin shows the rules at debug, but it doesn't work (with
allow_user_rules 0 or 1).

Do you have any idea how to do that ?

Can I define a eval rule and dynamically process user preferences ?

My idea is: user stores the attach extension at userpref tables (as
whitelist/blacklist does - using or not mimeheader plugin).

Best Regards,
Fernando


Re: user filtering attachments

Posted by Jonas Eckerman <jo...@frukt.org>.
Matus UHLAR - fantomas wrote:

> oh, dirty workaround, but doable. However, highly depend on the way your MTA
> calls the spamassasin. With milter, you can't push _any_ header to the mail,
> only those compiled in.

That would depend on wich milter. With MIMEDefang SA itself can't add 
headers directly, but MIMEDefang can use the results from SA to add headers.

OTOH, if one is using MIMEDefang, then one would most likely use 
MIMEDefang to strip attachment rather than a compbination of SA and 
maildrop.

Regards
/Jonas
-- 
Jonas Eckerman
Fruktträdet & Förbundet Sveriges Dövblinda
http://www.fsdb.org/
http://www.frukt.org/
http://whatever.frukt.org/

Re: user filtering attachments

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
> > On Fri, 26 Jun 2009, fernando@dfcom.com.br wrote:
> >> I would like spamassassin does:
> >> Read attach extensions from userpref (database),
> >> filter that mime and set a message header,
> >> maildrop (that is my mda), drops this attach and delivery only text
> >> part.
> >> (this is the easier part - it is ready).

> > Does maildrop not have a 'user preferences' or '.rc' file?
> > It has to 'find' these attachments and strip them out anyway.
> > Why involve SA at all?

> >> I don´t know to do this mime filtering using userpref configuration. I
> >> thouth create an eval function, but I don´t know how to pass function
> >> parameters from userpref database.

> > Just create 'mimeheader' rules.
> >
> > http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_MIMEHeader.html

On 26.06.09 21:39, fernando@dfcom.com.br wrote:
> I can't have individual maildrop .rc files...just database.
> 
> So I was thinking about detect attachments inside spamassassin,

oh, dirty workaround, but doable. However, highly depend on the way your MTA
calls the spamassasin. With milter, you can't push _any_ header to the mail,
only those compiled in.

> tag message and strip attachments in the maildrop.

so, you can't have personal maildroprc but can force your maildrop to strip
attachments???

> I know that mimeheader do what I need, but I couldn't insert mimeheader
> into database (sql userpref) rules at user level.

yes, per-user rules are deangerous thinh an ISP probably won't allow
(unless not using spamd)
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Micro$oft random number generator: 0, 0, 0, 4.33e+67, 0, 0, 0...

Re: user filtering attachments

Posted by fe...@dfcom.com.br.
I can't have individual maildrop .rc files...just database.

So I was thinking about detect attachments inside spamassassin, tag
message and strip attachments in the maildrop.

I know that mimeheader do what I need, but I couldn't insert mimeheader
into database (sql userpref) rules at user level.

Regards,
Fernando

>
> Please respond to LIST not to personal e-mail.
>
> On Fri, 26 Jun 2009, fernando@dfcom.com.br wrote:
>> I would like spamassassin does:
>> Read attach extensions from userpref (database),
>> filter that mime and set a message header,
>> maildrop (that is my mda), drops this attach and delivery only text
>> part.
>> (this is the easier part - it is ready).
>
> Does maildrop not have a 'user preferences' or '.rc' file?
> It has to 'find' these attachments and strip them out anyway.
> Why involve SA at all?
>
>> I don´t know to do this mime filtering using userpref configuration. I
>> thouth create an eval function, but I don´t know how to pass function
>> parameters from userpref database.
>
> Just create 'mimeheader' rules.
>
> http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_MIMEHeader.html
>
> - C



Re: user filtering attachments

Posted by Charles Gregory <cg...@hwcn.org>.
Please respond to LIST not to personal e-mail.

On Fri, 26 Jun 2009, fernando@dfcom.com.br wrote:
> I would like spamassassin does:
> Read attach extensions from userpref (database),
> filter that mime and set a message header,
> maildrop (that is my mda), drops this attach and delivery only text part.
> (this is the easier part - it is ready).

Does maildrop not have a 'user preferences' or '.rc' file?
It has to 'find' these attachments and strip them out anyway.
Why involve SA at all?

> I don´t know to do this mime filtering using userpref configuration. I
> thouth create an eval function, but I don´t know how to pass function
> parameters from userpref database.

Just create 'mimeheader' rules.

http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_MIMEHeader.html

- C

Re: user filtering attachments

Posted by Charles Gregory <cg...@hwcn.org>.
On 24.06.09 22:56, fernando@dfcom.com.br wrote:
> I'm trying to find a solution allowing user filtering attachments. My
> environment uses sql user tables.

Um, do you mean 'reject if mail has attachment of a certain type'?
Or do you mean you want to run an actual filtering program to examine
the contents of attachments?

In the former case it should be trivial to have rules that score
0.001 for each mime-type you want to block, then have the user's MDA deal 
with it (if in fact the MDA cannot just check for the mime types directly 
itself).

Or were you trying to have this happen during SMTP transaction?

- C

Re: user filtering attachments

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 24.06.09 22:56, fernando@dfcom.com.br wrote:
> I'm trying to find a solution allowing user filtering attachments. My
> environment uses sql user tables.
> 
> I was using mimeheader, it works at local.cf but no inside userpref table.
> Spamassassin shows the rules at debug, but it doesn't work (with
> allow_user_rules 0 or 1).
> 
> Do you have any idea how to do that ?
> 
> Can I define a eval rule and dynamically process user preferences ?
> 
> My idea is: user stores the attach extension at userpref tables (as
> whitelist/blacklist does - using or not mimeheader plugin).

SA only detects spam. In some cases you can force the mail containing and
attachment to be refused, but you should better search for an solution like
amavis...
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux - It's now safe to turn on your computer.
Linux - Teraz mozete pocitac bez obav zapnut.