LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-29-2010, 11:49 AM   #1
pbyrne
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
How to Block Animated .Gifs from making there way onto my Linux Server


Hello,

My company recently started bouncing all .Gifs back to our linux server. is there a way on my end that i can block this from happening so it stops taking up space? Thank you.
 
Old 11-29-2010, 12:04 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Would you please clarify what you mean by: "bouncing all .Gifs back to our linux server"?

I am not following the meaning. Are these emails, or web pages, or something else entirely?
 
Old 11-29-2010, 12:22 PM   #3
pbyrne
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Original Poster
Rep: Reputation: 0
these are emails with .gifs in the signature.
 
Old 12-01-2010, 04:42 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Sorry for the delay in response, I had to think on this one a bit. I think that this may be possible, but won't be easy. Searching on this subject indicates you are not the only one interested in this, but isn't showing solutions. One positive to note is that they are rendered in HTML so you can avoid them with text view only. However, this doesn't stop them from being attached.

I think what you will need to do is put a custom content filter in place on your email server. How you do this will depend on what server your using. If you are using Postfix for example, you can create a path through the mail queue and create a set of SMTP ports, one for transmitting and one for listening, where mail is sent through out, filtered, and then re-introduced. The spam program Amavis does this. If you use such a content filter or virus checker it may be possible to call a script of your own from it which would be easier.

After you are able to call your own script, the next step is to use a pattern matching algorithm to identify the animated gif. This may be further complicated by the MIME encoding, which is something that you will need to look into. I am sure that there are some common algorithms for identifying the attachments as this is a common function of most mail filter programs. In this case, were taking it a step further.

After you decode the MIME, you will want to trigger on a set of comparisons that indicate the presence of an animated gif. You can then write your script to remove these lines, change the message and pass a bounce response, etc. This is the kind of thing that PERL will excel at. Wikipedia has a really good article on the .gif file format and shows the header patterns and things that you could pattern match against.

I admit that this will be a project, but off hand, I can't think of other ways to specifically target animated gifs. Other things you may try would be to limit attachment size, or block .gif attachments (assuming this also picks up the animated ones). If someone really wants to send a file, they can encode it with zip or something.

Lastly, it might be easiest to take a direct approach, asking the offenders to stop using animated gifs and if they fail to comply with the request, temporarily ban their email account so that they get the message that your serious.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making diagrams(block) In linux. knockout_artist Linux - Newbie 2 10-17-2008 10:51 AM
animated gifs in digikam ? efi360 Linux - Software 2 03-30-2008 03:58 PM
LXer: Making animated movie/screenshots of your Ubuntu Desktop LXer Syndicated Linux News 0 03-05-2007 08:01 PM
Animated gifs under linux help tuxfood Linux - Software 7 07-17-2004 01:18 AM
making .tif files into animated .gif files (bash shell, Red Hat 7.2) illiniguy3043 Linux - Newbie 1 06-01-2004 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:43 PM.

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