LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-05-2009, 03:59 AM   #1
sanjee
Member
 
Registered: Jul 2008
Posts: 129

Rep: Reputation: 15
Arrow Control mail attachment through iptables


How to restrict through IPTABLES , any mail attachment packet .
Local users when sending outlook mail with attachment . I want to restrict the mail attachment will discarded through linux iptables firewall system .
The mail is situated in remote and don't have any access on it . Can I block attachment packet in my end .
 
Old 01-05-2009, 04:02 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I doubt it - as far as I'm aware, the attachment is simply part of the body during transmission. Therefore iptables has no knowledge of the content.

Are you concerned about incoming or outgoing messages
 
Old 01-05-2009, 04:21 AM   #3
sanjee
Member
 
Registered: Jul 2008
Posts: 129

Original Poster
Rep: Reputation: 15
Yes . Because I don't have any access on remote mail server . But I have to set the restriction in such a way , so that local users can not send any attachment mail through outlook .
Is there any way .
 
Old 01-05-2009, 04:34 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
There seem to be a few methods mentioned around the place - do a search for postfix block attachment.

Here's one suggestion

Quote:
man header_checks, man regexp_table

Put something like the following in /etc/postfix/mime_header_checks.regexp

/filename=\"?(.*)\.(bat|chm|cmd|com|do|exe|hta|jse|rm|scr|pif|vbe|vbs|vxd|xl)\"?$/
REJECT For security reasons we reject attachments of this type
/^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(lnk|asd|hlp|ocx|reg|bat|c[ho]m|cmd|exe|dll|vxd|pif|scr|h ta|jse?|sh[mbs]|vb[esx]|ws[fh]|wav|mov|wmf|xl))"?\s*$/
REJECT Attachment type not allowed. File "$2" has the unacceptable extension "$3"

Then add the following to /etc/postfix/main.cf

mime_header_checks = regexp:/etc/postfix/mime_header_checks.regexp
 
Old 01-05-2009, 06:42 AM   #5
sanjee
Member
 
Registered: Jul 2008
Posts: 129

Original Poster
Rep: Reputation: 15
Thanks for suggestion . But , those paramiter can be set in postfix mail configuration file . And I don't have access in mail server . Then please suggest how to overcome .
 
Old 01-05-2009, 09:53 AM   #6
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by sanjee View Post
Thanks for suggestion . But , those paramiter can be set in postfix mail configuration file . And I don't have access in mail server . Then please suggest how to overcome .
About the only thing you could do is setup an internal mail server (with attachment blocking) and have the clients setup to authenticate and do email through there and then setup iptabes to deny all hosts except the internal mail server access to the outside world on port 25. Think smart host.
 
Old 01-05-2009, 11:02 PM   #7
sanjee
Member
 
Registered: Jul 2008
Posts: 129

Original Poster
Rep: Reputation: 15
I was thinking , if it could be possible through mail packer header etc .
Is their any way to find out the attachment type .
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
detach mail attachment csaunders Red Hat 5 04-19-2007 08:23 AM
mail attachment tostay2003 Linux - Software 6 10-01-2006 07:07 PM
Mail Attachment size hinetvenkat Linux - Security 3 12-26-2004 08:05 AM
mail -a would not work to send e-mail attachment saavik Linux - Networking 3 12-18-2003 09:33 AM
mail with attachment joseph Linux - Networking 1 08-31-2003 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration