Signed-off-by: Luan Shengde luanshengde2@huawei.com --- container/send-internet-mail/start | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 container/send-internet-mail/start
diff --git a/container/send-internet-mail/start b/container/send-internet-mail/start new file mode 100755 index 0000000..ef9b987 --- /dev/null +++ b/container/send-internet-mail/start @@ -0,0 +1,54 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +. /c/compass-ci/container/defconfig.sh +docker_rm send-internet-mail + +cmd=( + docker run + --restart=always + --name=send-internet-mail + -d + -p 11312:11312 + -v /etc/localtime:/etc/localtime:ro + send-internet-mail +) + +"${cmd[@]}" + +cat<<EOF +port: 11312 +--- + +No need to specify the sender + +data='{ +"subject": "email subject", +"to": "email_to_addr", +"body": "email message" +}' + +or + +data=" +subject: email subject +to: email_to_addr +body: email message" + +command: + curl -XPOST 'service_server_ip:service_port/send_mail_yaml' -d "$data" + +--- +data=" +To: email_to_addr +Subject: email_subject + +mail_msg_line1 +mail_msg_line2 +... +" + +command: + curl -XPOST 'service_server_ip:service_port/send_mail_text' -d "$data" +EOF