1 Reply Latest reply on Jul 12, 2006 6:51 PM by gohip

    Delivery of Messages to non-existent users...

    gohip

      Hi all, I was under the impression, that the mail server, would reject email from another mail server, if the other mail server, was trying to deliver mail to an non-existent user. I thought this was being done during the "rcpt to" command, but this does not seem to be happening...what is happening, is that if the user doesnt exist, the message is not delivered. Is this correct?

      Or have I somehow, altered my mail server, so that it is no longer blocking mail to non-existent users, during the smtp session?

      If the mail server does allow it to pass through the SMTP session, and the mail server, then just does not deliver it, i.e. "unknown user". Is the message just "dumped", or is it deposited in the database...

      Wouldn't it be better, to not allow a sending mail server to deliver an email to a non-existent user during the SMTP session, i.e. during the "Rcpt to" command? I think this is what "other" mail servers do.

      Issue would then be, how do we look up users in database, from the SMTPProtocolInstance, or from the RcptTo Command?

      Should I just "snag" the code that already exists, that checks to see whether or not the user is an "unknown user"

      Any comments or suggestions would be greatly appreciated!

        • 1. Re: Delivery of Messages to non-existent users...
          gohip

          ehhh, yuck.

          Yeah, I guess the SMTP session "Rcpt to" command, is just verifying the domain is local or relayed, and not that the user has a mailbox.

          I determined, after some research, that SMTP command Vrfy, is supposed to verify the existence of the user, if the mail server supports the verify command.

          So was going to call verify command, if possible, from rcpt command.

          JBCS, does not, as of yet, support it(vrfy command), and may not ever as according to http://www.microsoft.com/technet/technetmag/issues/2005/11/HowITWorksSMTP/default.aspx

          "Many postmasters disabled this command early in the spam wars, since some spammers began using it to clean their mailing lists. Support in some form, however, is still required by the SMTP specification",
          thus it may not be wise to support it.

          I felt, that if I were to verify the user, during the SMTP sessions, that the place to do it, would be here, i.e. in the Vrfy command.

          So I got the Vrfy command working, by
          1. getting an instance of the MailBoxManger
          2. parsing the supplied request, to get the address
          3. converting this to an SMTPStyle Address
          4. then using that address in...
          5. mailbox = mailboxManager.getMailboxByAlias(address.getRawAddress()).getDefaultInFolder();
          6. same as localDelivery class does it.

          so it works, it does what I want, but now, I dont like it, as it neccessitates a transaction with/to database

          thus ever time a message was attempted for delivery, we would have to check the database, this seems slower, than to just ditch the mail, after receiving it from the other mail server, as we are currently doing. It seems mySQL, is the only thing that really slows the mail server down, other than doing DNS lookups.

          Could read a list of valid mailbox's into memory at startup, but would not be dynamic, ehh, i guess you could just add to list in memory, when adding new mailbox, but seems troublesome.

          I guess I will just hold off on this aspect of spam protection for now, but if anyone would like any help getting it going, based on the aforementioned approach, i.e looking up the user, when the mail server receives "Rcpt To: " command, let me know, as I have a version working.

          If anyone has any other, bigger, better, more efficient ideas, please let me know!