mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	Set server name in TLS config (#13)
This commit is contained in:
		@@ -89,9 +89,9 @@ func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body str
 | 
			
		||||
 | 
			
		||||
	switch cfg.Encryption {
 | 
			
		||||
	case MailEncryptionTLS:
 | 
			
		||||
		return e.SendWithTLS(hostname, auth, &tls.Config{InsecureSkipVerify: !cfg.CertValidation})
 | 
			
		||||
		return e.SendWithTLS(hostname, auth, &tls.Config{ServerName: cfg.Host, InsecureSkipVerify: !cfg.CertValidation})
 | 
			
		||||
	case MailEncryptionStartTLS:
 | 
			
		||||
		return e.SendWithStartTLS(hostname, auth, &tls.Config{InsecureSkipVerify: !cfg.CertValidation})
 | 
			
		||||
		return e.SendWithStartTLS(hostname, auth, &tls.Config{ServerName: cfg.Host, InsecureSkipVerify: !cfg.CertValidation})
 | 
			
		||||
	default: // MailEncryptionNone
 | 
			
		||||
		return e.Send(hostname, auth)
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user