Operating System - Linux
1825775 Members
2306 Online
109687 Solutions
New Discussion

The creation of e-mail account

 
SOLVED
Go to solution
Ng King Wang
Respected Contributor

The creation of e-mail account

Hello all,

I am going to set up a mail server. Can anyone tell me how can I create e-mail account for users?

Or where can I get related guides?

Thanks in advance. :)
We master OpenView, my Lord masters us.
12 REPLIES 12
U.SivaKumar_2
Honored Contributor

Re: The creation of e-mail account

hi,
I assume that you going to setup linux as a mail server. In that if you just create a user
the mailbox directory is also created by linux under /var/spool/mail.
eg:- For root user - /var/spool/mail/root
For receving mails some MTA mail transfer agent
has to be run in linux eg. sendmail. users should included in /etc/aliases file also.
For sending mails users login and use MUA (mail
user agents ) eg. mailx , elm , pine etc . And
the outgoing mails are queued for processing in /var/spool/mqueue directory.

regards,
U.SivaKumar
Innovations are made when conventions are broken
I_M
Honored Contributor

Re: The creation of e-mail account

Hi

Use "useradd" command to create the user account.

Then if you don't want your user to login to the server, modify the login shell to /dev/null.

Regars,

Penona Chan
New Member

Re: The creation of e-mail account

Has this been resolved yet?
Seek and ye shall find.
Ng King Wang
Respected Contributor

Re: The creation of e-mail account

Not yet. Any idea?

Thanks :)
We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor

Re: The creation of e-mail account

Do you mind telling us how masanari iida's post didn't help?

Giving us some more details as to what you've tried and what you're trying to achieve would also help!
One long-haired git at your service...
Ng King Wang
Respected Contributor

Re: The creation of e-mail account

Hello,

My company has a registered domain name. For example, abc.com.hk

After setting up a RedHat Linux e-mail server,
how can I create e-mail account for a user Peter? For example, peter@abc.com.hk

Thanks :)
We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor

Re: The creation of e-mail account

Ok, in terms of the account creation, you've issued:

useradd peter

And that part went ok?

Other than that, you're looking at DNS, and MX targeting in order to get mail sent to your Linux box (where ever it happens to live on the Internet), and then a small bit of Sendmail configuring in order for it to accept mail destined for 'abc.com.hk' (modifiecations to /etc/mail/* files).

If you require more details, then so do we. We'll need to know what distribution and verison of Linux you've installed, and beyond that the real Domain name (so we can check MX targets to ensure they are correct).
One long-haired git at your service...
Ng King Wang
Respected Contributor

Re: The creation of e-mail account

Hello,

Linux 7.0 is used.

You mean I must use command "useradd" to add a user account first. Then, I can do configuration on /etc/mail/* files. That's all? Any RedHat webpage teach us to do this?

Lastly, what is MX target?

Thanks :)
We master OpenView, my Lord masters us.
Stuart Browne
Honored Contributor

Re: The creation of e-mail account

Yes, 'useradd' is all that's required to create an account that can accept email sent to the machine.

I'm not sure if any RedHat pages are available that can tell you exactally what to type and where to type it. Usually just modifying /etc/mail/access is sufficient. If you do a search through RedHat's support site, or look at http://www.tldp.org/ (previously known as 'linuxdoc.org'), you should be able to find sufficient material.

*blink*

Don't know what an MX target is? Ok. Who or what is going to be accepting the mail for the domain 'abc.com.hk'? Is it going to be this linux box, or is it going to be your Service Provider (or someone else upstream from you)?

If it's you, then I think you need to have a crash course in DNS, and mail targets.

MX is what's known as a "Mail Exchange" target. Basically, for a given host or domain, it says what machine accepts the mail. Using command such as 'nslookup -q=mx ', or 'host -t mx ' tell you what settings are currently in place, the lowest priority number being the primary mail server.

i.e.

# $ host -t mx hp.com
hp.com mail is handled (pri=30) by smtpx.hp.com
hp.com mail is handled (pri=50) by atlsmtp.hp.com
hp.com mail is handled (pri=50) by palsmtp.hp.com
hp.com mail is handled (pri=10) by smtp.hp.com

This states that 'smtp.hp.com' is the primary mail server for all 'user@hp.com' addresses.
One long-haired git at your service...
Ng King Wang
Respected Contributor

Re: The creation of e-mail account

Thank you all,

My colleague and I will try to configure mail server again. Hope we can do it successfully.

Thanks again. :)


We master OpenView, my Lord masters us.
U.SivaKumar_2
Honored Contributor
Solution

Re: The creation of e-mail account

hi ,
1) create users using useradd with a valid home
directory. eg . /home/siva etc.
2) check whether their mail boxes are created
under /var/mail eg /var/mail/siva.
3) configure elm or pine mail user agents or use simple mail to read mails.
4) log in as a user and send a mail to root
#mail root
5) now login as root and check for that mail.
#mail
6) if this is ok . edit /etc/sendmail.cf file
and add your domain , hostname , alias in any
to Cw macro.
7) Restart the sendmail.
8) Create DNS records for this linux server in your DNS server and also Configure MX record in DNS server for you domain which point to the linux server. Now restart DNS service.
9) Now from some other linux server having DNS resolver with above DNS server configured. send a mail to root
#mail root@yourdomain.com
This should query the DNS server for MX record of yourdomain.com which is your linux server and deliver the mail to root's mailbox. Which
can be read after you login as root
#mail

regards,
U.SivaKumar
Innovations are made when conventions are broken
Ng King Wang
Respected Contributor

Re: The creation of e-mail account

Great,

My colleague and I need clear procedure step by step.

Thank you for your help. :)
We master OpenView, my Lord masters us.