Samurai Penguin's Lair
Ubuntu MailServer Part 1: Making Postfix and Dovecot play nice 
Friday, May 9, 2008, 11:41 AM
This is the first entry in a series on how to build out a stable, easy to manage, multiple-domain mailserver. I personally use this to host mail for my clients, and can say that it works quite well with no problems. Postfix is the SMTP server, handling remote deliver of mail, as well as accepting incoming mail and delivering it to user's mailboxes. Dovecot is responsible for accepting POP and IMAP connections, and reads mailboxes and sends them out. I'll explore a few different avenues and optional features you can add or remove. The original inspiration for this article is from the Ubuntu Wiki.


Installing Core Software


First, we'll want to install the core programs that will be our mailserver. To do this:

sudo aptitude install postfix mailx dovecot-common dovecot-imapd dovecot-pop3d whois

This may take a few minutes to complete.

Configuring postfix


Now, we'll tell postfix how we want it to work. First, we're going to tell it where to store mail, and how to figure out what mailbox belongs to what user. Add the following lines to /etc/postfix/main.cf:

home_mailbox = Maildir/
virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000


The virtual lines all imply that we're not applying a specific domain, but that it needs to read various files to find the user/domain names that it accepts mail for. Let's go ahead and create those files:

/etc/postfix/vhosts: Here, insert a list of all the domains you're hosting, each on its own line. For example:

example.com
example.net
samurai-penguin.com


and so on.

/etc/postfix/vmaps: Now we specify both the email addresses we host, and the paths to them. You should always use the domain.com/user paths to keep things straight. Example:

abuse@example.com example.com/abuse/
postmaster@example.com example.com/postmaster/
you@example.net example.net/you/


IMPORTANT: Make sure to postmap the vmaps file every time you change it so that postfix can use it. Run the following command to do this:

sudo postmap /etc/postfix/vmaps

Finally, we need to setup the mailbox user/group so that both postfix and dovecot can read the mail directories.

sudo groupadd -g 5000 vmail
sudo useradd -m -u 5000 -g 5000 -s /bin/bash vmail


Configuring Dovecot


For the dovecot configuration, there are a LOT of changes, so it's easier to simply copy over the configuration file. Download this file, backup your old /etc/dovecot/dovecot.conf file, and write this one.

Dovecot.conf

What this does, essentially, is make dovecot play by the same rules we just told postfix to play by as far as how to recieve mail, where to look, etc. We also tell it where to find it's username/password information.

Adding Users


Now it's time to actually create some users. This is a two step process(really 3). The first step is to add the domain name to postfix's /etc/postfix/vhosts file. If it's already there, then just skip that.

For sanity, take a look at the configuration formats for the dovecot users. In reality, you'll never have to touch these because we're going to automate the whole process.

/etc/dovecot/users
info@domain1.com::5000:5000::/home/vmail/domain1.com/:/bin/false::

/etc/dovecot/passwd:
info@domain1.com:$1$G/FqlOG5$Vj0xmc9fKY.UVr8OWr/7C1

As I mentioned, you can/should use this script to do it all for you. It takes care of adding the user to postfix and postmapping the config file, as well as setting the password for the dovecot user. Note that it doesn't actually create folders -- postfix will do that for us.

adddovecotuser

Copy this file to somewhere like /usr/local/bin, and make sure it's executable (chmod +x adddovecotuser). You have to run this script as root/sudo. To add a user:

sudo adddovecotuser user@domain.com

So long as the domain is in /etc/postfix/vhosts, that's it! You should now have a mailserver that can recieve mail for you. That's great and all, but there are still a few limitations which will be covered in subsequent HOWTO articles:

- No Spam Filtration
- No Blocklists
- No way to send mail from outside
- No Antivirus scanning
- No Webmail
Good luck, and feel free to post comments if you have any questions!
wow pl 
Wednesday, October 1, 2008, 08:12 PM
http://advantagepropertyllc.com/pblog/c ... 319-110835
wow pl 
Wednesday, October 1, 2008, 08:13 PM
How to distinguish between good and bad food in order to achieve "does not refuse to buy?" The first rule is:

I, "with nature":

1. To buy fruits and vegetables, will not purchase non-food fruits and vegetables of the season, which is rich in what season, which most fruits and vegetables to eat what the cheapest in no way to spend a lot of money to buy, stressing that the "greenhouse Culture," the first listing The fruits and vegetables; there to buy fruits and vegetables have been selected to make full grave-sweepers, the normal size, appearance does not seem so glamorous, the black and yellow of the yellow buy, how much can get to avoid excessive spraying of pesticides and to impose Too much fertilizer, as well as the bleaching of fruits and vegetables. For Taibai look, too, "perfectly clean" of fruits and vegetables, which may have been too much bleach or spraying pesticides, it is best to avoid buying food. In the peeled fruit, we must first clean, as in the fruit peel skin, the hand will be contaminated with pesticide on fruit skin. Bought vegetables, do not immediately put into the refrigerator, you can put out more "support" for a period of time, will allow the number of volatile chemicals that out.

world of warcraft power leveling

2. Do not even reduce the number of processing through the purchase of food, too, as well as "fine" food, such as pastries, bread, sprinkle Phi; Hamburg, fish balls, meatball, Rou Chang, dumplings, wonton, and other frozen food (inside Contain preservatives, the meat and meat will go wrong) ... and so on, as far as possible without eating too many machines or artificial processes "crude food" - not the thick wheat bran, brown rice; and restore old mother of the times, as far as possible their own To do hands-on food; or finds a reliable food stores to purchase.

world of warcraft powerleveling

3. Do not blindly believe in medicine make up: as much as possible to natural food to keep in good health, except from natural food intake difficulties, illness or need, therefore, do not spend a lot of money to buy stressed the "naturally take in food," or "children of the appetite to eat , The body stick "containing the vitamin or to emphasize the" efficacy "of the food.

Warhammer Online power leveling

4. Do not drink "colored" drinks: Coke is wearing intestinal drugs, often drink will be not only gastrointestinal corrosion, dental problems will be; cold store of strawberries, oranges, etc. .. taste of the beverage and are based on the transfer into a spice, Easy to eat carcinogenic; bottled tea is to put it bluntly, "Geye Cha," "Geye Cha" eat what is the harm caused to the body, each of the Chinese people know that; of bottled mineral water, often the source of its water problems, water way May not meet the health ... so the children from the hours he developed the habit of drinking water.

Warhammer Online powerleveling

Second, what goes into the food should not be kept cheap psychology: hypermarkets in the promotion of the sale of food, mostly expired or soon be some problems, if the deadline less than six months or a breakdown of the outer tanks, such as depression are the most Better not to buy; store's meat cooked food, not to buy as much as possible, because most of the time frame is not to sell to the fresh produce. To establish a "momentary greed to cheaper food injurious to health food, the cost of medicine is much more expensive than the money saved, the body also suffer".

warcraft power leveling

Third, does not recommend advertising star superstition, that qualified manufacturers, shops: the establishment of multi-absorption of some of the medical and health knowledge, in selecting food items, pay attention to food products labeled for ingredients and the date of the factory marked unknown who refuse to buy food. To develop a fixed selected reputable business or to buy food and dining habits, the old business customers will be more "conscientious."

warcraft powerleveling

Fourth, to develop a "Mind your own business" habits: the courage to expose black heart of goods, merchants, and to resort to justice, or the news media or public networks to be sanctions, so that businessmen dare not neglect the rights of consumers. If the Taiwan region by the government and not subject to corporate support, from all walks of life is totally, volunteer workers, housewives and so on ... the establishment of the "Consumer Foundation" to encourage every consumer be able to report to the Foundation Inform the black heart of goods, after that report is true go to the Foundation, through the news media and legal means to expose, sued the black heart of goods and claims for consumers, so that black businessmen to think twice, afraid to do whatever they want.

Comments 

Add Comment

Fill out the form below to add your own comments.









Insert Special: