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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting up users for sendmail 1

Status
Not open for further replies.

wreikun

Technical User
Apr 23, 2002
63
0
0
US
hello. I have a question regarding sendmail and setting up mail spools for users on my linux server (turbolinux 6.5). Ive added users to my servers from the command line by entering the following:

useradd joe_schmoe
passwd joe_schmoe

this creates joe_schmoe's user account in the /home directory of the server. however, (on my server) it doesnt create a directory for them in the /var/spool/mail/ area where their incoming mail is kept until its pulled by some mail viewing program.

my question is: is there some kind of procedure of setting up a user so that it automatically creates a directory for their mail? or do i just mkdir joe_schmoe's mail file? and if i just mkdir this file, will sendmail put mail addressed to joe_schmoe in his dir (/var/spool/mail/joe_schmoe)?

any help appreciated. thanks

--REI
 
/ar/spool/mail/joe_schmoe is not a directory, it is a file. It is created when sendmail receives mail for joe_schmoe. All his mail is stored in this one text file but it isn't in the same format that your e-mail client converts it to. The e-mail client will connect to your pop3/imap server which will look in var/spool/mail for this file. If it is not empty, it will send the contents to the client which will in turn store the mail in the user's local mailbox. Before you can recieve mail on your server, you need a web accessible domain name. Your domain (sometimes called zone) has 2 dns records that you need to edit. The "A" record points your domain and sub-domains to an ip address. The "MX" record shows that the sub-domain mail.yourdomain.com handles the mail for your domain.com. Once you have these in order, all you have to do is assign mail.yourdomain.com as both the smtp and pop3 servers in the e-mail client (OutLook for example). If you are just using your mail server on a local network and not the internet, you can use your own dns server such as Bind to do the same thing.
 
Thanks for the help RhythmAce.
 
what if you already have all that set up, and all you want to do is create a new email user and have email ailiased to this new user.

Here's my scenario:
I have 7 users created in Red Hat Linux.
info, info2, info3, info4, supertech, webmaster and someuser.
The first four already have email going to them which is no problem. there is a webmaster@domainname.com which is actually routed to the someuser mailbox. I actually would like to have any email going to the current webmaster addresses (I have multiple domains) actually going to the webmaster user mailbox as well as creating aliases to go to the webmaster user mailbox. How do I do this. I'm not sure If I just need to edit some of the sendmail files and which one's or if i need to do something else? Also do I need to restart the sendmail service, and If so how do I do this without rebooting the server?

If you have solutions or point me in the right direction, I'd greatly appreciate it.

Thank You
 
You can do this one of 2 ways, with aliases or virtusertable. I think virtusertable is what you want since you have more than one domain on your system. Edit /etc/mail/virtusertable with your favorite text editor. If this file doesn't exist you can create it. More than likely, it's there but empty. The following is an axample of the format:

domain3.com you@domain1.com
info@domain3.com dude@domain3.com
domain2.com domain1.com

These are just a few examples. In the first, all mail for domain3 will go to a specified user at domain1. In the second, you have a virtual user (info which does not need a real account) to go to a specified address at domain3. In the last example, we are sending all mail for domain2 to domain1. In a nutshell, you have two columns. The 1st is a domain or e-mail address followed by at least one space then another domain or e-mail address. If you have a virtual user in the first column then it must resolve to a real user or domain on the left. I don't think sendmail stores this table in memory but looks at this file when mail comes in to see how to handle it so I don't think you need to restart sendmail.
 
thank you rhythmAce, unfortunately that didn't work. I have a user called: WebMaster. I want my email address to be webmaster@domain1.com, webmaster@domain2.com, etc... and they all go to the same account. I modified the genericstable file and the virtusertable file and then I set up my mail client and I can't receive email. Is there something else I need to do as well?


thank you
 
ok, I was able to test sending mail and I can send email from the webmaster account, but I can't receive mail. when I try to send mail from my netscape account to my WebMaster account, I get a an email at my netscape account saying, "returned mail: user unknown". I also check in the var/spool directory and the WebMaster file is not there. Is there something I need to do with the user to get it to work. I've changed the virtusertable and genericstable files and even restarted sendmail, but it still doesn't work. Does anyone have the solution?

thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top