On 4/11/07, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
robert burrell donkin ha scritto:
> On 4/10/07, Norman Maurer <[EMAIL PROTECTED]> wrote:
>> Hi Robert,
>>
>> I don't know very well the fetchmail code by i think there is no special
>> handling...
>>
>> I think the best solution whould to just deliver the message to the
>> "normal" mailbox if such an error happen.
>
> that sounds very reasonable
>
> injecting an error transport sounds like a natural approach to the
> coding. can anyone think of a better way?
Can you elaborate?
see below for code illustration
(I agree with Norman that SMTP and Fetchmail should not deserve
different solutions)
i think i need to elaborate a little. the circumstance that worries me
is when the IMAP implementation cannot store a mail (this happens once
or twice a week for me). i don't want that mail bounced (as happens in
the current code). i need to direct the mail to a more reliable
storage mechanism or just log it.
i don't really understand how JAMES understands which users should use
IMAP and which the standard storage mechanisms. i would prefer to look
at all storage mechanisms just as message sumps defined by an URL but
i'm not sure how well this concept maps to JAMES.
- robert
Index:
spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
===================================================================
---
spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
(revision 525589)
+++
spoolmanager-function/src/main/java/org/apache/james/transport/mailets/sieve/SieveToMultiMailbox.java
(working copy)
@@ -77,6 +77,8 @@
private boolean resetReturnPath;
private MailboxManagerProvider mailboxManagerProvider;
+
+ private MailErrorHandler mailErrorHandler;
/**
* Delivers a mail to a local mailbox.
@@ -148,15 +150,7 @@
}
if (!errors.isEmpty()) {
- // If there were errors, we redirect the email to the ERROR
- // processor.
- // In order for this server to meet the requirements of the SMTP
- // specification, mails on the ERROR processor must be returned to
- // the sender. Note that this email doesn't include any details
- // regarding the details of the failure(s).
- // In the future we may wish to address this.
- getMailetContext().sendMail(mail.getSender(), errors,
- mail.getMessage(), Mail.ERROR);
+ mailErrorHandler.handleMailError(errors, mail);
}
// We always consume this message
mail.setState(Mail.GHOST);
@@ -273,5 +267,10 @@
MailboxManagerProvider getMailboxManagerProvider() {
return mailboxManagerProvider;
}
+
+ public interface MailErrorHandler {
+ public void handleMailError(Collection errors, Mail mail);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]