wsl でwindowsでmail コマンドを使う

Postfixからcygwin等でGmail経由でメールを送信するための設定メモ

  • ソフトを入れる apt-cyg install mailutils
    apt-cyg install postfix

PostfixからGmail経由でメールを送信するための設定メモ | あぱーブログ アプリパスワードがめんどくさい。

Windows 10 or 11 (WSL2)のUbuntuでsystemctlを利用する方法(systemdをPID1で動作させる方法) | Snow System

(3) Postfixの設定ファイルの最終行に以下の設定を追加。 vi /etc/postfix/main.cf

relayhost = smtp.gmail.com:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/gmail smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_sasl_mechanism_filter = plain smtp_use_tls = yes <<

  • 再起動 sudo systemctl enable --now postfix Linuxだと sudo service postfix restart

ログファイルは cat /var/log/maillog