Commit 967c9c69 authored by Cool Fire (HN)'s avatar Cool Fire (HN)
Browse files

Changed to Linux mail command instead of net/smtp

parent 39fe01d8
#!/usr/bin/env ruby
require 'date'
require 'net/smtp'
# Some configuration parameters
sender = ''
smtp_server = 'localhost'
fw_logfile = '/home/coolfire/fw_block.log'
f2b_logfile = '/var/log/fail2ban.log'
......@@ -94,11 +90,7 @@ iplist.each do |ip|
# Build mail body
mail = <<MESSAGE_END
From: Insomnia 24/7 abuse dept. <#{sender}>
To: Abuse contact <#{abuse_contact}>
Subject: Abuse from #{ip}
Dear sir/madam,
Dear #{abuse_contact},
We wish to inform we have been attacked from the following IP address:
......@@ -117,9 +109,7 @@ Fail2ban hits:
# Send out mail
Net::SMTP.start(smtp_server) do |smtp|
smtp.send_message mail, sender, abuse_contact
%x(echo #{mail} | mail -s "Abuse from #{ip}" "" )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment