I can reproduce this by sending a message to "[EMAIL PROTECTED]". (Yes, that domain is mine.) A hand-telnet'ed SMTP session looks like this:
220 m1.dnsix.com ESMTP Exim 4.24 Sat, 17 Jan 2004 01:24:44 -0800 helo thames.dnsalias.org 250 m1.dnsix.com Hello thames.dnsalias.org [67.112.120.26] mail from: <[EMAIL PROTECTED]> 250 OK rcpt to: <[EMAIL PROTECTED]> 550 unrouteable address quit
Here's what the various James logs say when I spool my VERPed message through James:
==>
james/james-2.2.0a15/apps/EmailNow2/logs/mailet-2004-01-17-00-59.log <==
17/01/04 01:41:24 INFO James.Mailet: RemoteDelivery: Attempting
delivery of Mail1074332484416-10-to-profitfrompeace.org to host
m1.dnsix.com. to addresses [EMAIL PROTECTED]
17/01/04 01:41:25 INFO James.Mailet: RemoteDelivery: Permanent
exception delivering mail
(Mail1074332484416-10-to-profitfrompeace.org:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
class javax.mail.SendFailedException: 550 unrouteable address at
com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:926)
at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:389)
at
org.apache.james.transport.mailets.RemoteDelivery.deliver(RemoteDelivery.java:346)
at
org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:797)
at java.lang.Thread.run(Thread.java:534)17/01/04 01:41:25 INFO James.Mailet: RemoteDelivery: Sending
failure message Mail1074332484416-10-to-profitfrompeace.org
17/01/04 01:41:25 INFO James.Mailet: ReplyHandlerMailet: Handling
reply:
[EMAIL PROTECTED]
17/01/04 01:41:25 INFO James.Mailet: ReplyHandlerMailet: this reply
is actually a bounce
17/01/04 01:41:25 INFO James.Mailet: ReplyHandlerMailet: state:
transport
17/01/04 01:41:25 INFO James.Mailet: ReplyHandlerMailet: changed
recip to:
[EMAIL PROTECTED]
17/01/04 01:41:25 INFO James.Mailet: BounceHandlerMailet: bouncing
all: [EMAIL PROTECTED]
==> james/james-2.2.0a15/apps/EmailNow2/logs/james-2004-01-17-00-59.log <== 17/01/04 01:41:25 WARN James: Mail to be bounced does not contain a Return-Path header.
I wrote both ReplyHandlerMailet and BounceHandlerMailet. When I first wrote the former, I noticed that some badly addressed emails were marked in the database as replies. After I figured out that these fast fails were getting sent to the Reply-To: address, I added a tweak in the ReplyHandlerMailet to check the From: field of the bounced message for the James postmaster. If found, then I change To: header of the message from reply.blahblahblah to owner.blahblahblah and skip normal reply handling. Next in the chain is the BounceHandler mailet which notices the owner.blahblahblah To: header and records a bounce record in the database.
Lastly, I don't know why I'm always getting the "Mail to be bounced does not contain a Return-Path header".
-- Bosco
