diff --git a/src/CSET/cset_workflow/app/send_email/bin/send_email.py b/src/CSET/cset_workflow/app/send_email/bin/send_email.py index c59dc634a..a65d22f72 100755 --- a/src/CSET/cset_workflow/app/send_email/bin/send_email.py +++ b/src/CSET/cset_workflow/app/send_email/bin/send_email.py @@ -52,7 +52,7 @@ def run(): except ValueError: body = "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET" subprocess.run( - f'printf "{body}" | mail -s "{subject}" -S "from=notifications" "$USER"', + f'printf "{body}" | mail -s "{subject}" "$USER"', check=True, shell=True, ) diff --git a/tests/workflow_utils/test_send_email.py b/tests/workflow_utils/test_send_email.py index 02a408be3..3e25df0a1 100644 --- a/tests/workflow_utils/test_send_email.py +++ b/tests/workflow_utils/test_send_email.py @@ -69,7 +69,7 @@ def test_send_email(monkeypatch): def mock_subprocess_run(args, check, shell): assert ( args - == 'printf "The webpage for your run of CSET is now ready. You can view it here:\nhttps://example.com/~user/CSET" | mail -s "CSET webpage ready" -S "from=notifications" "$USER"' + == 'printf "The webpage for your run of CSET is now ready. You can view it here:\nhttps://example.com/~user/CSET" | mail -s "CSET webpage ready" "$USER"' ) assert check assert shell @@ -84,7 +84,7 @@ def test_send_email_invalid_environment_variables(monkeypatch): def mock_subprocess_run(args, check, shell): assert ( args - == 'printf "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET" | mail -s "CSET webpage ready" -S "from=notifications" "$USER"' + == 'printf "The webpage for your run of CSET is now ready, though the address could not be determined.\nCheck that WEB_ADDR and WEB_DIR are set correctly, then consider filing a bug report at https://github.com/MetOffice/CSET" | mail -s "CSET webpage ready" "$USER"' ) assert check assert shell