From 8f7c714265c7644c818a93fbc7928fc6b4d1c30e Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Thu, 28 May 2020 16:00:10 -0300 Subject: Add cms-oauth This is a command line program to get the OAUTH tokens from the credential server. It is intended to fit into the 'call a program to get the token' methodology that several tools are implementing. Several options are provided to format the token and a built in SMTP protocol tests that the server is working properly. Signed-off-by: Jason Gunthorpe --- doc/smtp.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'doc/smtp.md') diff --git a/doc/smtp.md b/doc/smtp.md index 48f3d6c..c809cfa 100644 --- a/doc/smtp.md +++ b/doc/smtp.md @@ -24,6 +24,21 @@ CredentialServer("/var/run/user/XXX/cms.sock", Upon restart CMS will acquire and maintain a OAUTH token with the SMTP scope for the specified accounts, and serve token requests on the specified path. +## Configuration Test + +CMS provides the *cms-auth* tool to get tokens out of the daemon. It has a +test mode which should be used to verify that the SMTP server is working correctly: + +```sh +$ cms-oauth --user=user@domain.com --cms_sock=/var/run/user/XXX/cms.sock --test-smtp=smtp.office365.com +``` + +On success the last log line will report something like: + +``` +reply: retcode (235); Msg: b'2.7.0 Authentication successful' +``` + # exim 4 Exim is a long standing UNIX mail system that is fully featured. exim's flexible @@ -64,3 +79,28 @@ making the adjustments noted. In this mode /usr/bin/sendmail will be fully functional for outbound mail and if multiple accounts are required, it will automatically choose the account to send mail through based on the Envelope From header. + +# msmtp + +msmtp is a small program that pretends to be sendmail and immeditately sends +the message to the configured server. Newer versions have the ability to call +out to an external program to get an OAUTH token. An [example +configuration](example-msmtp.conf) is provided showing how to connect it to +CMS. + +Support for gmail requires msmtp 1.8.4, and support for O365 requires a +[patch](msmtp-xoauth2.patch). + +# git send-email + +There is currently no native support for XOAUTH2. When one of the above two +methods is used to setup a local sendmail, then use this .git_config: + +``` +[sendemail] + smtpserver = /usr/bin/msmtp + from = User Name + envelopeSender = User Name + assume8bitEncoding = UTF-8 + transferEncoding = auto +``` -- cgit v1.2.3