https://github.com/smeghead/docker-postfix-tls
https://github.com/smeghead/docker-postfix-tls
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smeghead/docker-postfix-tls
- Owner: smeghead
- Created: 2020-11-18T14:37:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-20T14:48:28.000Z (over 4 years ago)
- Last Synced: 2025-02-07T22:53:54.869Z (4 months ago)
- Language: Shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-postfix-tls #
## build ##
$ docker-compose build
## run ##
$ docker-compose up
## mail catcher の確認方法 ##
ブラウザで http://localhost:1080/ にアクセスする。
## command ホストで、メール送信 ##
### command サービスに入り、mailxコマンドでメールを送信する。
```sh
docker-compose exec command sh
```
```sh
echo 'mail body' | mailx \
-v \
-S smtp-use-starttls \
-S smtp-auth=login \
-S ssl-verify=ignore \
-S smtp="postfix:587" \
-S smtp-auth-user="smtpuser" \
-S smtp-auth-password="password" \
-S from="[email protected]" \
-r "[email protected]" \
-s "TLS test mail" \
"[email protected]"
```### 実行結果
```sh
% docker-compose exec command sh
/ # echo 'mail body' | mailx \
> -v \
> -S smtp-use-starttls \
> -S smtp-auth=login \
> -S ssl-verify=ignore \
> -S smtp="postfix:587" \
> -S smtp-auth-user="smtpuser" \
> -S smtp-auth-password="password" \
> -S from="[email protected]" \
> -r "[email protected]" \
> -s "TLS test mail" \
> "[email protected]"
Resolving host postfix . . . done.
Connecting to 192.168.0.3:587 . . . connected.
220 postfix.example.com ESMTP Postfix (Ubuntu)
>>> EHLO 60aad46491db
250-postfix.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM
250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO 60aad46491db
250-postfix.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM
250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 NTLM
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> c210cHVzZXI=
334 UGFzc3dvcmQ6
>>> cGFzc3dvcmQ=
235 2.7.0 Authentication successful
>>> MAIL FROM:
250 2.1.0 Ok
>>> RCPT TO:
250 2.1.5 Ok
>>> DATA
354 End data with .
>>> .
250 2.0.0 Ok: queued as 6EC3A423EBE
>>> QUIT
221 2.0.0 Bye
/ # exit
```### postfixコンテナのログからの抜粋
postfix | 2020-11-18T14:26:30.861334+00:00 36587352c6a6 postfix/smtpd[135]: Anonymous TLS connection established from unknown[192.168.0.4]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
TLSv1.2 で送信できてそう。