PDA

View Full Version : Linux: How To Create Local Mail User?


Tanner8
07-12-2010, 11:03 PM
This might be the wrong section but I really couldn't find one that suites it any better, please move if you do.

I am running a linux box and CentOS installed on it. I am trying to install postfix by using this tutorial,

http://fedorasolved.org/server-solutions/postfix-mail-server

He tests the email with a local mail user. I can't for the life of me figure out how to create a local user account on linux. He does this,

"RCPT TO: <local-user@example.com>"

Then he can check the mail of that user. How do I create such an account through SSH and then check the mail on it? Should be pretty basic, however he never goes into it in the tutorial, it is under "Assumptions".

Thanks

Edit: Figured it out,

usr/sbin/useradd test

however no mail is being sent there when I do the test mentioned in the tutorial. I have no idea what is wrong..

jfreak53
07-13-2010, 01:36 PM
Ok real quick because I'm swamped with work this week. It's very simple. First off you have to configure your BOX. You have to setup a domain alias and hostname inside the NET config of linux. I won't go into it, just search it out on the net there is a lot on the subject. Then once your host info is setup, which is basically creating a domain, even though the domain might be internal only, or a hostname only without domain EXT, you just add users. Then when you send emails you send them to the username '@' hostname. That simple. You also have to have a mail program setup, like EXIM or postfix or another such one to actually route the mail inside your box. But it's quite simple, your just one step away from finishing, you need to setup your host.

Tanner8
07-13-2010, 08:28 PM
Do you mean I have to do what is mentioned here?

http://postfixmail.com/blog/index.php/virtual-domain-aliases/

Without doing this stuff I can login to squirrelmail with the user I made and send mail. I just cannot receive any. So if I do this I should be able to receive mail?

jfreak53
07-14-2010, 05:34 PM
No, that is a virtual alias, that is for like forwarding. What you want is outside your postfix program, you want to setup the linux box with a domain name, even though it might be internal domain name. It's called a hostname on a network. For instance, if I have 3 servers setup in a large 1K computer network, and devided into segments. I can assign, in the linux system, a hostname to each one. Then send email to users@hostname and each server will route it to the correct other server then each other server will route to correct mailbox. But you have to have a hostname for routing.
Just do some searching on setting up a mail server with linux and there are a lot of topics on it.

You'll always be able to log in, that's a given. Because the mailbox exists when you create a user, you could actually test it I think, if your program is setup right, and send to user@localhost and it should be delivered.

The thing your missing is the routing, for outgoing and incoming it needs somewhere to route it to, and if there is no hostname then there is no routing procedure.