Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux account & sendmail account

Status
Not open for further replies.

inetd

Technical User
Jan 23, 2002
115
HK
Can I create a username like 'abc@hello.com' in linux system?
And, can I map a email account abc@hello.com to a user's account 'abc@hello.com'? i.e. If an email sent to abc@hello.com, the email is then sent to the user 'abc@hello.com'.

I am using RH8 and sendmail.

Thanks.
 
That is the way sendmail is setup by default. When you create a user on your system, that users username and password are what get checked when mail is popped. When mail is recieved it gets put into a file /var/spool/username. Where "username" is a user on your system. This single file will hold all that user's mail until they request it using a mail client such as OutLook. If you want a user to be able to send and receive mail through your server just as they would their isp, then you will need to setup relaying. To pickup mail from your server, you will need a pop3 server running. Most linux distros come with sendmail and one or more pop3 deamons. The only thing you need beyond setting up your mail servers, is to set up dns records so it can be accessed from the internet. I didn't go into much detail here because there is a forum just for sendmail here at tek-tips.
 
Sorry, I think I state my question unclearly.
My questions are:

1. Can I create a linux user who's name is 'abc@hello.com'?

2. If question 1 is possible, can forward an email to that user while the email is sent to abc@hello.com? That's something like the entry in /etc/aliases.
i.e. Someone sends a email to abc@hello.com.
The sendmail will check whether the system has a user 'abc', however I want this email to be forwarded to the user 'abc@hello.com'.

Thanks.
 
I still don't understand what you want. If you host the domain hello.com and dns points to your server, all mail with *@hello.com will come to your server. If you have a user on your system with the name abc, then mail for abc@hello.com will come to your server. If you do NOT have control of this domain name, no mail for that domain will ever come to your server. The way you asked the question, it sounds like you want mail that comes into your server for abc@hello.com to be forwarded to abc@hello.com. This is what doesn't make sense to me. If you have a real user named abc and want names like webmaster, info or sales to go to abc, then you would use aliases or virtusertable. Virtusertable is like asiases but lets you do more. For example, you can forward mail for a user, e-mail address, domain or ip to a different user, e-mail address, domain or ip. Sorry I'm having so much trouble understanding your question.
 

To me it looks like he wants a user named 'abc@hello.com' *litteraly* and this *user* would be forwardet to the domain hello.com where there is a user named abc.

You can't do that. You need to own the domain hello.com to make this work properly.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Thanks Mosrsing for making my question more clear. But what I want is in the reverse way:

1. I have own a domain, say hello.com, and have correct dns setting for that domain.
2. I want all the email going to abc@hello.com will be forwarded to the user named 'abc@hello.com'.
3. Yes, Morsing is right, the user is named 'abc@hello.com' *litteraly* in the linux system.

Is it possible?
How can I do that?

Thanks.
 
Are you hosting multiple domains on one server?
If not, then why would you want the [tt]@hello.com[/tt] part in the username? //Daniel
 
You can't do that. If you have a user 'abc' and your domain is hello.com, abc will get all the mail for abc@hello.com. SMTP won't allow what you are asking because the e-mail address would be abc@hello.com@hello.com.
 
Yes, I want to host multiple domains on one server.
How can I do that?
 
You need to have authority to modify the DNS records of each domain you want to host. If these domains belong to you, there is no problem, If they are clients or friends, then you need to have them make the changes. This is what needs to be done for each domain. Create an "A" record for the mail server. All this does is point a mail server's name to an ip address just as you would for any other sub-domain. Let's say you choose mail.yourdomain.com for the name. All you have to do is give it the ip address of the machine the server is on. All domains you want to host will have the same ip. Then you need to create an "MX" record for that domain. This just says that mail.yourdomain.com handles the mail for yourdomain.com. Now for users to be able to send and receive mail through your server, you need to create a system account for them with a user name and password. If they will not have login accounts then they won't need a home directory or shell. Users will use the mail server's name you assigned to their domain for both the smtp and pop3 servers and will use their system name and password for their mail clients.
 
Thanks RhythmAce, but I know all the above you mentioned and I have done it before.

My question is: How to host multi domains on signal linux box and may have same user name but are different users?
i.e. john@mydomain.com, john@yourdomain.com
They are different users.

 
I suggest that you use either a prefix or a suffix for the domain. Like [tt]john@mydomain.com[/tt] might have the username [tt]mjohn[/tt] and so on. When you have created the users, you should then setup a virtual user table (usually located in [tt]/etc/mail/virtusertable[/tt]). When you are done editing it, you should rebuild the database with the command [tt]makemap /etc/mail/virtusertable.db < /etc/mail/virtusertable[/tt] (change the paths if neccessary). //Daniel
 
OK - Now I understand. All users on your system must have a unique name. For common names such as webmaster, sales or info, you would have to use the virtusertable. It would look like this:

webmaster@domain1.com joe
webmaster@domain2.com john

The name on the left does NOT have to have an account on your system but it must resolve to a real user, outside e-mail address or domain.
 
Thanks danielhozac, your suggestion is great but there is another question:
When the users john@mydomain.com and john@yourdomain.com want to check their mails from pop3, how can they use their own name to login like john or john@mydomain.com and john@yourdomain.com?

Thanks.
 
You can't have the user name john for two people. Each user name must be unique on your system. Secondly, when mail is sent or poped from you server, everything after the username part of the address is stripped off. So just the user nmae and password are checked. If the user is authenticated, the mail is processed. To be able to have multiple users with the same name, you would have to buy something like iMail or Communigate Pro which are going to cost anywhere from $400 to $59,000 depending on how many users you want to buy the license for. There are some free programs out there that use their own databases so you can have duplicate names with multiple domains such as VxMail. It claims to work with RedHat and debian but I couldn't get it to compile. The docs and website are in German so I can't tell you how it works. Sorry for having so much trouble understanding your question.
 
There are several POP3 daemons that allow virtual users. I am personally working on one right now, since the one I used (vdpop3d) seems to have vanished off the internet. //Daniel
 
If you come up with something, can you post it in the sendmail forum? I thought of trying from the pop side but since the pop3 protocol only authenticates the username/password and pops the mail in /var/spool/mail/username, that it wouldn't work. It will send everything in that file. There would have to be a way to split these files before they get put into that single file. It seems the people who figured it out, want all my money to tell me how they did it. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top