Commit 39fe01d8 authored by Cool Fire (HN)'s avatar Cool Fire (HN)

Changed mail format a little

parent 20c817b9
......@@ -5,7 +5,7 @@ require 'net/smtp'
# Some configuration parameters
sender = 'noc@insomnia247.nl'
smtp_server = '127.0.0.1'
smtp_server = 'localhost'
fw_logfile = '/home/coolfire/fw_block.log'
f2b_logfile = '/var/log/fail2ban.log'
......@@ -93,9 +93,9 @@ iplist.each do |ip|
f2b_details = %x(grep #{ip} #{f2b_logfile} | grep #{f2b_date})
# Build mail body
mail = %{
From: #{sender}
To: #{abuse_contact}
mail = <<MESSAGE_END
From: Insomnia 24/7 abuse dept. <#{sender}>
To: Abuse contact <#{abuse_contact}>
Subject: Abuse from #{ip}
Dear sir/madam,
......@@ -114,7 +114,7 @@ Suricata hits:
Fail2ban hits:
#{f2b_details}
}
MESSAGE_END
# Send out mail
Net::SMTP.start(smtp_server) do |smtp|
......
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