mlandauer / cuttlefish

Transactional email server with a lovely web interface
http://cuttlefish.io
Other
1.51k stars 175 forks source link

Must issue a STARTTLS command first #415

Open changchichung opened 2 years ago

changchichung commented 2 years ago

I run cuttlefish with docker-compose , and try to send mail via msmtp in another client then I got this error messages .

worker_1       | 2022-05-05T08:32:05.034Z 1 TID-otef306mx ParseHeadersCreateEmailWorker JID-a8e967511568495cc72af3c2 INFO: start
worker_1       | 2022-05-05T08:32:05.196Z 1 TID-otef306mx ParseHeadersCreateEmailWorker JID-a8e967511568495cc72af3c2 INFO: fail: 0.162 sec
worker_1       | 2022-05-05T08:32:05.197Z 1 TID-otef306mx WARN: {"context":"Job raised exception","job":{"class":"ParseHeadersCreateEmailWorker","args":[["changch@abc.com"],"/tmp/cuttlefish20220505-1-fmgl8p",2],"retry":true,"queue":"default","jid":"a8e967511568495cc72af3c2","created_at":1651739473.4852288,"enqueued_at":1651739525.034449,"error_message":"530 5.7.0 Must issue a STARTTLS command first\n","error_class":"Net::SMTPAuthenticationError","failed_at":1651739473.5813437,"retry_count":1,"retried_at":1651739503.7167711},"jobstr":"{\"class\":\"ParseHeadersCreateEmailWorker\",\"args\":[[\"changch@abc.com\"],\"/tmp/cuttlefish20220505-1-fmgl8p\",2],\"retry\":true,\"queue\":\"default\",\"jid\":\"a8e967511568495cc72af3c2\",\"created_at\":1651739473.4852288,\"enqueued_at\":1651739525.034449,\"error_message\":\"530 5.7.0 Must issue a STARTTLS command first\\n\",\"error_class\":\"Net::SMTPAuthenticationError\",\"failed_at\":1651739473.5813437,\"retry_count\":1,\"retried_at\":1651739503.7167711}"}
worker_1       | 2022-05-05T08:32:05.197Z 1 TID-otef306mx WARN: Net::SMTPAuthenticationError: 530 5.7.0 Must issue a STARTTLS command first

and here is my msmtp config ( I just copy from cuttlefish app page , and only update the host ip address )

account cuttlefish
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
host 192.168.11.13
port 2525
auth on
user acting_twins_2
password iuVdHL7totip5g7MN5Ge
from cuttlefish
tls_certcheck off
account default : cuttlefish

any suggestions ??

update msmtp debug info

cch:~$ cat cuttle.txt |msmtp --read-envelope-from -t --syslog=on -d
envelope from address extracted from mail: cuttle@abc.com
loaded system configuration file /etc/msmtprc
ignoring user configuration file /home/chchang/.msmtprc: 沒有此一檔案或目錄
falling back to default account
using account default from /etc/msmtprc
host = 192.168.11.13
port = 2525
source ip = (not set)
proxy host = (not set)
proxy port = 0
timeout = off
protocol = smtp
domain = localhost
auth = choose
user = test_6
password = *
passwordeval = (not set)
ntlmdomain = (not set)
tls = on
tls_starttls = on
tls_trust_file = /etc/ssl/certs/ca-certificates.crt
tls_crl_file = (not set)
tls_fingerprint = (not set)
tls_key_file = (not set)
tls_cert_file = (not set)
tls_certcheck = off
tls_min_dh_prime_bits = (not set)
tls_priorities = (not set)
auto_from = off
maildomain = (not set)
from = cuttle@abc.com
add_missing_from_header = on
add_missing_date_header = on
remove_bcc_headers = on
dsn_notify = (not set)
dsn_return = (not set)
logfile = (not set)
logfile_time_format = (not set)
syslog = LOG_USER
aliases = (not set)
reading recipients from the command line and the mail
<-- 220 Cuttlefish SMTP server waves its arms and tentacles and says hello
--> EHLO localhost
<-- 250-smtp
<-- 250-STARTTLS
<-- 250-AUTH PLAIN
<-- 250-NO-SOLICITING
<-- 250 SIZE 20000000
--> STARTTLS
<-- 220 Start TLS negotiation
TLS session parameters:
    (TLS1.2)-(ECDHE-SECP256R1)-(RSA-SHA256)-(AES-256-GCM)
TLS certificate information:
    Owner:
        Common Name: openca.steamheat.net
        Organization: Steamheat.net
        Organizational unit: Engineering
        Locality: New York
        State or Province: New York
        Country: US
    Issuer:
        Common Name: openca.steamheat.net
        Organization: Steamheat.net
        Organizational unit: Engineering
        Locality: New York
        State or Province: New York
        Country: US
    Validity:
        Activation time: Sat 06 May 2006 01:06:03 AM CST
        Expiration time: Wed 21 Feb 2024 01:06:03 AM CST
    Fingerprints:
        SHA256: B9:35:BA:DC:66:10:11:59:95:C6:6F:1D:94:1E:79:0C:39:37:D1:42:BE:A9:0F:85:48:D0:BC:26:C6:C7:31:90
        SHA1 (deprecated): 44:7F:0A:E9:16:E7:D2:5A:56:2E:59:21:E0:E7:8A:D8:C1:39:CE:84
--> EHLO localhost
<-- 250-smtp
<-- 250-STARTTLS
<-- 250-AUTH PLAIN
<-- 250-NO-SOLICITING
<-- 250 SIZE 20000000
--> AUTH PLAIN AHRlc3RfNgBEbWt3M0duV2k3enhlV3U0MlRlNA==
<-- 235 authentication ok
--> MAIL FROM:<cuttle@abc.com>
<-- 250 Ok
--> RCPT TO:<cch@abc.com>
<-- 250 Ok
--> DATA
<-- 354 Send it
--> Date: Thu, 05 May 2022 16:40:31 +0800
--> From: cuttle@abc.com
--> To: cch@abc.com
--> X-Cuttlefish-Metadata-user-id: 1234
--> X-Cuttlefish-Metadata-type: friendly
--> Subject: Hello
--> 
--> Hello!
--> .
<-- 250 Message accepted
--> QUIT
<-- 221 Ok