This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes implementing email relay Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "implementing email relay " Watch "implementing email relay " New topic
Author

implementing email relay

azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Hi

I want to implement an email relay system, which works like the one in caraigslist.org

This is how it should work:
For every user, there is a email id created when the account signup is done.
real email id : smith@hotmail.com
created email id : 178644@mydomain.com
anyone who wants to email the user can send mail to 178644@mydomain.com and the server will relay it to smith@hotmail.com

How do i go about it?

I have qmail in my server.
[ August 28, 2006: Message edited by: azhar bharat ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Well, first of all you wouldn't use a servlet. Servlets process HTTP requests, but e-mail has nothing to do with HTTP.

What you do is this:

1. Set up an e-mail server that can receive e-mails at mydomain.com.

2. Make sure it's set up to reject as much spam as possible.

3. Program it so that when it receives a message for abc@mydomain.com, it finds out what real address that corresponds to and resends a copy of the message (presumably including the advertising that pays for your site) to that real address.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
For an open-source email server see the Apache JAMES project .
As I recall, mail generally gets discussed in the "Other API" forum.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Indeed, thusly moved.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
I dont think you guys understood what i meant.
The problem is I cant configure the mail server manually evertime a new user signs up. I want a way to do it programatically.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Originally posted by azhar bharat:
I dont think you guys understood what i meant.
I understood perfectly well what you meant.
The problem is I cant configure the mail server manually evertime a new user signs up. I want a way to do it programatically.
You're the one not understanding. When the user signs up you put their information in a database. When your server gets an e-mail for their alias, it looks in the database and forwards the message to their real address.
azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Originally posted by Paul Clapham:
When your server gets an e-mail for their alias, it looks in the database and forwards the message to their real address.


But how does my application know that a mail has arrived in the mail server?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: implementing email relay
 
Similar Threads
SCJP and SCBCD notes on PPT
Raising and event on the mail server
new to James Mail Server
Showing database rows as columns
File root config problem