懒得勤快 4 ani în urmă
părinte
comite
b5d62194e8

+ 1 - 0
src/Masuit.MyBlogs.Core/App_Data/email-bounces.txt

@@ -0,0 +1 @@
+

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/CommentController.cs

@@ -55,7 +55,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 return ResultData(null, false, "您提交的内容包含敏感词,被禁止发表,请检查您的内容后尝试重新提交!");
             }
 
-            if (MailSender.HasBounced(dto.Email))
+            if (MailSender.HasBounced(dto.Email) || (!CurrentUser.IsAdmin && dto.Email.EndsWith(CommonHelper.SystemSettings["Domain"])))
             {
                 return ResultData(null, false, "邮箱地址错误,请使用有效的邮箱地址!");
             }

+ 1 - 1
src/Masuit.MyBlogs.Core/Controllers/MsgController.cs

@@ -131,7 +131,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 return ResultData(null, false, "您提交的内容包含敏感词,被禁止发表,请检查您的内容后尝试重新提交!");
             }
 
-            if (MailSender.HasBounced(dto.Email))
+            if (MailSender.HasBounced(dto.Email) || (!CurrentUser.IsAdmin && dto.Email.EndsWith(CommonHelper.SystemSettings["Domain"])))
             {
                 return ResultData(null, false, "邮箱地址错误,请使用有效的邮箱地址!");
             }

+ 3 - 0
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -94,6 +94,9 @@
         <None Update="App_Data\DenyIPRange.txt">
             <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
         </None>
+        <None Update="App_Data\email-bounces.txt">
+          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+        </None>
         <None Update="App_Data\GeoLite2-ASN.mmdb">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
         </None>