<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Sending of HCP Reports via E-Mail in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214029#M65327</link>
    <description>&lt;P&gt;Hey Checkmates,&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have installed HCP on our gateways and integrated it into SmartConsole.&lt;BR /&gt;Now we would like to have the reports sent to us by e-mail.&lt;BR /&gt;Are any of you already using this and if so, how was it implemented?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Maria&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 14:12:53 GMT</pubDate>
    <dc:creator>mbaerwolff</dc:creator>
    <dc:date>2024-05-13T14:12:53Z</dc:date>
    <item>
      <title>Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214029#M65327</link>
      <description>&lt;P&gt;Hey Checkmates,&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have installed HCP on our gateways and integrated it into SmartConsole.&lt;BR /&gt;Now we would like to have the reports sent to us by e-mail.&lt;BR /&gt;Are any of you already using this and if so, how was it implemented?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Maria&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 14:12:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214029#M65327</guid>
      <dc:creator>mbaerwolff</dc:creator>
      <dc:date>2024-05-13T14:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214048#M65328</link>
      <description>&lt;P&gt;I'm not doing this, but my HCP output is typically 2.5-3 MB per cluster member. That seems awfully large to send via email on a regular basis. I would instead look into setting up a private SSH key on each firewall and a central server for them to send the HCP files to via SCP.&lt;/P&gt;
&lt;P&gt;If you're sure this is something you want to do, R81.10 and R81.20 have msmtp 1.4.21 (released 2010-07-03) present as /sbin/sendmail. It allows you to specify a raw SMTP envelope. I haven't tried specifying attachments like that, but my understanding is they're just a MIME block with the attachment data in base64. I would start with something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTA=10.20.30.40 # Your SMTP relay
mailRecipients="address1@domain.example; address2@domain.example"
filenameToSend="Some file generated by the firewall.pdf"

printf "From: root@$(hostname)
MIME-Version: 1.0
Subject: My super-cool email
Content-Type: multipart/mixed;
	boundary=\"outer_boundary\"
To: ${mailRecipients}

--outer_boundary
Content-Type: multipart/alternative;
	boundary=\"inner_boundary\"

--inner_boundary
Content-Type: text/plain; charset=\"UTF-8\"
Content-Transfer-Encoding: 7bit

Plaintext version of this email!
--inner_boundary
Content-Type: text/html; charset=\"UTF-8\"
Content-Transfer-Encoding: quoted-printable

&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;HTML version of this email!&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
--inner_boundary--
--outer_boundary
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=\"${filenameToSend}\"

$(cat "${filenameToSend}" | base64)
--outer_boundary--" \
| /sbin/sendmail --host="${MTA}" --read-envelope-from -t&lt;/LI-CODE&gt;
&lt;P&gt;This example is for a PDF. You will need to update the Content-Type in the bottom section with the MIME type of the file you want to send. I forget the type for GZIP data (probably application/gzip). I also forget the rules for generating the Content-Type boundaries. It might accept arbitrary strings like this, or it may need to be some kind of hash or something.&lt;/P&gt;
&lt;P&gt;I use this basic pattern to send plaintext emails from my management servers. I haven't tried to send a multipart email like this before.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 15:05:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214048#M65328</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2024-05-13T15:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214114#M65329</link>
      <description>&lt;P&gt;This is a great guide, we were looking for something like this!&lt;BR /&gt;It would be sufficient if the entire HTML check was not sent as *.tag.gz to save some data.&lt;BR /&gt;Surely it would be easier to write the text-based CLI output into an email?&lt;BR /&gt;Can the code be adapted to this?&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 07:12:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214114#M65329</guid>
      <dc:creator>RobRobbson</dc:creator>
      <dc:date>2024-05-14T07:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214399#M65330</link>
      <description>&lt;P&gt;As long as you can get the HTML file you want, I would start my experimentation with something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTA=10.20.30.40 # Your SMTP relay
mailRecipients="address1@domain.example; address2@domain.example"
htmlFileToSend="Some File.html"

printf "From: root@$(hostname)
MIME-Version: 1.0
Subject: My super-cool email
Content-Type: text/html; charset=\"UTF-8\"
To: ${mailRecipients}

$(cat "${htmlFileToSend}")" \
| /sbin/sendmail --host="${MTA}" --read-envelope-from -t&lt;/LI-CODE&gt;
&lt;P&gt;It will probably need some processing to turn HTML meant for use in a web browser to HTML suitable for an email. No idea what tags work in email, for example.&lt;/P&gt;
&lt;P&gt;Also note that HTML meant to be viewed in a browser typically includes a lot of references to external resources like images. Those could probably be replaced with characters (remember, you have access to all of UTF-8) without too much trouble. Would take a fair bit of experimentation to figure out what replacements look decent.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 16:16:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214399#M65330</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2024-05-15T16:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214455#M65331</link>
      <description>&lt;P&gt;Hey Maria,&lt;/P&gt;
&lt;P&gt;What Bob advised is probably your best bet, but if you need an official confirmation, maybe open TAC case to confirm.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 02:20:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214455#M65331</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-05-16T02:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214472#M65332</link>
      <description>&lt;P&gt;The last days I've made script (with a little help of ChatGPT&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ) which work now in our lab environment.&lt;BR /&gt;It calls the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;hcp --show-last-full&lt;/FONT&gt;&lt;/STRONG&gt; command and writes the output to a file.&lt;BR /&gt;This file is also copied to an FTP-Server and, send via mail-attachment to multiple recipients.&lt;/P&gt;&lt;P&gt;I trigger the script over the GAiA Job-Scheduler or simply over the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;crontab&lt;/FONT&gt;&lt;/STRONG&gt; command.&lt;/P&gt;&lt;P&gt;Maybe I can post a cleaned up version of the script here if it's desired.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 06:50:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214472#M65332</guid>
      <dc:creator>RobRobbson</dc:creator>
      <dc:date>2024-05-16T06:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sending of HCP Reports via E-Mail</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214473#M65333</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/83809"&gt;@RobRobbson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/27871"&gt;@Bob_Zimmerman&lt;/a&gt;&amp;nbsp;and everybody else. Just in case, a clean and flexible version of such a script could be a good candidate for our recent &lt;A href="https://community.checkpoint.com/t5/Toolbox-Contest-2024/con-p/toolbox2024" target="_self"&gt;ToolBox Contest&lt;/A&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Consider this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 06:55:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Sending-of-HCP-Reports-via-E-Mail/m-p/214473#M65333</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2024-05-16T06:55:03Z</dc:date>
    </item>
  </channel>
</rss>

