This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push: new bb0f811dd9 [ENHANCEMENT] Test SPF inifinite loops bb0f811dd9 is described below commit bb0f811dd963534762322cc5b33abd6657a947f0 Author: Benoit TELLIER <btell...@linagora.com> AuthorDate: Sun Jan 12 21:57:03 2025 +0100 [ENHANCEMENT] Test SPF inifinite loops --- .../org/apache/james/transport/mailets/SPFTest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/SPFTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/SPFTest.java index 29dc33dfda..136f399159 100644 --- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/SPFTest.java +++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/SPFTest.java @@ -79,12 +79,20 @@ public class SPFTest { // fail l.add("v=spf1 -all"); return CompletableFuture.completedFuture(l); + case "spf26.james.apache.org": + // fail + l.add("v=spf1 include:spf27.james.apache.org ~all"); + return CompletableFuture.completedFuture(l); + case "spf27.james.apache.org": + // fail + l.add("v=spf1 include:spf26.james.apache.org ~all"); + return CompletableFuture.completedFuture(l); case "spf3.james.apache.org": // softfail l.add("v=spf1 ~all"); return CompletableFuture.completedFuture(l); case "spf4.james.apache.org": - // permerror + // kpermerror l.add("v=spf1 badcontent!"); return CompletableFuture.completedFuture(l); case "spf5.james.apache.org": @@ -135,6 +143,15 @@ public class SPFTest { assertThat(AttributeUtils.getValueAndCastFromMail(mail, RESULT_ATTRIBUTE, String.class)).contains("fail"); } + @Test + public void testInfiniteLoop() throws MessagingException { + FakeMail mail = fakeMail().sender("he...@spf26.james.apache.org").build(); + Mailet mailet = testMailet(); + + mailet.service(mail); + assertThat(AttributeUtils.getValueAndCastFromMail(mail, RESULT_ATTRIBUTE, String.class)).contains("permerror"); + } + @Test public void serviceShouldPerformSPFCheckWithResultSoftFail() throws MessagingException { FakeMail mail = fakeMail().sender("he...@spf3.james.apache.org").build(); --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org