一个基于异步的库,用于与SpamAssassin的SPAMD服务通信。
aiospamc的Python项目详细描述
说明
基于python异步的库,实现spamassassin使用的spamc/spamd客户端协议。
文档
文档可以在以下位置找到:https://aiospamc.readthedocs.io/
要求
- python 3.5或更高版本
示例
importasynciofromaiospamcimport*GTUBE='''Subject: Test spam mail (GTUBE) Message-ID: <GTUBE1.1010101@example.net> Date: Wed, 23 Jul 2003 23:30:00 +0200 From: Sender <sender@example.net> To: Recipient <recipient@example.net> Precedence: junk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This is the GTUBE, the Generic Test for Unsolicited Bulk Email If your spam filter supports it, the GTUBE provides a test by which you can verify that the filter is installed correctly and is detecting incoming spam. You can send yourself a test mail containing the following string of characters (in upper case and with no white spaces and line breaks): XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X You should send this test mail from an account outside of your network. '''loop=asyncio.new_event_loop()client=Client(host='localhost')responses=loop.run_until_complete(asyncio.gather(client.ping(),client.check(GTUBE),client.headers(GTUBE)))print(responses)