Hi all, I'm building a system that uses the James SMTP server to send and receive messages. I intercept these messages with a custom mailet and feed them into my system. However, when it comes to sending mail through the SMTP server, there's a bit of difference.
My users have an email address, which is configured in a database, I have a custom UserRepository that handles the verification of addresses. However, because users never login to James/IMAP directly, there's no real concept of a "password". This means I can't use conventional authentication, but I can't close off port 25, because I won't get incoming mail, but, obviously, I don't want to have an open SMTP relay running. What I'm looking to do is configure my mailets such that, if a message is destined for remote delivery (i.e. is an outgoing message) that the SMTP server only allows such a delivery if the request originated from the same machine that the SMTP server is running on. I'm not sure how (or, even, if) I can get this information from the Mailet/Matcher API - I think I'm more in Matcher territory than Mailet territory - but the Matcher still only has access to the Mail object, and I think I'm probably a bit lower-level than that. Can/should I run two SMTP instances, one for incoming and one for outgoing? Can they have different Mailet chains? Not sure how best to achieve this! Martin
