Returns an arbitrarily selected mail deposited in this Repository that
is either ready immediately for delivery, or is younger than it's last_updated plus
the number of failed attempts times the delay time.
while addUser() is part of MailServer interface, a user cannot be tested for afterwards
at the same time, James allows to do exactly this via isLocalUser(), other implementations
might vary.
"OK" : we expect the mail to this recipient to be delivered
"KO" : we expect the mail to this recipient to fail
"NA" : the result is not predictable because of random behaviour, but we expect attempts.
Tests the org.apache.james.remotemanager.RemoteManager
TODO: impl missing command tests for:
USER
SHUTDOWN (hard to test, because it does shutdown the whole (testing) JVM
this is commented out due optimisation reverts (JAMES-559)
public void testDeferredMessageLoadingWhileWriting() throws MessagingException, IOException {
mw.setMessageLoadable(false);
assertEquals("foo",mw.getSubject());
assertFalse(mw.isModified());
mw.setSubject("newSubject");
assertEquals("newSubject",mw.getSubject());
assertFalse(mw.messageParsed());
assertTrue(mw.isModified());
mw.setMessageLoadable(true);
}
If I create a new MimeMessageCopyOnWriteProxy from another MimeMessageCopyOnWriteProxy,
I remove references to the first and I change the second, then it should not clone
If I create a new MimeMessageCopyOnWriteProxy from a MimeMessage and I change the new
message, the original should be unaltered and the proxy should clone the message.
Server rule string format:
id-rule.[*-userrule].[match*-userrule].string
- id-rule are for "connect"-time exceptions
- *-userrule are for "send"-time exceptions involving every mail (not depending on the recipients address)
- match*-userrule are for "send"-time exceptions involving specific recipients (starting with match - ** to match every address)
Available rules:
- me[v]: MessagingException
- sfe[v]: SendFailedException
- smtpafeXXX[v]: SMTPAddressFailedException with XXX returnCode
- smtpaseXXX[v]: SMTPAddressSuccededException with XXX returnCode
- smtpsfeXXX[v]: SMTPSendFailedException with XXX returnCode
- null: NullPointerException
- io: IOException (nested in a MessagingException)
- rpt: repeat the previous rule pattern
- (*) if a "mail" rule (one involving addresses) ends with "v" resulting in a "valid" address (the failure is about some other error: valid unsent)