Git Product home page Git Product logo

amavisvt's People

Contributors

ercpe avatar maxxer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amavisvt's Issues

How to run this thing?

The installation instructions are very much lacking for us non-gentoo users..
So I managed to run
python setup.py install and that seemed to install it..
but now what? I cant find a binary/daemon to run.
Please hit me with a clue-stick.

regards,
db

Recently api usage is low but logs are complaining..

But if I login to virustotal, there is only 300 requests for today.

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/amavisvt-0.5.3-py2.7.egg/amavisvt/client.py", line 529, in check_vt
raise Exception("API-Limit exceeded!")
Exception: API-Limit exceeded!
2017-11-02 09:01:37,514 ERROR [Thread-105] Error asking virustotal about files
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/amavisvt-0.5.3-py2.7.egg/amavisvt/client.py", line 529, in check_vt
bash: 2017-11-02: command not found
raise Exception("API-Limit exceeded!")
Exception: API-Limit exceeded!
root@smtp:/var/log# Traceback (most recent call last):
bash: syntax error near unexpected token most' root@smtp:/var/log# File "/usr/local/lib/python2.7/dist-packages/amavisvt-0.5.3-py2.7.egg/amavisvt/client.py", line 529, in check_vt bash: File: command not found root@smtp:/var/log# raise Exception("API-Limit exceeded!") bash: syntax error near unexpected token ('
root@smtp:/var/log# Exception: API-Limit exceeded!
bash: Exception:: command not found
root@smtp:/var/log# 2017-11-02 09:01:37,514 ERROR [Thread-105] Error asking virustotal about files
bash: 2017-11-02: command not found
root@smtp:/var/log# Traceback (most recent call last):
bash: syntax error near unexpected token most' root@smtp:/var/log# File "/usr/local/lib/python2.7/dist-packages/amavisvt-0.5.3-py2.7.egg/amavisvt/client.py", line 529, in check_vt bash: File: command not found root@smtp:/var/log# raise Exception("API-Limit exceeded!") bash: syntax error near unexpected token ('
root@smtp:/var/log# Exception: API-Limit exceeded!
bash: Exception:: command not found

How to install?

How do I use this package on a system not being Gentoo? I've installed all the dependencies, but amavisvtd.py is failing with ImportError: No module named amavisvt.daemon.

URL scanning

It would be beautiful if amavisvt would be able to check also URLs in emails because many emails contains just URL to download a virus and unfortunately some users are willing to open it...

debug log

Hi. Could you add debug log to file instead of StdOut. My program is catching some of the viruses but not all. I wonder what is going on. I susspect the timeout.
cheers

office document detection

Great job for you application, I want to use it in production on week 15 or 16. I have a question is you application compatible with the premium api from virustotal ? Maybe I would buy to scan all files. Because we receive a lot of javascript that contains the lockit virus and now you application dont scan it because amavis decompress the rar or zip with pXXX name and not the original one.
I just add this line, because for me some office document are detected like this : Composite Document File V2 Document. So I modify your code to handle it :

            return any((f(resource) for f in [
                                    lambda r: r.mime_type.startswith('application/'),
                                    lambda r: r.mime_type.startswith('Composite'),
                                    lambda r: r.mime_type in ('text/x-shellscript', 'text/x-perl', 'text/x-ruby', 'text/x-python'),
                                    lambda r: re.search(r"\.(exe|com|zip|tar\.[\w\d]+|doc\w?|xls\w?|ppt\w?|pdf|js|bat|cmd|rtf|ttf|html?)$", r.basen$
            ]))

ps : I dont be a python programmer at all.

Install on CentOS 7

Hello! Could provide a guide for install and run amavisvt on CentOS 7? I cannot get It to work.
Thanks

Errors in "make test" with Ubuntu 16.04

I'm getting a couple of errors during "make test", this is the first:

__________________________________________________________________________________ TestClientRun.test_run __________________________________________________________________________________

self = <tests.test_client.TestClientRun object at 0x7f1f94f49690>, database_mock = <MagicMock name='Database' id='139773620954064'>
memcached_mock = <MagicMock name='set' id='139773619382672'>, requests_mock = <MagicMock name='post' id='139773620294032'>, avt = <amavisvt.client.AmavisVT object at 0x7f1f9506a0d0>

    @mock.patch('amavisvt.client.requests.post')
    @mock.patch('amavisvt.client.memcache.Client.set')
    @mock.patch('amavisvt.client.Database')
    def test_run(self, database_mock, memcached_mock, requests_mock, avt):
        txt = os.path.join(os.path.dirname(__file__), 'samples/textfile.txt')
>       result = avt.run(txt)

tests/test_client.py:372: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
amavisvt/client.py:409: in run
    return self.process(ResourceSet(resources))
amavisvt/client.py:422: in process
    all_resources = list(_iter_resources())
amavisvt/client.py:419: in _iter_resources
    for x in r:
amavisvt/client.py:229: in __iter__
    for x in self._iter_unpacked(self, 10): # todo: make depth configurable
amavisvt/client.py:237: in _iter_unpacked
    if resource.can_unpack:
amavisvt/client.py:222: in can_unpack
    return self.mime_type in (MAIL_MIME_TYPE,) and not self._no_unpack
amavisvt/client.py:211: in mime_type
    self.examine()
amavisvt/client.py:266: in examine
    self._mime_type = identify_buffer(id_buffer)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

buf = 'test\n'

    def filemagic_id_buffer(buf):
        import magic
>       with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as mgc:
E       TypeError: __init__() got an unexpected keyword argument 'flags'

amavisvt/client.py:52: TypeError

There are more errors (all tests under tests/test_client.py::TestClientRun, and a few more including tests/test_resource.py::TestResourceSet::test_to_addresses and tests/test_unpack.py::TestUnpack::test_empty_file) and they all seem to originate from the same issue:

TypeError: __init__() got an unexpected keyword argument 'flags'

The libmagic version is 5.25. Let me know if I can provide more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.