• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

newbie to unix needs help with email

Hi all,

just have a question about setting up email accounts on unix systems. I am assuming that there is a way to automatically setup user email accounts based on an automated event, like a new user signing up. Is this possible? Is it a native function of the email application being used on the unix server? What tools do people recommend to perform this task?

I really appreciate any help someone would be willing to give me.

  • 4
  • 3
  • 3
2 Solutions
To setup a user's email account all you need to do is to add the user to the system.

In *nix system, all users have email account. to add a user you can use the "useradd" command. If you want to write a script to add user account, have a look at:


PS: You might have GUI tool in your system for adding user etc, (eg Solaris - admintool,
      HP-UX-- sam, SCO -- scoadmin ......)

To setup a mail server, you can setup sendmail (if you mail already working, someone
already done it for you):

have sendmail FAQ and tips:

>  To setup a user's email account all you need to do is to add the user to the system.
hmm, agreed if "systems" means MTA
Reige01Author Commented:
Hi, thanks for your replies but what I was really after is an automated way to add the email account. For example, someone comes to my website and joins up, enters a username and my system generates an email address based on the information supplied in the join up process without me having to manually add the account. Is this possible, and if so, how do the larger ISP's handle this sort of thing?

Thanks again for your help,

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

>>how do the larger ISP's handle this sort of thing?
    When a new user join up, they information is store in a database, they can use a script
to read the database and create the user account. they can use cron to read the database
and create user account once an hr, 4 hrs, a day etc.

   If the numbers of use is not the big for you, you can store the new user in for in a text
file, for email you only need loginname, real Name, password and store them in a text
   then use cron to run a script to rotate the newuser file to a temp area, and create the
user accounts.

   Have a look at the links in my previous comment to learn how to write the script read
infor from file/database and add users.

   Good luck!

> .. what I was really after is an automated way to add the email account.
you need a tool for that. Probably a handmade one ...

There're too less informations to give you a more detailled answer.
Reige01Author Commented:

thanks for your comments I will take a look at the other articles you posted previously.


What would you need to know to give me a more detailed answer?
which OS?
which MTA?
which authentication scheme (PAM, LDAP, etc.)?
which CGI-Language (perl, php, jsp, etc.)?
which authorization scheme (user for web server vs. root user)?
etc. etc.
Reige01Author Commented:
First up, this question was posted to get some ideas on the do-ability of this as decisions have been made only on some aspects of the project, and others are still in discussion. So, if someone has experience in one or more environments and wouldn't mind passing that on, it would be much appreciated. The more information someone provides, the better.

Ok well the OS will be UNIX, no specific flavour as yet defined, but whatever anyone has knowledge of would be brilliant.
The MTA is also in discussion, I quite like Qmail but some others are pushing for Sendmail, so that is also still up in the air.
PAM is the preferred authentication scheme although there are opponents to this as well.
JSP will be the interface language

This is all very sketchy because this is all very preliminary and I was just hoping to get some pointers and details of how it can be done. I thank you all for your help and look forward to reading anything someone might have to add to this discussion.
I'd suggest to use LDAP as authentication scheme 'cause you're more free to add and use other, even proprietary, fields (compared to traditional /etc/{passwd,shadow})

The only critical point I see is you JSP. I assume that you plan to register your user's using a web server.
Then you have to take care about a lot of things. And even more things if it should work automatically 'cause you need a program with root-priviledges somewhere.
Are you aware how to protect a web server, on the network using firewalls with DMZ etc., and on application level (your JSP) avoiding XSS, path traversal, command injection, etc. ?
Sounds like a lot of work.
It is a big job, you need to pick an  OS plaform, an authentication scheme, CGI-Language,
MTA before doing anything else.

I think you should break this question into a few pieces to get the details answer.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now