Complete the e-mail setup: User accounts, DNS, and more

By John Locke, Special to ZDNet Asia
Thursday, August 07, 2003 12:01 PM

Once your new e-mail server has Courier-IMAP set up and running and you have a MySQL database to authenticate users, then you are well on your way to being finished with the project. But there are still a number of items you need to complete before your e-mail server is ready for prime time. For example, you’ll still need to configure Postfix to deliver mail to the correct mailbox, add the actual user accounts, and set up DNS entries to point to the new server. By the end of this article, your e-mail server should be fully functional.

Read the previous installments in this series
Catch up on the creation of this e-mail setup by checking out these articles:

Local delivery agents
Postfix comes with two local delivery agents (LDAs): local and virtual. The local LDA is used to deliver mail to UNIX user accounts. The virtual LDA doesn't care about UNIX users—it delivers to a mailbox in a designated location using any designated user ID (UID) and group ID (GID). You can configure Postfix to use different LDAs for different domains and even specify an LDA for specific e-mail accounts. You can use Procmail as an LDA, allowing you to apply all kinds of custom rules. But for now, I'm going to show you how to configure Postfix's virtual LDA to use MySQL to get its account information.

Configure Postfix to use MySQL virtual accounts
To get Postfix to use the same MySQL database to deliver to virtual accounts, you need to create three configuration files that map e-mail addresses to values. Each of these files contains the connection information for your MySQL server, the column that represents the e-mail address, and the column containing the result. I need one for the Delivery location, one for the UID, and one for the GID. The three code samples in these three sidebar links are examples of these connection files—create them with appropriate values for your installation. You can name them whatever you wish, but they must be owned by root and in a location where Postfix can read them.

The next task is to edit /etc/postfix/main.cf so the virtual delivery agent can use the values in the MySQL database to deliver mail. Table A lists the settings that should be changed.
Table A
Setting What it does Setting change
local_recipient_maps Designates which user accounts and domains are valid recipients for this server. Since you're going to have virtual users (users that don't have a real UNIX user account), set this to nothing. Otherwise, all of the mail for virtual users will bounce:
local_recipient_maps =
mydestination Designates which domains are handled by the local delivery agent. Since you are going to use the virtual delivery agent for all mail, you need to disable this setting or mail will bounce before reaching the virtual delivery agent:
mydestination =
virtual_mailbox_domains Lists the domains that are handled by the virtual delivery agent. Set this to the list of domains handled by this server:
virtual_mailbox_domains =
localhost.$mydomain
virtual1.domain
virtual2.domain
virtual_mailbox_base Base path containing all virtual mailboxes. Set this to the same value as the default “home” column in the database:
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_maps Maps e-mail addresses to directories. This is one of your MySQL maps:
virtual_mailbox_maps =
mysql:/etc/postfix/mysql_mailbox.cf
virtual_uid_maps Maps e-mail addresses to a UNIX user ID. virtual_uid_maps =
mysql:/etc/postfix/mysql_uid.cf
virtual_gid_maps Maps e-mail addresses to a UNIX group ID. virtual_gid_maps =
mysql:/etc/postfix/mysql_gid.cf
Here are the /etc/postfix/main.cf settings for virtual delivery.

After making these configuration file changes, reload Postfix by typing:
       # postfix reload

Next, check the mail log for errors. If you don't see any errors, Postfix should be using MySQL correctly to recognize incoming mail. Now you need to configure the operating system to support these user accounts.

2 Next 

WORTHWHILE?

0

0 votes
Save to my library  Save to My Library  
Blog

Talkback 0 comments

There are currently no comments for this post.

Cost and graphics concerns delay a VDI project

Tech Management

Virtual desktops are a serious paradigm shift and Scott Lowe is taking it in a slow and measured way. In this article, he provides an update on ongoing VDI efforts at Westminster College.


Read more »


Do we need more delivery centers?

Blog thumbnail

As I wrote a while back in about "racing to subsidies", there certainly is an increased focus by governments to attract delivery centers to their region. To do that, many..... by Michael Rehkopf

Read more »

Tech Jobs Now!


Tags

  1. antivirus
  2. apple ipod
  3. cnet networks inc.
  4. desktop
  5. e - mail
  6. hard drive
  7. intuit inc.
  8. mcafee inc.
  9. microsoft corp.
  10. microsoft windows
  11. microsoft windows vista
  12. microsoft windows xp
  13. norton co.
  14. pc
  15. performance
  16. security
  17. software
  18. tool
  19. web
  20. web site