LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-01-2007, 10:55 PM   #1
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Rep: Reputation: 15
starting with postfix


Ok I haven't touched on mail servers at all.

I wanna get started with one.

I know how to run an ftp server and webserver. But i've never looked at mail servers.

I've decided though to start off with postfix.

I've got a no-ip domain (example1.serveftp.com)

How do I handle virtual users, and where do I begin with postfix and no ip.

Basically. How do I handle this stuff. Where do I begin?

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = debian01.vc.shawcable.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = S0106001839d6ad0b.vc.shawcable.net, debian01.vc.shawcable.net, localhost.vc.shawcable.net, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all


Here's my postfix config.
 
Old 02-01-2007, 11:17 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Step 1 is to get postfix running OK without any extras - virtual users, certificates, etc. You can then add these one at a time, checking along the way.

What do you mean by an no-IP domain? Do you mean that you have a domain but haven't set up a nameserver for it, or you have a dynamic IP? In either case you can use zoneedit.com or dyndns.com respectively.

Beyond that, have you looked at www.postfix.org? What's your distro, etc., etc..

Remember, the log files are your friend here - postfix tells you plenty when things go wrong

Last edited by billymayday; 02-01-2007 at 11:19 PM.
 
Old 02-01-2007, 11:26 PM   #3
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
No-ip takes care of the dns server.

S0106001839d6ad0b.vc.shawcable.net is my hostname.

And I put it in under the MX records.

I have looked under posftix.org, but I find a lot of the things confusing.

When they make a change they should show how it relates to the entire configuration. Not just a small section.

Anyway. I have to figure out how to "create" domains.

Like since my hostname is S0106001839d6ad0b.vc.shawcable.net and the domain i have with no-ip is example1.serveftp.com, how would the email domains look?

And how would I create them in the config.

Like test@example1.serveftp.com. would that qualify?

And how would I create that in the postfix config?
 
Old 02-01-2007, 11:31 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
And I assume that you will want to create a virtual domain like example2.serveftp.com next?

You need to be able to create an MX record for example1.serveftp.com first - can you do that?

Does email to someuser@S0106001839d6ad0b.vc.shawcable.net work at the moment through postfix (substitute a valid user)?

Does S0106001839d6ad0b.vc.shawcable.net point to your box?

Where exactly are you up to?

Last edited by billymayday; 02-01-2007 at 11:33 PM.
 
Old 02-01-2007, 11:34 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
ps - before I forget, don't put any virtual domains in your mydestination during the process
 
Old 02-02-2007, 01:48 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
gloomz, another question - have you read http://www.postfix.org/VIRTUAL_README.html?

You need to determine the basic type of setup you want - ie will you be using valid users, etc
 
Old 02-02-2007, 12:44 PM   #7
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
There is an mx record for example.serveftp.com

its my hostname example1.serveftp.com

What I'm looking for is email for the user's domain.

Like if the user is hosting www.yourmom.com on my server.

They need to have the email(s) user@yourmom.com

The only test i have done is to create another user on my debian box and email back and forth from the root account to a test account on the same box.
 
Old 02-02-2007, 02:06 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
OK, so postfix is working in basic form which is good.

By users, I meant users with accounts on the linux box. It doesn't really matter a whole lot, but valid users are a bit simpler.

What I'd suggestr is to get a basic virtual setup working without anything fancy like TLS or MySQL.

Have you tried following the examples on the virtual readme above?

When you say the MX for example.serveftp.com that's your hostname, do you mean an external MX that my mailserver would be able to find or one on your machine? I assume the former
 
Old 02-02-2007, 05:56 PM   #9
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
Yes the former is correct.

So how do I create email accounts (e.g. test@example1.serveftp.com

and how do I do simple virtual users.

I'm hoping not to create a system account for each user. Just out of security reasons of course.

Thanks a ton for the help. I totally appreciate it.
 
Old 02-02-2007, 06:36 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
OK, let's go.

Starting point is http://www.postfix.org/VIRTUAL_READM...irtual_mailbox as your guide.

Before you start, you will need to decide/do a couple of things.

1. Do you want mbox or maildir format mailboxes

2. Decide where you want the mailboxes. Typical would be something like /var/mail/vhosts/example1.serveftp.com/test

3. Create a user to access the virtual account. This user doesn't need to be able to login or have a home directory. You will need it's uid and gid later, so note it down.

4. Create the directory in step 2 above. Make sure it's owner/group is the one from step 3 (use chown to set it)

5. If you're using maildir, you may need to create some more directories. I use dovecot and have to pre-create new, cur and tmp directories under /var/mail/vhosts/example1.serveftp.com/test

6. Follow the steps in the guide url'ed above.

Note that you need to postmap /etc/postfix/virtual and vmailbox once you have created them

You should be able to send an email to test@example1.serveftp.com

Next you'll need to access the emails, but get them delivered first

Last edited by billymayday; 02-02-2007 at 06:39 PM.
 
Old 02-02-2007, 08:49 PM   #11
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
I hope this is right. Even though it was plain english, the guide was a little bit confusing.

And I don't really know how to chown. I went adduser test. And I think the uid and gid are 1001. So is this configuration right?


myhostname = debian01.vc.shawcable.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = S0106001839d6ad0b.vc.shawcable.net, debian01.vc.shawcable.net, localhost.vc.shawcable.net, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual mailbox domains = example1.serveftp.com
virtual mailbox base = /var/mai/vhosts/example1.serveftp.com/test
virtual mailbox maps = hash:/etc/posftifx/vmailbox
virtual minimum uid = 100
virtual uid maps = static:1001
virtual gid maps = static:1001
virtual alias maps = hash:/etc/postfix/virtual
 
Old 02-02-2007, 09:21 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
looks OK, but see below

Did you type

postmap /etc/postfix/vmailbox

and

postmap /etc/postfix/virtual

? Make sure you do this after changes to the files (only the one you change)

Also if you are creating a user "test", change

virtual_mailbox_base = /var/mail/vhosts/example1.serveftp.com/test

to

virtual mailbox base = /var/mail/vhosts

and make sure add the rest of the path in the file vmailbox as in the example -

test@example1.serveftp.com example1.serveftp.com/test

Note if you use maildir to add a "/" after "test"

If you copied and pasted the main.cf, check for typos because there are a few there )"mai", "posftifx")

Note there are underscores in all those virtual parameters (virtual_gid_maps etc.)

also, to chown, use

chown 1001:1001 /var/mail/vhosts/example1.serveftp.com/test

Might be worth posting vmailbox and virtual as well
 
Old 02-02-2007, 09:51 PM   #13
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
myhostname = debian01.vc.shawcable.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = S0106001839d6ad0b.vc.shawcable.net, debian01.vc.shawcable.net, localhost.vc.shawcable.net, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = example1.serveftp.com
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
virtual_alias_maps = hash:/etc/postfix/virtual


Am I supposed to create a vmailbox and virtual file? in the /etc/postfix/virtual directory?

Because I don't have them installed by default.

And thanks the chown worked.
 
Old 02-02-2007, 10:15 PM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
put them in /etc/postfix

they are just text files as per the examples. You create the databases with the postmap command
 
Old 02-02-2007, 10:51 PM   #15
gloomz
Member
 
Registered: Oct 2006
Posts: 137

Original Poster
Rep: Reputation: 15
Ok here's the first one

test@example1.serveftp.com example1.serveftp.com/test
# Comment out the entry below to implement a catch-all.
# @example.com example.com/catchall
...virtual mailboxes for more domains...

vmailbox

postmaster@example.com postmaster

That's the virtual

Now how do I create "databases" with the postmap.

Thanks a ton
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix not starting namit Linux - Software 2 12-27-2005 12:20 PM
Postfix not starting maginotjr Slackware 5 10-31-2005 08:01 AM
Starting Postfix: execvp: No such file or directory Mateo1041 Linux - Software 0 06-16-2005 10:03 AM
starting postfix dienerk Linux - General 1 10-24-2004 12:11 AM
starting postfix gives error kabads Linux - General 2 01-29-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration