Great, thanks for the explanation about greylisting + rspamd ! --
Best regards, Benoit TELLIER General manager of Linagora VIETNAM. Product owner for Twake-Mail product. Chairman of the Apache James project. Mail: [email protected] Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal) On Jul 9, 2026 10:12 AM, from Felix Auringer <[email protected]>As far as I understand, the state for the greylisting is kept by Rspamd. So when a slightly suspicious email is processed by Rspamd, it returns the 'soft reject' action and stores information about that email in its cache. James could then temporarily reject the email. When the other MTA tries again, Rspamd remembers the email and returns the action `no action` so James would accept the email. I do not think that any persistence is needed on James' side. I will probably do a short spike in the next days to see how much work a Rspamd SMTP hook would be. Regarding James' rate limiting: I thought the options `connectionLimit` and `connectionLimitPerIP` in the SMTP config were the only ratelimiting mechanisms in James. After your comment, I searched again and found james.staged.apache.org/james-project/3.10.0/servers/postgres/customization/index.html#_rate_limiting_for_mailet_processing. That's more advanced than I thought. Rspamd's module (docs.rspamd.com/modules/ratelimit/) has still more configuration possibilities but at least we would probably not really use those anyway. Best regards, Felix On 7/8/26 4:55 PM, Benoit TELLIER wrote: > A RSpamD hook would make complete sense! > > Though the greylisting would need to be backed with a persistance solution > (redis ?) so implementing it to plug Rspamd greylisting to James' future > greylisting is quite some work. > > (contribution welcomed indeed) > >> The Rspamd tests always take less than 2s with my current configuration >> which would probably not hit any timeouts. If that would be too much, one >> could also use another rspamd instance that only has the ratelimiting and >> greylisting modules and would be way faster. > The design allows the mailet to override the default rspamd instance. > > We should adopt the same principle in a future RSpamD kook. > > Also we'd likely benefit from: > - SMTP hooks for james rate limiting > - An analysis of what makes RSpamD rate limiting more advanced than James' > one (I'm curious!) > > Cheers !-- > > Best regards, > > Benoit TELLIER > > General manager of Linagora VIETNAM. > Product owner for Twake-Mail product. > Chairman of the Apache James project. > > Mail: [email protected] > Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal) > > > On Jul 8, 2026 3:40 PM, from Felix Auringer <[email protected]>Hey > Benoit, > > You're completely right, the soft reject action is worthless as a mailet. > There is already an experimental SpamAssassin SMTP hook. Do you think a > Rspamd hook might also make sense? > In addition to greylisting, Rspamd also has a more advanced rate limiting > mechanism than James. > The Rspamd tests always take less than 2s with my current configuration which > would probably not hit any timeouts. If that would be too much, one could > also use another rspamd instance that only has the ratelimiting and > greylisting modules and would be way faster. > > Best regards, > Felix > > On 7/7/26 12:51 PM, Benoit TELLIER wrote: >> >> Hello Felix >> >> <listener> <class>org.apache.james.rspamd.RspamdListener</class> >> <async>true</async> <configuration> <reportAdded>false</reportAdded> >> </configuration> </listener> >> Allows to unplug this undesirable behaviour: i think it shall be made the >> default. >> >>> The "greylist" and "soft reject" actions are not handled. >> >> Correct. >> >> greylisting makes no sens in a post queue set up. We can only greylist if >> running in the smtp stack. >> >> soft-reject and quarantine actions would be best handled as add-header IMO >> >> Do you want to contribute this?-- >> >> >> Best regards, >> >> Benoit TELLIER >> >> General manager of Linagora VIETNAM. >> Product owner for Twake-Mail product. >> Chairman of the Apache James project. >> >> Mail: [email protected] >> Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal) >> >> >> >> On Jul 7, 2026 12:10 PM, from Felix Auringer <[email protected]>Hey, >> >> I have some questions regarding the rspamd integration in James. >> >> Currently, when I move a message from my Spam folder to the Inbox, it is >> marked as ham twice: once because it was moved out of the spam folder in >> another folder that is not the trash folder and once because the message was >> appended to the Inbox. >> Is this desired behavior? The MailboxEvents.Added object has a method to >> check whether the email was delivered (or moved). Additionally checking this >> would make more sense to me. >> >> James distinguishes the following six actions: "no action", "greylist", "add >> header", "rewrite subject", "soft reject", "reject". >> I tested that James successfully handles the actions "no action", "rewrite >> subject" and "reject". >> For the latter two and "add header", James also sets two headers and marks >> them so that they can be moved to the spam folder if desired. >> The "greylist" and "soft reject" actions are not handled. >> >> However, Rspamd emits different actions: "discard", "reject", "rewrite >> subject", "add header", "no action", "soft reject", "quarantine" >> (docs.rspamd.com/configuration/metrics#introduction). >> We would especially be interested in the "soft reject" action to implement >> greylisting. Additionally, rspamd returns a list of headers it wants to >> remove / add. I think honoring those would also be benefitial. >> Would you be open for contributions on these topics? >> >> Best regards, >> Felix >> --- >> Gesellschaft für interkulturelles >> Zusammenleben gGmbH (GIZ) >> Felix Auringer >> IT >> Reformationsplatz 2 >> 13597 Berlin >> >> Tel: 030/513 0100 00; Fax: 030/513 0100 09 >> giz.berlin; [email protected] >> >> Amtsgericht Charlottenburg HRB 200872 B >> Geschäftsführerin: Dr. Britta Marschke >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >> > > --- > Gesellschaft für interkulturelles > Zusammenleben gGmbH (GIZ) > Felix Auringer > IT > Reformationsplatz 2 > 13597 Berlin > > Tel: 030/513 0100 00; Fax: 030/513 0100 09 > giz.berlin; [email protected] > > Amtsgericht Charlottenburg HRB 200872 B > Geschäftsführerin: Dr. Britta Marschke > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > --- Gesellschaft für interkulturelles Zusammenleben gGmbH (GIZ) Felix Auringer IT Reformationsplatz 2 13597 Berlin Tel: 030/513 0100 00; Fax: 030/513 0100 09 giz.berlin; [email protected] Amtsgericht Charlottenburg HRB 200872 B Geschäftsführerin: Dr. Britta Marschke --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
