smtp_configure.go: disable smtp auth when unset
This commit is contained in:
		
				
					committed by
					
						 Adhityaa Chandrasekar
						Adhityaa Chandrasekar
					
				
			
			
				
	
			
			
			
						parent
						
							c040f95e25
						
					
				
				
					commit
					2006b02f59
				
			| @@ -19,10 +19,6 @@ func smtpConfigure() error { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if username == "" || password == "" { | ||||
| 		logger.Warningf("no SMTP username/password set, Commento will assume they aren't required") | ||||
| 	} | ||||
|  | ||||
| 	if os.Getenv("SMTP_FROM_ADDRESS") == "" { | ||||
| 		logger.Errorf("COMMENTO_SMTP_FROM_ADDRESS not set") | ||||
| 		smtpConfigured = false | ||||
| @@ -30,7 +26,11 @@ func smtpConfigure() error { | ||||
| 	} | ||||
|  | ||||
| 	logger.Infof("configuring smtp: %s", host) | ||||
| 	if username == "" || password == "" { | ||||
| 		logger.Warningf("no SMTP username/password set, Commento will assume they aren't required") | ||||
| 	} else { | ||||
| 		smtpAuth = smtp.PlainAuth("", username, password, host) | ||||
| 	} | ||||
| 	smtpConfigured = true | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user