chibenwa commented on code in PR #1108: URL: https://github.com/apache/james-project/pull/1108#discussion_r939766137
########## third-party/spamassassin/src/main/java/org/apache/james/spamassassin/SpamAssassin.java: ########## @@ -17,90 +17,46 @@ * under the License. * ****************************************************************/ -package org.apache.james.transport.mailets; - -import java.util.Optional; -import java.util.function.Predicate; +package org.apache.james.spamassassin; import javax.inject.Inject; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.apache.james.core.MailAddress; import org.apache.james.metrics.api.MetricFactory; -import org.apache.james.spamassassin.SpamAssassinInvoker; -import org.apache.james.spamassassin.SpamAssassinResult; import org.apache.james.user.api.UsersRepository; import org.apache.james.user.api.UsersRepositoryException; -import org.apache.james.util.Port; +import org.apache.james.util.Host; import org.apache.mailet.Attribute; import org.apache.mailet.Mail; import org.apache.mailet.PerRecipientHeaders; import org.apache.mailet.base.GenericMailet; -import org.apache.mailet.base.MailetUtil; import com.github.fge.lambdas.Throwing; -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Strings; -/** - * Sends the message through daemonized SpamAssassin (spamd), visit <a - * href="http://spamassassin.apache.org/">spamassassin.apache.org/</a> for info - * on configuration. The header X-Spam-Status is added to every message, this - * contains the score and the threshold score for spam (usually 5.0). If the - * message exceeds the threshold, the header X-Spam-Flag will be added with the - * value of YES. The default host for spamd is localhost and the default port is - * 783. - * - * <pre> - * <code> - * org.apache.james.spamassassin.status - Holds the status - * org.apache.james.spamassassin.flag - Holds the flag - * </code> - * </pre> - * - * Sample Configuration: - * - * <pre> - * <mailet notmatch="SenderHostIsLocal" class="SpamAssassin"> - * <spamdHost>localhost</spamdHost> - * <spamdPort>783</spamdPort> - * </pre> - */ Review Comment: Please keep the javadoc? ########## server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SpamAssassinContract.java: ########## @@ -1,694 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ - -package org.apache.james.jmap.draft.methods.integration; - -import static io.restassured.RestAssured.given; -import static io.restassured.RestAssured.with; -import static io.restassured.config.EncoderConfig.encoderConfig; -import static io.restassured.config.RestAssuredConfig.newConfig; -import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser; -import static org.apache.james.jmap.JMAPTestingConstants.ARGUMENTS; -import static org.apache.james.jmap.JMAPTestingConstants.LOCALHOST_IP; -import static org.apache.james.jmap.JMAPTestingConstants.NAME; -import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait; -import static org.apache.james.jmap.JmapURIBuilder.baseUri; -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Durations.ONE_MINUTE; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; - -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Map; - -import org.apache.james.GuiceJamesServer; -import org.apache.james.core.Username; -import org.apache.james.jmap.AccessToken; -import org.apache.james.jmap.draft.JmapGuiceProbe; -import org.apache.james.mailbox.Role; -import org.apache.james.modules.protocols.ImapGuiceProbe; -import org.apache.james.spamassassin.SpamAssassinExtension; -import org.apache.james.utils.DataProbeImpl; -import org.apache.james.utils.SpoolerProbe; -import org.apache.james.utils.TestIMAPClient; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import io.restassured.RestAssured; -import io.restassured.builder.RequestSpecBuilder; -import io.restassured.http.ContentType; -import io.restassured.parsing.Parser; - -public interface SpamAssassinContract { Review Comment: Please do not throw away this test, relocate it into `third-party/spamassassin` (only keep the memory ones) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
