You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by jason sackett <ja...@home.com> on 2001/10/16 20:20:35 UTC

Valid Recipient Username Check

I wrote a working mailet to check each recipient's domain for validity, but
I am also interested in the validity of the username portion of the email
address.
It seems that, for instance, I send an email using @home to a bad hotmail
address, @home responds with 'bad user', but JAMES is silent when sending to
the same recipient.
Where might I look for more info on adding functionality to JAMES to report
invalid usernames ala @home mailservers?

Thank you for any help,
Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by jason sackett <ja...@home.com>.
Thank you for the help.
I am getting the bounce now as well on my test server.
My production server is not getting it for some reason (it's not the error
config), but I think I have a handle on it now.

Jason

----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, October 17, 2001 9:27 AM
Subject: Re: Valid Recipient Username Check


> Ah, hotmail is in fact just rejecting the message outright during the
> delivery rather than accepting it and sending back a bounce message.
>
> However, I just tried to send the same message using a recent copy of
James,
> and this is what I get back (isn't this what you want??):
>
>
> Return-Path: <po...@mailhive.net>
> Received: from 216.7.13.80 ([216.7.13.80])
>           by mail.lokitech.com (JAMES SMTP Server 1.2) with SMTP ID 323
>           for <se...@lokitech.com>;
>           Wed, 17 Oct 2001 08:29:27 -0500
> Message-ID: <67...@rachmaninoff>
> From: postmaster@mailhive.net
> To: sergek@lokitech.com
> Subject: Re: test
> Mime-Version: 1.0
> Content-Type: multipart/mixed;
boundary="----=_Part_0_1305085.1003325652355"
> Date: Wed, 17 Oct 2001 08:29:27 -0500
>
> ------=_Part_0_1305085.1003325652355
> Content-Type: text/plain
> Content-Transfer-Encoding: 7bit
>
> Hi. This is the James mail server (we don't know where).
> I'm afraid I wasn't able to deliver your message to the following
addresses.
> This is a permanent error; I've given up. Sorry it didn't work out.
>
> po93939@hotmail.com
> Invalid Addresses;
>   nested exception is:
>  javax.mail.SendFailedException: 550 Requested action not taken:user
account
> inactive
>
> The original message is attached.
>
> ------=_Part_0_1305085.1003325652355
> Content-Type: text/plain
> Content-Transfer-Encoding: 7bit
>
> test
> ------=_Part_0_1305085.1003325652355--
>
>
> This seems pretty much the same...
>
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/
> ----- Original Message -----
> From: "jason sackett" <ja...@home.com>
> To: <ja...@jakarta.apache.org>
> Sent: Wednesday, October 17, 2001 9:10 AM
> Subject: Re: Valid Recipient Username Check
>
>
> > The returned mail from @home is pasted below (this is the kind of thing
I
> > need JAMES to do):
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Valid Recipient Username Check

Posted by Danny Angus <da...@thought.co.uk>.
Yeah, James does this for invalid local users and failed remote delivery,
*if* you run the notify sender and/or notify poster mailet correctly in the
error processor, and the sender/postmaster can be reached.
What James doesn't do is to check users against valid users when receiving
mail via SMTP (and hotmail and others do). This is because of the way James
handles mail.
d.


> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: Wednesday, October 17, 2001 2:28 PM
> To: james-user@jakarta.apache.org
> Subject: Re: Valid Recipient Username Check
>
>
> Ah, hotmail is in fact just rejecting the message outright during the
> delivery rather than accepting it and sending back a bounce message.
>
> However, I just tried to send the same message using a recent
> copy of James,
> and this is what I get back (isn't this what you want??):


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by Serge Knystautas <se...@lokitech.com>.
Ah, hotmail is in fact just rejecting the message outright during the
delivery rather than accepting it and sending back a bounce message.

However, I just tried to send the same message using a recent copy of James,
and this is what I get back (isn't this what you want??):


Return-Path: <po...@mailhive.net>
Received: from 216.7.13.80 ([216.7.13.80])
          by mail.lokitech.com (JAMES SMTP Server 1.2) with SMTP ID 323
          for <se...@lokitech.com>;
          Wed, 17 Oct 2001 08:29:27 -0500
Message-ID: <67...@rachmaninoff>
From: postmaster@mailhive.net
To: sergek@lokitech.com
Subject: Re: test
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_0_1305085.1003325652355"
Date: Wed, 17 Oct 2001 08:29:27 -0500

------=_Part_0_1305085.1003325652355
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi. This is the James mail server (we don't know where).
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

po93939@hotmail.com
Invalid Addresses;
  nested exception is:
 javax.mail.SendFailedException: 550 Requested action not taken:user account
inactive

The original message is attached.

------=_Part_0_1305085.1003325652355
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

test
------=_Part_0_1305085.1003325652355--


This seems pretty much the same...

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "jason sackett" <ja...@home.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, October 17, 2001 9:10 AM
Subject: Re: Valid Recipient Username Check


> The returned mail from @home is pasted below (this is the kind of thing I
> need JAMES to do):



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by jason sackett <ja...@home.com>.
The returned mail from @home is pasted below (this is the kind of thing I
need JAMES to do):

Return-Path: <>
To: jason.copytalk@home.com
From: Mail Administrator <Po...@home.com>
Reply-To: Mail Administrator <Po...@home.com>
Subject: Mail System Error - Returned Mail
Date: Wed, 17 Oct 2001 06:06:53 -0700
Message-ID:
<20011017130653.HBGG17681.femail24.sdc1.sfba.home.com@femail24.sdc1.sfba.hom
e.com>
MIME-Version: 1.0
Content-Type: multipart/report;
  report-type=delivery-status;
  Boundary="===========================_ _= 1991882(17681)1003324013"


--===========================_ _= 1991882(17681)1003324013
Content-Type: text/plain

This Message was undeliverable due to the following reason:

Each of the following recipients was rejected by a remote mail server.
The reasons given by the server are included to help you determine why
each recipient was rejected.

    Recipient: <po...@hotmail.com>
    Reason:    Requested action not taken: mailbox unavailable


Please reply to Postmaster@home.com
if you feel this message to be in error.

--===========================_ _= 1991882(17681)1003324013
Content-Type: message/delivery-status

Reporting-MTA: dns; femail24.home.com
Arrival-Date: Wed, 17 Oct 2001 06:06:51 -0700
Received-From-MTA: dns; chupacabra (24.182.147.218)

Final-Recipient: RFC822; <po...@hotmail.com>
Action: failed
Status: 5.1.1
Remote-MTA: dns; mc3.law13.hotmail.com (64.4.49.135)
Diagnostic-Code: smtp; 550 Requested action not taken: mailbox unavailable

--===========================_ _= 1991882(17681)1003324013
Content-Type: message/rfc822

Received: from chupacabra ([24.182.147.218]) by femail24.sdc1.sfba.home.com
          (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP
          id
<20...@chupacabra>
          for <po...@hotmail.com>; Wed, 17 Oct 2001 06:06:51 -0700
Message-ID: <00...@chupacabra>
From: "jason sackett" <ja...@home.com>
To: <po...@hotmail.com>
Subject: test
Date: Wed, 17 Oct 2001 09:06:46 -0400
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

test


--===========================_ _= 1991882(17681)1003324013--

----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, October 16, 2001 9:07 PM
Subject: Re: Valid Recipient Username Check


> It isn't really James responsibility to determine what valid users are on
> hotmail.  James (as with any mail server I know) sends the message to
> hotmail, and hotmail determines whether they're valid and sends a message
> back.  I don't know many mail servers that leave VRFY support on because
it
> potentially allows a simple bot to try numerous combinations and figure
out
> your email addresses without delivering any messages.
>
> Are you sure the messages you send using @home are from @home, or are they
> from hotmail?
>
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/
> ----- Original Message -----
> From: "jason sackett" <ja...@home.com>
> To: <ja...@jakarta.apache.org>
> Sent: Tuesday, October 16, 2001 2:20 PM
> Subject: Valid Recipient Username Check
>
>
> > I wrote a working mailet to check each recipient's domain for validity,
> but
> > I am also interested in the validity of the username portion of the
email
> > address.
> > It seems that, for instance, I send an email using @home to a bad
hotmail
> > address, @home responds with 'bad user', but JAMES is silent when
sending
> to
> > the same recipient.
> > Where might I look for more info on adding functionality to JAMES to
> report
> > invalid usernames ala @home mailservers?
> >
> > Thank you for any help,
> > Jason
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by Serge Knystautas <se...@lokitech.com>.
It isn't really James responsibility to determine what valid users are on
hotmail.  James (as with any mail server I know) sends the message to
hotmail, and hotmail determines whether they're valid and sends a message
back.  I don't know many mail servers that leave VRFY support on because it
potentially allows a simple bot to try numerous combinations and figure out
your email addresses without delivering any messages.

Are you sure the messages you send using @home are from @home, or are they
from hotmail?

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "jason sackett" <ja...@home.com>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, October 16, 2001 2:20 PM
Subject: Valid Recipient Username Check


> I wrote a working mailet to check each recipient's domain for validity,
but
> I am also interested in the validity of the username portion of the email
> address.
> It seems that, for instance, I send an email using @home to a bad hotmail
> address, @home responds with 'bad user', but JAMES is silent when sending
to
> the same recipient.
> Where might I look for more info on adding functionality to JAMES to
report
> invalid usernames ala @home mailservers?
>
> Thank you for any help,
> Jason
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by Serge Knystautas <se...@lokitech.com>.
RecipientIsLocal matcher has been in place since day 1... that's how James
determines whether to store it in local mailbox or to bounce it (as Danny
described).  Maybe you're thinking of a different use of RecipientIsLocal...
can you describe how you would use this?

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Jim Scott" <ji...@thehomefront.org>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, October 16, 2001 5:18 PM
Subject: Re: Valid Recipient Username Check


> I have been monitoring the conversation about valid local users and SMTP.
> Having a RecipientIsLocal matcher would be great.  I have considered
writing
> one, as have several others, but I have been procrastinating to see what
> others had done.
>
> This functionality should be included in the next release of James, and
> would make my life much nicer.  I have put off implementing James until
this
> functionality was available.



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by Oki DZ <ok...@pindad.com>.
On Tue, 16 Oct 2001, Jim Scott wrote:
> I have been monitoring the conversation about valid local users and SMTP.
> Having a RecipientIsLocal matcher would be great.  I have considered writing
> one, as have several others, but I have been procrastinating to see what
> others had done.

Well, Serge has done it long ago.
package org.apache.james.transport.matchers;

import org.apache.mailet.*;
import java.util.*;

/**
 * @version 1.0.0, 24/04/1999
 * @author Federico Barbieri <sc...@pop.systemy.it>
 * @author Serge Knystautas <se...@lokitech.com>
 */
public class RecipientIsLocal extends GenericRecipientMatcher {

    public boolean matchRecipient(MailAddress recipient) {
        MailetContext mailetContext = getMailetContext();
        //This might change after startup
        return
mailetContext.isLocalServer(recipient.getHost().toLowerCase())
            && mailetContext.isLocalUser(recipient.getUser());
    }
}

Oki



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by Jim Scott <ji...@thehomefront.org>.
I have been monitoring the conversation about valid local users and SMTP.
Having a RecipientIsLocal matcher would be great.  I have considered writing
one, as have several others, but I have been procrastinating to see what
others had done.

This functionality should be included in the next release of James, and
would make my life much nicer.  I have put off implementing James until this
functionality was available.



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: Valid Recipient Username Check

Posted by jason sackett <ja...@home.com>.
I have the notify sender uncommented so that my fakedomain mailet works.
And I thought of the xxxIsLocal for local users, but it's all about remote
delivery.
Does this mean that I need to write a mailet that does a manual remote
server connect and VRFY on each recipient in order to get the '550 no such
user' for a remote user?
That approach seems to be the job of JAMES rather than a mailet;  unless
there is an API accessable in the mailet that uses the core of JAMES (as a
mailserver) to find this 550 before JAMES gets it and swallows it.
Please let me know if I am way off base here.
I think I am getting the picture..
Let me know if this is correct:
Any error must be found in a configured mailet, or it is not found.
If no mailet can detect 550 before a remote delivery attempt then the error
is lost.

If that is true then I would imagine that someone must have a mailet that
does this.
Although I was surprised that I had to write my own 'RecipientInFakeDomain'
matcher.

Thanks for any help,
Jason

----- Original Message -----
From: "Danny Angus" <da...@thought.co.uk>
To: <ja...@jakarta.apache.org>
Sent: Tuesday, October 16, 2001 4:44 PM
Subject: RE: Valid Recipient Username Check


> Now I think I understand what you're saying..
>
> James will send your mail back to you with the specific error if you
> uncomment the NotifySender mailet lines in the error processor secion of
the
> configuration file.
>
> James won't respond "unknown user", and refuse to accept the mail during
an
> SMTP session, because it works by sending mails through the
Mailet/matchers.
> Perhaps this is a potential DOS vulnerability, I don't know.
>
> But the combination of RecipientIsLocal, and HostIsLocal will trap mail to
> unknown users in the local domain, and send it to the error processor.
This
> will then run its own set of matchers/mailets on the message, and respond
> however you want it to. notify sender and/or postmaster and/or store the
> mail in the error repository, destroy the mail, or anything else you might
> add.
>
> Adding new behavior is simply a matter of writing or using other matchers
> and mailets.
>
> d.
>
>
> > -----Original Message-----
> > From: jason sackett [mailto:jason.copytalk@home.com]
> > Sent: Tuesday, October 16, 2001 7:21 PM
> > To: james-user@jakarta.apache.org
> > Subject: Valid Recipient Username Check
> >
> >
> > I wrote a working mailet to check each recipient's domain for
> > validity, but
> > I am also interested in the validity of the username portion of the
email
> > address.
> > It seems that, for instance, I send an email using @home to a bad
hotmail
> > address, @home responds with 'bad user', but JAMES is silent when
> > sending to
> > the same recipient.
> > Where might I look for more info on adding functionality to JAMES
> > to report
> > invalid usernames ala @home mailservers?
> >
> > Thank you for any help,
> > Jason
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Valid Recipient Username Check

Posted by Danny Angus <da...@thought.co.uk>.
Now I think I understand what you're saying..

James will send your mail back to you with the specific error if you
uncomment the NotifySender mailet lines in the error processor secion of the
configuration file.

James won't respond "unknown user", and refuse to accept the mail during an
SMTP session, because it works by sending mails through the Mailet/matchers.
Perhaps this is a potential DOS vulnerability, I don't know.

But the combination of RecipientIsLocal, and HostIsLocal will trap mail to
unknown users in the local domain, and send it to the error processor. This
will then run its own set of matchers/mailets on the message, and respond
however you want it to. notify sender and/or postmaster and/or store the
mail in the error repository, destroy the mail, or anything else you might
add.

Adding new behavior is simply a matter of writing or using other matchers
and mailets.

d.


> -----Original Message-----
> From: jason sackett [mailto:jason.copytalk@home.com]
> Sent: Tuesday, October 16, 2001 7:21 PM
> To: james-user@jakarta.apache.org
> Subject: Valid Recipient Username Check
>
>
> I wrote a working mailet to check each recipient's domain for
> validity, but
> I am also interested in the validity of the username portion of the email
> address.
> It seems that, for instance, I send an email using @home to a bad hotmail
> address, @home responds with 'bad user', but JAMES is silent when
> sending to
> the same recipient.
> Where might I look for more info on adding functionality to JAMES
> to report
> invalid usernames ala @home mailservers?
>
> Thank you for any help,
> Jason
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Valid Recipient Username Check

Posted by Danny Angus <da...@thought.co.uk>.
This might be in RFC821, under VRFY, RFC1869 or RFC2034


> -----Original Message-----
> From: jason sackett [mailto:jason.copytalk@home.com]
> Sent: Tuesday, October 16, 2001 7:21 PM
> To: james-user@jakarta.apache.org
> Subject: Valid Recipient Username Check
> 
> 
> I wrote a working mailet to check each recipient's domain for 
> validity, but
> I am also interested in the validity of the username portion of the email
> address.
> It seems that, for instance, I send an email using @home to a bad hotmail
> address, @home responds with 'bad user', but JAMES is silent when 
> sending to
> the same recipient.
> Where might I look for more info on adding functionality to JAMES 
> to report
> invalid usernames ala @home mailservers?
> 
> Thank you for any help,
> Jason
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org