Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAPP-32426] SMTP: Bugfix - Removing hardcoded paths to phantom home #22

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Connector Version: 3.1.0
Product Vendor: Generic
Product Name: SMTP
Product Version Supported (regex): ".\*"
Minimum Product Version: 6.1.0
Minimum Product Version: 6.1.1

This app provides the ability to send email using SMTP

Expand Down
1 change: 1 addition & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Unreleased**
* Removing hardcoded paths to phantom home [PAPP-32426]
8 changes: 3 additions & 5 deletions smtp.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"product_vendor": "Generic",
"product_name": "SMTP",
"product_version_regex": ".*",
"min_phantom_version": "6.1.0",
"min_phantom_version": "6.1.1",
"rest_handler": "request_handler.handle_request",
"license": "Copyright (c) 2016-2023 Splunk Inc.",
"logo": "logo_splunk.svg",
Expand Down Expand Up @@ -699,9 +699,7 @@
}
}
],
"pip_dependencies": {
"wheel": []
},
"pip_dependencies": {},
bbielinski-splunk marked this conversation as resolved.
Show resolved Hide resolved
"pip39_dependencies": {
"wheel": [
{
Expand All @@ -722,7 +720,7 @@
},
{
"module": "soupsieve",
"input_file": "wheels/py3/soupsieve-2.4.1-py3-none-any.whl"
"input_file": "wheels/py3/soupsieve-2.5-py3-none-any.whl"
},
{
"module": "tinycss2",
Expand Down
10 changes: 3 additions & 7 deletions smtp_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
from bs4 import BeautifulSoup
from phantom.action_result import ActionResult
from phantom.base_connector import BaseConnector
from phantom.vault import Vault

from request_handler import RequestStateHandler, _get_dir_name_from_app_name
from smtp_consts import *
Expand Down Expand Up @@ -693,12 +692,9 @@ def _add_attachments(self, outer, attachments, action_result, message_encoding):
if '.pdf' not in attachment_vault_id:
return action_result.set_status(phantom.APP_ERROR, SMTP_ERROR_SMTP_SEND_EMAIL)

if hasattr(Vault, "get_phantom_home"):
report_dir_pre_4_0 = '{0}/www/reports'.format(self.get_phantom_home())
report_dir_post_4_0 = '{0}/vault/reports'.format(self.get_phantom_home())
else:
report_dir_pre_4_0 = '/opt/phantom/www/reports'
report_dir_post_4_0 = '/opt/phantom/vault/reports'
phantom_home_path = self.get_phantom_home()
report_dir_pre_4_0 = os.path.join(phantom_home_path, "www", "reports")
report_dir_post_4_0 = os.path.join(phantom_home_path, "vault", "reports")
bbielinski-splunk marked this conversation as resolved.
Show resolved Hide resolved

filename = ''
for report_dir in (report_dir_post_4_0, report_dir_pre_4_0):
Expand Down
Binary file removed wheels/py3/soupsieve-2.4.1-py3-none-any.whl
Binary file not shown.
Binary file added wheels/py3/soupsieve-2.5-py3-none-any.whl
Binary file not shown.