Comments on Virtual Hosting with Postfix, part one

Version 1.0 Author: Joe Topjian <joe [at] adminspotting [dot] net> Last edited 04/11/2005 The virtual domain support in Postfix is actually quite robust. There are three different ways you host virtual domains with Postfix and they're all described here. We'll be looking at the third one: separate domains and non-unix accounts. Why this one? Because in the end, this options gives us the most flexibility. It's a little more complicated to set up and understand but well worth it when you're hosting several domains.

9 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anonymous

Joe you have done a tremendous job distilling this setup down to it's basic needs. I really appreciate your having done this text files as a DB really is overkill for most small applications.

Two comments:


1 - I would include a link to an MD5 crypter for the convenience of the true newbie

2 - I had to add the slug [34] after the password in the password field to tell dovecot it was MD5 encrypted.

Thanks,

bex

By:

I had a problem getting these errors in maillog:

fatal: setrlimit: Permission denied 

warning: process /usr/libexec/postfix/virtual pid 27055 exit status 1
/usr/libexec/postfix/virtual: bad command startup -- throttling

After disabling SELinux it works fine. Just posting this info in case anyone else runs across it.

By: madflojo

Sounds like some of your SELinux context isn't set right. I'd suggest checking that vs just disabling SELinux (unless you don't want to mess with SELinux anymore anyways).

By: Anonymous

As in the previous post, excellent tutorial Joe. I have to say, I went through this tutorial 5 times, step by step, and could not get it working. It appeared the SMTP service was up and running, and everything, but when I connected via telnet I got nowhere, it just seemed to hang the connection. Finally after going through the whole tutorial, I noticed something I missed (not once, but 5 times), and that was the creation of the valias.txt file. Of course, I had to actually go and read my mail log to find that little mistake (and I am kicking myself over and over and over for not doing that in the FIRST place). Anyhow, I am a complete idiot on that one.

The only thing I would suggest is a little expansion on the whole valias.txt file. I know you gave a quick example, and yes I can go through and read the docs to get more info on the 'virtual_alias_maps', but to make this tutorial more complete, it might help us newbies for a little more basic information on that file.

Also I wanted to ask, in regards to MySQL (or presumably PostgreSQL), you suggested small systems avoid using database functionality. I am working on small project that will allow the addition of mail and web hosts, DNS entries, and so on, via web interface (yes I know, I'm reinventing the wheel), but everything I have come across (such as Webmin, etc), seems to be overkill for my purposes. Anyhow, would it be worth while to move to a database rather than a flatfile for building a virtual domain / virtual user system? (again I am just starting to learn how all these server components fit together, and have a strong web programming background, very little in the way of administration)

Thanks

Aaron

By: Anonymous

Thanks! Great article- it was exactly what I needed to get up and running with very little knowlege of postfix/dovecot for an urgent project! ek

By: jktrigg

This has one serious problem -- as configured, outgoing mail from it will get blocked by many sites because it will send a HELO greeting of "localhost".  The myhostname parameter needs to be a fully qualified domain name.

By: Anonymous

Nice to read an article on the Internet that promises so much, yet left out so much detail.

e.g Further clarification is required here:

"The next two lines define an account we'll set up that will have permission to access the mailboxes. Yes, one account will have the ability to read all the virtual email. Yes, this can be considered a security problem. Please do your best to ensure no one can become this user. We'll call the account "virtual". Add it any way you want to the system (eg, useradd) and make note of it's uid and gid.

The final line specifies a text file where we can place aliases for virtual accounts. The contents looks like this:

 
Where does one add the line:  [email protected] [email protected]: ?  It s very unclear.
Does one create the user in the format:
or
useradd joe
If the latter, then how does the system differenciate between [email protected] and [email protected].
 
I would suggest using mysql or openldap for this.  Its far better organised and probably clearer.

By: Geert

Hi there,

First of all - great tutorial !  The steps were clear, but I may have overlooked something...  The server receives and sends mail just fine, but for some reason, the mails aren't being transported to the user's mail directory.  I presume that's the idea though ?

 

For example, I see 3 directories in /home/info/mail : new, cur and tmp.  Those are all empty.  However, I see the incoming mails for the info user at /var/spool/vmail/DOMAINNAME/info/new 

What did I forget during the configuration ...?

Thanks!

By: Andre

How can i send email from a client with this setup? There is any way to authenticate the SMTP?