Posted By:
Christopher_Koenigsberg
Posted On:
Tuesday, September 3, 2002 07:37 AM
If you are talking about making the smtp server refuse incoming mail supposedly to or from a given address, then you have to edit the smtp server configuration. That's got nothing to do with the JavaMail API.
Once the smtp server accepts an incoming message, it delivers it, dropping it off, to your mailbox. And then you need a pop or imap client, to do anything further with it.
If you are talking about a pop or imap client automatically deleting messages with a given return address, off the pop or imap server, then that is something for the JavaMail API...... check the return address, and delete the message if it is one you don't want.
Of course most spammers nowadays fake the "From:" and "Reply-To:" header fields, and the envelope MAIL FROM field is usually bogus too. They usually have spamware that randomly rotates all the return address fields anyway so you can't match future ones based on what they sent you in the past.