LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 12-27-2005, 06:19 AM   #1
sami.ma
LQ Newbie
 
Registered: Dec 2005
Location: Hyderabad, India
Distribution: CentOS4
Posts: 1

Rep: Reputation: 0
Block Email Attachments


Hi There,

Here is question On IPtables Firewall, I want to block the attachments on internet email sites (yahoo,hotmail etc) for my LAN users.

what i need to do on my gateway server.
 
Old 12-27-2005, 09:20 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
You won't be able to do that at the firewall level. You'll need to do it on the application level, you might be able to using something like Zorp or more likely you'll need to do attachment filtering using the mail service itself (or an integrated milter).
 
Old 01-07-2006, 02:28 PM   #3
John Hardin
LQ Newbie
 
Registered: Oct 2003
Location: Clearview, WA
Distribution: Gentoo
Posts: 2

Rep: Reputation: 0
Blocking email attachments

Quote:
Originally Posted by sami.ma
I want to block the attachments on internet email sites (yahoo,hotmail etc) for my LAN users.
If you want to filter attachments from inbound email messages, take a look here:

impsec.org/email-tools/procmail-security.html

(LQ won't let me post proper URLs yet... feh.)

If you want to block people from downloading attachments from their webmail accounts, that's a little more difficult. Assuming you use squid as your proxy, you'd set up something like this...

Code:
# insert the following into /etc/squid/squid.conf in the acls/http_access section:
acl WEBMAIL             dstdom_regex  -i "/etc/squid/webmails"
acl EXECUTABLE          urlpath_regex -i "/etc/squid/executables"
http_access deny WEBMAIL EXECUTABLE
Code:
$ cat /etc/squid/webmails 
email\.cnn\.com
hotmail\.com
hotmail\.msn\.com
inbox\.excite\.com
email\.excite\.com
mail\.chek\.com
mail\.yahoo\.com
mailchek\.com
passport\.com
webmail\.netscape\.com
webmail[a-z]\.juno\.com
aolanywhere\.com
[^.]*mail[^.]*\.[^.]*\.(com|net)
I don't have a gmail account so I don't know what their message URLs look like.
Code:
$ cat /etc/squid/executables 
\.asd$
\.asd\?.*$
\.bat$
\.bat\?.*$
\.chm$
\.chm\?.*$
\.com$
\.com\?.*$
\.dll$
\.dll\?.*$
\.exe$
\.exe\?.*$
\.hlp$
\.hlp\?.*$
\.hta$
\.hta\?.*$
\.lnk$
\.lnk\?.*$
\.ocx$
\.ocx\?.*$
\.pif$
\.pif\?.*$
\.reg$
\.reg\?.*$
\.scr$
\.scr\?.*$
\.shb$
\.shb\?.*$
\.shs$
\.shs\?.*$
\.vb$
\.vb\?.*$
\.vbe$
\.vbe\?.*$
\.vbs$
\.vbs\?.*$
\.wsc$
\.wsc\?.*$
\.wsf$
\.wsf\?.*$
\.wsh$
\.wsh\?.*$
Hope this helps!

--
John Hardin KA7OHZ
jhardin@impsec.org
http://www.impsec.org/~jhardin/
pgpk -a jhardin@impsec.org
key: 0xB8732E79 - 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
The first time I saw a bagpipe, I thought the player was torturing
an octopus. I was amazed they could scream so loudly.

Last edited by John Hardin; 01-07-2006 at 02:32 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Content filtering for Postfix 2.0.x How to block attachments? dtournas Linux - Security 3 01-07-2006 02:36 PM
email attachments rhb327 Linux - Software 2 11-13-2004 09:08 AM
Save Email Attachments mwmethe Linux - Software 1 01-14-2004 07:55 AM
email attachments - chinese wilsnyder Linux - Newbie 3 07-12-2003 03:09 PM
command line email with attachments??? crickett Linux - Software 1 06-24-2003 08:47 PM


All times are GMT -5. The time now is 05:18 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration