使用 TLS 和身份验证问题的 SMTP 服务器邮件警报

时间:2021-01-14 08:43:31

标签: email smtp tls1.2 smtp-auth mailx

我对在 AIX 7.1 OS 上使用 SMTP 服务器警报配置有点陌生。我目前正在使用以下运行良好的语法:

import sys

from PySide2.QtCore import QThread, QMutex
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QApplication, QVBoxLayout, QWidget, QPushButton, QHBoxLayout, QLabel

from API import API

class MainWindow(QWidget):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.init_UI()


    def init_UI(self):
        self.setFixedSize(690, 530)
        self.image_lbl = QLabel()

        self.image_lbl.setPixmap(QPixmap("img/im.jpg"))

        btn_cnt = QPushButton("Continue")
        btn_pa = QPushButton("Pause")

        hbox = QHBoxLayout()
        hbox.addWidget(btn_cnt)
        hbox.addWidget(btn_pa)

        vbox = QVBoxLayout()
        vbox.addWidget(self.image_lbl)
        vbox.addLayout(hbox)

        self.setLayout(vbox)

        self.start_api()
        self.show()


    def start_api(self):
        self.thread_API = QThread()
        self.api = API()
        self.api.moveToThread(self.thread_API)
        self.thread_API.started.connect(self.api.start)
        self.api.signal_get_value.connect(self.read_measurement)

        self.thread_API.start()
        # ToDo: Do I need the terminate thread when exited from the app?

    dv = 0
    def read_measurement(self):
        measurement = None
        result = "measurement " + str(self.dv)
        self.dv += 1
        self.api.data.set_measurement(result)
        self.api.pause = False



if __name__ == '__main__':
    app = QApplication(sys.argv)
    main_form = MainWindow()
    sys.exit(app.exec_())

但我们现在正在迁移我们的 SMTP 服务器并启用身份验证和 TLS,但我无法这样做。请指导我我做错了什么:

mail -s "Subject" "abc@test.com" < /path/to/my/input.txt

我得到的错误是:

echo "This is the message body and contains the message" | mailx -v -s "This is the subject" -S smtp=smtp://newsmptp.test.com:25 -S smtp-use-starttls -S smtp-auth=login -S smtp-auth-user="temp" -S smtp-auth-password="Abc#123" -S ssl-verify=ignore "abc@test.com

0 个答案:

没有答案