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)
Comments
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
I had a problem getting these errors in maillog:
fatal: setrlimit: Permission denied
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).
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
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
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.
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:
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!
How can i send email from a client with this setup? There is any way to authenticate the SMTP?