Am Sonntag, den 27.08.2006, 14:46 -0400 schrieb Noel J. Bergman: > I like this addition, which is one that I've wanted for a while, but ... > > > + <!-- > > + <handler > > class="org.apache.james.smtpserver.core.filter.fastfail.ValidRcptHandler" > > command="MAIL"> > > + <validRecipients> </validRecipients> > > See below, but my thesis is that the user will exist either as a local user, > or has a valid mapping. We could leave this, I suppose, to support mappings > that are done via other than virtual user tables. > Exactly what it was designed for.. This configuration could be usefull for the "training" addresses of the BayesianAnalyzerFeeder. Just an example..
> > + <validDomains> </validDomains>
>
> We already know the valid domains, since we have already declared for which
> domains we accept mail. Document that these are domains for which we may not
> be able to know about valid addresses, e.g., for domains to which we simply
> forward, so we accept e-mail for ANY address at these domains.
>
Ok done here.
> > + <validRegexPattern> </validRegexPattern>
>
> We should add support for AbstractVirtualUserTable, which would mean allowing
> the configuration for XMLVirtualUserTable to what you already have for
> JDBCVirtualUserTable. See james-config.xml as well as the two mailets.
>
Ok will investigate on this.
> > + public void onCommand(SMTPSession session) {
> > + if (!session.isRelayingAllowed() && !(session.isAuthRequired() &&
> > session.getUser() != null)) {
> > + checkValidRcpt(session);
> > + } else {
> > + getLogger().debug("Sender allowed to relay");
>
> Huh? "Sender allowed to relay"? What does this have to do with relaying?
>
Changed the Debug message here
> > + private void checkValidRcpt(SMTPSession session) {
> > + MailAddress rcpt = (MailAddress)
> > session.getState().get(SMTPSession.CURRENT_RECIPIENT);
> > + boolean invalidUser = true;
> >
> > + if
> > (session.getConfigurationData().getUsersRepository().contains(rcpt.getUser())
> > == true
> > || recipients.contains(rcpt.toString().toLowerCase())
> > || domains.contains(rcpt.getHost().toLowerCase())) {
>
> Check to see if you are doing virtual user mapping, and map the user first;
> THEN do the check. And if there is a valid mapping, then I would consider
> that to imply a valid user for remote purposes, so that we don't have to deal
> with adding domains for mapped forwarding addresses.
>
Can you explain a bit more ? I not understand what exactly you want to
do.
> Hope these help.
Sure it does.
>
> --- Noel
>
bye
Norman
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
