Noel,

> > org.apache.mailet.MailAddress throws a parse exception
> > proceessing the
> > following From: address...
> > <"nlt: Mail Administrator">
>
> What exactly is the exception?  Text and stacktrace context would be
> helpful.

OK. Changed the code to print a stacktrace and here it is...

javax.mail.internet.ParseException: Out of data at position 26
        at org.apache.mailet.MailAddress.<init>(MailAddress.java:173)
        at org.apache.mailet.MailAddress.<init>(MailAddress.java:199)
        at
org.apache.james.pop3mail.FetchPOP3Message.createMail(FetchPOP3Message.java:
149)
        at
org.apache.james.pop3mail.FetchPOP3Message.fetch(FetchPOP3Message.java:71)
        at
org.apache.james.pop3mail.FetchPOP3Folder.fetch(FetchPOP3Folder.java:68)
        at
org.apache.james.pop3mail.FetchPOP3Store.fetch(FetchPOP3Store.java:64)
        at
org.apache.james.pop3mail.FetchPOP3Mail.targetTriggered(FetchPOP3Mail.java:9
7)
        at
org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler.doRunEnt
ry(DefaultTimeScheduler.java:242)
        at
org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler.access$0
00(DefaultTimeScheduler.java:35)
        at
org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler$1.run(De
faultTimeScheduler.java:217)
        at
org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnab
le.java:90)
        at
org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:135)

The code that triggers this is...

        protected Mail createMail(MimeMessage message, MailAddress recipient)
                throws MessagingException
        {
                Collection recipients = new ArrayList(1);
                recipients.add(recipient);
>>>             MailAddress sender = new MailAddress(new
InternetAddress(message.getFrom()[0].toString()));
                return new MailImpl(
                        getServer().getId(),
                        sender,
                        recipients,
                        message);
        }

where >>> indicates the point the exception is thrown.

Incidentally, the package org.apache.james.pop3mail is a heavily refactored
version of org.apache.james.fetchmail with a bunch of enhancements and
corrections for obscure cases (such as this). I'll fold it back into
fetchmail once I have IMAP in and tested.

> > My reading of RFC 822 suggests that MailAdress is correct,
> > this is an invalid From: address.
>
> Reviewing the above, and Appendix A of RFC 2822, it would appear that
>
>   <"nlt: Mail Administrator">
>
> should be properly interpreted as a quoted local-part lacking
> a domain.  I
> do not see where the pseudo-BNF permits a missing domain.
> RFC 2821 section
> 4.1.2 says nothing different, other than adding that
> <postmaster> must be
> accepted without a domain, as the exception.

That's the way I interpreted it too. In short, a local-part without a domain
part is illegal.

I'ld like your thoughts on my second point regarding how strict James should
be on this. The email in question is the standard welcome email sent by a
major ISP in the UK. To be fair, I would guess that in 99.99% of cases this
email is read succesfully by a mail client. Rarely would an intervening MTA
enter the equation, though it is obviously sent by one. But such an email
>may< be introduced into James, as I have just discovered, in this case via
a fetchMail like route. What should James do with such a message? Propogate
it or reject it?

-- Steve



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

Reply via email to