mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Prevent multiple To recipients (#22566)
				
					
				
			Change the mailer interface to prevent leaking of possible hidden email addresses when sending to multiple recipients. Co-authored-by: Gusted <williamzijl7@hotmail.com>
This commit is contained in:
		@@ -82,9 +82,12 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *user_model.U
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	msg := NewMessage(emails, subject, content.String())
 | 
			
		||||
	msg.Info = fmt.Sprintf("UID: %d, repository pending transfer notification", newOwner.ID)
 | 
			
		||||
	for _, to := range emails {
 | 
			
		||||
		msg := NewMessage(to, subject, content.String())
 | 
			
		||||
		msg.Info = fmt.Sprintf("UID: %d, repository pending transfer notification", newOwner.ID)
 | 
			
		||||
 | 
			
		||||
		SendAsync(msg)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	SendAsync(msg)
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user