Ok, I've already got corrections. Need to wait 15 minutes before sending these...

Serge Knystautas wrote:
I got the proposal for SMTPACL and generally think it's very sound. I like the idea of using the mailet API, with certain restrictions.

There are two things I would suggest changing:
1. The name. ACL doesn't make sense as this isn't a list of anything. This is specific to SMTP, and in fact I might make it a bit more specific to SMTP...

Ideas: i. SMTPSession ii. SMTPTransaction

For example...

public class HostIsLocal
    extends GenericRecipientMatcher
    implements SMTPTransaction {

}

and

public class SetMailAttribute
    extends GenericMailet
    implements SMTPTransaction {

}

Note that I'm suggesting these get added to the Mailet API to define how mailets get used within the SMTP transaction.

2. The class/state structure. You need to be sure that both mailets AND matchers are aware that this is during an SMTP transaction and we do not have a MimeMessage. So I would do two changes:
a. class-wise, make an interface (probably empty interface) that declares that this matcher and mailet can be used in the <rcpt> tag, i.e., they don't care about the MimeMessage.

The implication of implementing this no-arg interface is:
i. you do not access mail.getMimeMessage() (the mail should throw an exception).
ii. a matcher does not return partial matches. This chain will need to get called after every single RCPT TO line, so you cannot fork processing (a nice benefit is that this makes this version of "LinearProcessor" a lot easier).


b. state-wise, just use the existing state/errorMessage fields. Instead of SMTPAccept, you just leave getState() as Mail.DEFAULT. Instead of SMTPReject, you do setState(Mail.ERROR) and setErrorMessage("550 cannot find MX for your domain").

Sorry, this is a bit more complicated. This is a bit more feasible...
i. mail.getState() returns Mail.INCOMING to start.
ii. If you want to accept it, you do mail.setState(Mail.DEFAULT);
iii. If you want to reject it, you do mail.setState(Mail.ERROR); mail.setErrorMessage("550 cannot find MX for your domain").


--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to