Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Incoming e-mail virus scan with Evolution

  1. #1
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Incoming e-mail virus scan with Evolution

    Ok, I am posting this here because my previous thread is in the old locked Desktop archive.

    You can have Evolution scan all of your incoming e-mails for viruses and notify you of any detected.

    First you have to install the following packages:

    clamav clamav-freshclam

    This should install the basic Clamav system that updates itself automatically (there are other clam packages you can install for extra functionality).

    Then create a script in a convenient place (like your /home directory), I called mine clam-filter and it contains the following:

    Code:
    #!/bin/bash
    # Fred Blaise <chapeaurouge AT madpenguin DOT org>
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    # MA 02111-1307 USA
    
    FILE=/tmp/$$_outclam.tmp
    # clamscan for non-daemon scanning - clamdscan when the daemon is installed
    clamscan --no-summary --detect-pua=yes --detect-structured=yes - 1>$FILE
    
    if [ $? -eq 1 ]; then
    STRING=$(grep "FOUND" $FILE |cut -d: -f2)
    zenity --warning --title="Evolution: Malware detected" --text="$STRING" &
    logger -t clamav/Evolution <$FILE
    exit 1
    fi
    
    exit 0
    After you create it, make it executable:

    Code:
    chmod 777 clam-filter
    Go into Evolution-Edit-Message Filters and create a new Incoming Filter called Virus scan with location of the clam-filter script in the Pipe to Program location and an Evolution folder to dump any e-mails with a virus into (I made one called "Virus Dump) - see attached screenshot.

    Make sure that the filter is at the top of the list and all of you incoming e-mails should be checked by Clamav (so you know when you receive a Windows virus or other malware).

    You can test the functionality by sending yourself an e-mail containing one of the Eicar test files:

    http://www.eicar.org/anti_virus_test_file.htm
    Attached Images Attached Images
    Last edited by dcstar; March 16th, 2010 at 06:16 AM.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  2. #2
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Incoming e-mail virus scan with Evolution

    Quote Originally Posted by dcstar View Post
    You can have Evolution scan all of your incoming e-mails for viruses and notify you of any detected.
    Script updated to do more scanning and also to log an entry to the Syslog.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  3. #3
    Join Date
    Nov 2009
    Location
    Sofia, Bulgaria
    Beans
    296
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Incoming e-mail virus scan with Evolution

    Quite interesting. I think I'll give it a try. I didn't know that there're antivirus packages for Linux though... I thought that all viruses are written only for Windows...

    Cheers,
    Boyan

  4. #4
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Incoming e-mail virus scan with Evolution

    Quote Originally Posted by lz1dsb View Post
    Quite interesting. I think I'll give it a try. I didn't know that there're antivirus packages for Linux though... I thought that all viruses are written only for Windows...
    Don't you want to see all the Windows malware that gets sent to you?

    It also detects bogus e-mail links in messages that are there to deceive you, these things are platform independent and IMHO most people would rather be informed of them than risk clicking the link.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  5. #5
    Join Date
    Nov 2009
    Location
    Sofia, Bulgaria
    Beans
    296
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Incoming e-mail virus scan with Evolution

    You're right. I'll really try it out, that's really the point. I didn't mean to be sarcastic in any way though...

    Cheers,
    Boyan

  6. #6
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Incoming e-mail virus scan with Evolution

    Quote Originally Posted by lz1dsb View Post
    You're right. I'll really try it out, that's really the point. I didn't mean to be sarcastic in any way though...

    Cheers,
    Boyan
    Didn't take it that way, some people like seeing Windows malware that has no effect on their systems......
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  7. #7
    Join Date
    Jun 2010
    Beans
    1

    Re: Incoming e-mail virus scan with Evolution

    Hi,

    I followed everything you wrote and now that I have all setup, how can I test everything?

    Thx for your reply....oh btw.... YOU ROCK Dude

    OK i just missed the eicar part. sorry!!!
    Last edited by ImmaNoob; June 22nd, 2010 at 04:22 PM.

  8. #8
    Join Date
    Jun 2010
    Beans
    2

    Re: Incoming e-mail virus scan with Evolution

    Well... All done, but all my incoming emails now are moved to the tray "Virus-Dump"

    ???

  9. #9
    Join Date
    May 2007
    Location
    S. E. Arizona, USA
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Incoming e-mail virus scan with Evolution

    Hi DCSTAR,
    Many thanks. That is just what I've been looking for. Well done indeed. It works as advertised and thanks for adding the info on test files. I don't worry about viruses, but I try to take pity on my friends who are locked into another OS. Again, many thanks.
    // Don
    ---------------------------------------------------
    Toshiba P755-S5390 / Core I7 / 8 gigs

  10. #10
    Join Date
    Jul 2008
    Beans
    139

    Re: Incoming e-mail virus scan with Evolution

    Followed all the setup steps, attempted to test it...

    My provider won't send the email cuz it detects the virus sig in the test file.



    Any way around that?

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •