Arsnael commented on code in PR #1126: URL: https://github.com/apache/james-project/pull/1126#discussion_r946456386
########## third-party/rspamd/README.md: ########## @@ -24,13 +25,39 @@ guice.extension.task=org.apache.james.rspamd.module.RSpamDTaskExtensionModule </listener> ``` -- Declare the RSpamD mailet for custom mail processing. Mailet pipeline Eg: - -``` -<mailet match="All" class="org.apache.james.rspamd.RSpamDScanner"></mailet> -<mailet match="IsMarkedAsSpam=org.apache.james.rspamd.status" class="WithStorageDirective"> - <targetFolderName>Spam</targetFolderName> -</mailet> +- Declare the RSpamD mailet for custom mail processing. Review Comment: ```suggestion - Declare the Rspamd mailet for custom mail processing. ``` Now that Tung started to fix the typo... :) ########## third-party/rspamd/sample-configuration/mailetcontainer_distributed.xml: ########## @@ -0,0 +1,174 @@ +<?xml version="1.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. + --> + +<!-- Read https://james.apache.org/server/config-mailetcontainer.html for further details --> + +<mailetcontainer enableJmx="true"> + + <context> + <!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended. + You can configure it to (for example) <postmaster>[email protected]</postmaster> --> + <postmaster>postmaster</postmaster> + </context> + + <spooler> + <threads>20</threads> + <errorRepository>cassandra://var/mail/error/</errorRepository> + </spooler> + + <processors> + <processor state="root" enableJmx="true"> + <mailet match="All" class="PostmasterAlias"/> + <mailet match="RelayLimit=30" class="Null"/> + <mailet match="All" class="ToProcessor"> + <processor>transport</processor> + </mailet> + </processor> + + <processor state="error" enableJmx="true"> + <mailet match="All" class="MetricsMailet"> + <metricName>mailetContainerErrors</metricName> + </mailet> + <mailet match="All" class="Bounce"> + <onMailetException>ignore</onMailetException> + </mailet> + <mailet match="All" class="ToRepository"> + <repositoryPath>cassandra://var/mail/error/</repositoryPath> + <onMailetException>propagate</onMailetException> + </mailet> + </processor> + + <processor state="transport" enableJmx="true"> + <matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or"> + <matcher match="SMTPAuthSuccessful"/> + <matcher match="SMTPIsAuthNetwork"/> + <matcher match="SentByMailet"/> + <matcher match="org.apache.james.jmap.mailet.SentByJmap"/> + </matcher> + + <mailet match="All" class="RemoveMimeHeader"> + <name>bcc</name> + <onMailetException>ignore</onMailetException> + </mailet> + <mailet match="All" class="RecipientRewriteTable"> + <errorProcessor>rrt-error</errorProcessor> + </mailet> + <mailet match="RecipientIsLocal" class="ToProcessor"> + <processor>local-delivery</processor> + </mailet> + <mailet match="HostIsLocal" class="ToProcessor"> + <processor>local-address-error</processor> + <notice>550 - Requested action not taken: no such user here</notice> + </mailet> + <mailet match="relay-allowed" class="ToProcessor"> + <processor>relay</processor> + </mailet> + <mailet match="All" class="ToProcessor"> + <processor>relay-denied</processor> + </mailet> + </processor> + + <processor state="local-delivery" enableJmx="true"> + <mailet match="All" class="org.apache.james.rspamd.RSpamDScanner"> Review Comment: same remark, we should not forget to change it later ########## third-party/rspamd/README.md: ########## @@ -24,13 +25,39 @@ guice.extension.task=org.apache.james.rspamd.module.RSpamDTaskExtensionModule </listener> ``` -- Declare the RSpamD mailet for custom mail processing. Mailet pipeline Eg: - -``` -<mailet match="All" class="org.apache.james.rspamd.RSpamDScanner"></mailet> -<mailet match="IsMarkedAsSpam=org.apache.james.rspamd.status" class="WithStorageDirective"> - <targetFolderName>Spam</targetFolderName> -</mailet> +- Declare the RSpamD mailet for custom mail processing. + + You can specify the `virusProcessor` if you want to enable virus scanning for mail. Upon configurable `virusProcessor` +you can specify how James process mail virus. We provide a sample Rspamd mailet and `virusProcessor` configuration: + +```xml +<processor state="local-delivery" enableJmx="true"> + <mailet match="All" class="org.apache.james.rspamd.RSpamDScanner"> Review Comment: Need to see with #1127 (depending which gets merged first^^) ########## third-party/rspamd/docker-compose-distributed.yml: ########## @@ -0,0 +1,82 @@ +version: '3' + +services: + + james: + depends_on: + - elasticsearch + - cassandra + - tika + - rabbitmq + - s3 + - rspamd + image: apache/james:distributed-latest + container_name: james + hostname: james.local + volumes: + - $PWD/target/apache-james-rspamd-3.8.0-SNAPSHOT-jar-with-dependencies.jar:/root/extensions-jars/james-server-rspamd.jar + - $PWD/sample-configuration/keystore:/root/conf/keystore + - $PWD/sample-configuration/extensions.properties:/root/conf/extensions.properties + - $PWD/sample-configuration/mailetcontainer_distributed.xml:/root/conf/mailetcontainer.xml + - $PWD/sample-configuration/listeners.xml:/root/conf/listeners.xml + - $PWD/sample-configuration/rspamd.properties:/root/conf/rspamd.properties + - $PWD/sample-configuration/webadmin.properties:/root/conf/webadmin.properties + ports: + - "80:80" + - "25:25" + - "110:110" + - "143:143" + - "465:465" + - "587:587" + - "993:993" + - "8000:8000" + + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2 Review Comment: Still elasticsearch? ########## third-party/rspamd/sample-configuration/mailetcontainer_memory.xml: ########## @@ -0,0 +1,174 @@ +<?xml version="1.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. + --> + +<!-- Read https://james.apache.org/server/config-mailetcontainer.html for further details --> + +<mailetcontainer enableJmx="true"> + + <context> + <!-- When the domain part of the postmaster mailAddress is missing, the default domain is appended. + You can configure it to (for example) <postmaster>[email protected]</postmaster> --> + <postmaster>postmaster</postmaster> + </context> + + <spooler> + <threads>20</threads> + <errorRepository>memory://var/mail/error/</errorRepository> + </spooler> + + <processors> + <processor state="root" enableJmx="true"> + <mailet match="All" class="PostmasterAlias"/> + <mailet match="RelayLimit=30" class="Null"/> + <mailet match="All" class="ToProcessor"> + <processor>transport</processor> + </mailet> + </processor> + + <processor state="error" enableJmx="true"> + <mailet match="All" class="MetricsMailet"> + <metricName>mailetContainerErrors</metricName> + </mailet> + <mailet match="All" class="Bounce"> + <onMailetException>ignore</onMailetException> + </mailet> + <mailet match="All" class="ToRepository"> + <repositoryPath>memory://var/mail/error/</repositoryPath> + <onMailetException>propagate</onMailetException> + </mailet> + </processor> + + <processor state="transport" enableJmx="true"> + <matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or"> + <matcher match="SMTPAuthSuccessful"/> + <matcher match="SMTPIsAuthNetwork"/> + <matcher match="SentByMailet"/> + <matcher match="org.apache.james.jmap.mailet.SentByJmap"/> + </matcher> + + <mailet match="All" class="RemoveMimeHeader"> + <name>bcc</name> + <onMailetException>ignore</onMailetException> + </mailet> + <mailet match="All" class="RecipientRewriteTable"> + <errorProcessor>rrt-error</errorProcessor> + </mailet> + <mailet match="RecipientIsLocal" class="ToProcessor"> + <processor>local-delivery</processor> + </mailet> + <mailet match="HostIsLocal" class="ToProcessor"> + <processor>local-address-error</processor> + <notice>550 - Requested action not taken: no such user here</notice> + </mailet> + <mailet match="relay-allowed" class="ToProcessor"> + <processor>relay</processor> + </mailet> + <mailet match="All" class="ToProcessor"> + <processor>relay-denied</processor> + </mailet> + </processor> + + <processor state="local-delivery" enableJmx="true"> + <mailet match="All" class="org.apache.james.rspamd.RSpamDScanner"> Review Comment: idem -- 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]
