-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathemail.bat
33 lines (30 loc) · 1.58 KB
/
email.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
REM Customize cx_install_path to match your installation
SET cx_install_path="C:\Program Files\Checkmarx"
REM The purpose of this script is to allow email distribution lists to be configured
REM in the post-scan action definition rather than in the post-scan action script itself.
REM It also allows any of the result types generated by the post-scan action to be
REM attached to the email.
REM There are two arguments to this batch file in the Post-Scan action config:
REM 1. A comma-separated list of email addresses
REM 2. The attachment type (e.g. [PDF_output])
REM
REM Any attachment type is supported. No other arguments are supported.
REM
REM To properly handle spaces in paths and special character in email addresses, the arguments of the
REM post scan action are formated as such:
REM
REM Url encoded (the [PDF_Output] part and semi-colons are not encoded):
REM %22person1%[email protected],[email protected]%22,%22;[PDF_output];%22
REM Which decoded translates to:
REM "[email protected],[email protected]","(PDF path)"
REM
REM If there are no special chars needed (e.g. the '+' in the email address, non-ASCII chars in adressee names, etc)
REM then this format is also supported:
REM '[email protected],[email protected]',';[PDF_output];'
REM Which translates to:
REM '[email protected],[email protected]','(PDF path)'
REM
REM Assuming the SMTP parameters in the .ps1 file have been properly configured, the email
REM should be sent to the distribution list with the attachment.
powershell.exe -ExecutionPolicy Bypass -File %cx_install_path%\Executables\email.ps1 -cmd "%*"