From e1374cedda93e39fa13c765b86ba4b267d8ccf84 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 30 Dec 2025 11:45:30 -0500 Subject: [PATCH] Document the config a bit better, drop TLS from OAuthServerConfig --- cmd/mailpopbox-router/config.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cmd/mailpopbox-router/config.go b/cmd/mailpopbox-router/config.go index a89b7fa..988f211 100644 --- a/cmd/mailpopbox-router/config.go +++ b/cmd/mailpopbox-router/config.go @@ -21,13 +21,20 @@ const ( // ServerConfig stores the connection information for an email // server. type ServerConfig struct { - Type ServerType - ServerAddr string - UseTLS bool + Type ServerType + // Email is required for all configs, however it's interpreted differently + // between ServerTypes: + // - `ServerTypePOP3` : The pop3 username for authentication. + // - `ServerTypeGmail` : An identifier to store the OAuth token under. This is + // not used to authenticate. Email string - Password string + // The following fields only apply to `ServerTypePOP3`. + + ServerAddr string + UseTLS bool + Password string } func (c *ServerConfig) LogDescription() string { @@ -45,11 +52,10 @@ type MonitorConfig struct { // OAuthServerConfig stores the configuration for an OAuth 2.0 // application for authenticating to GMail. type OAuthServerConfig struct { - RedirectURL string - ListenAddr string - CredentialsPath string - TokenStore string - TLSCertPath, TLSKeyPath string + RedirectURL string + ListenAddr string + CredentialsPath string + TokenStore string } // Config is the top-level config of mailbox-shuffler. -- 2.43.5