From 276dcf65501294cfcb3a47de64be6e85c79a6dd8 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 17 Apr 2013 00:00:34 +0200 Subject: [PATCH] Fixed smtpt virus message --- debian/changelog | 6 ++++++ smtpt | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7d900f7..3c62b51 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mailt (1.3-1) unstable; urgency=low + + * Fixed smtpt virus test message + + -- Benjamin Renard Tue, 16 Apr 2013 23:59:47 +0200 + mailt (1.2-1) unstable; urgency=low * Added POP support diff --git a/smtpt b/smtpt index d091777..b0fb949 100755 --- a/smtpt +++ b/smtpt @@ -167,9 +167,7 @@ You should send this test mail from an account outside of your network.""" elif options.virus: if options.subject == default_subject: options.subject = "Test virus message" - options.content="""This is the EICAR standard antivirus test string : - -X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*""" + options.content="The attached file contain the EICAR standard antivirus test string." if not options.port: if options.ssl: @@ -207,6 +205,12 @@ if options.attach: part.add_header('Content-Disposition', 'attachment; filename="%s"' % os.path.basename(filepath)) msg.attach(part) +if options.virus: + part = MIMEBase('application', "octet-stream") + part.set_payload("X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*") + part.add_header('Content-Disposition', 'attachment; filename="eicar.bin"') + msg.attach(part) + if options.ssl: logging.info("Establish SSL connexion to server") server = smtplib.SMTP_SSL(options.host,options.port)