+

Fixed smtpt virus message

Benjamin Renard [2013-04-16 22:00:34]
Fixed smtpt virus message
Filename
debian/changelog
smtpt
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 <brenard@easter-eggs.com> 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)
ViewGit