Postfix Mail Setup
Postfix Mail Setup
Postfix Mail Setup
1. If you did not add postfix and system-switch-mail-gnome during the CentOS installation, you can add it now using
Package Manager tool.
By default, Sendmail is the active SMTP server. Here.s how to change it.
1. Click System, select Administration, and click Mail Transport Agent Switcher. This will launch the system-switch-mail
window.
Configure Postfix
1. Click Applications, select System Tools then click File Browser. This will launch the File Browser window.
2. In the Location field, type in /etc/postfix and press Enter. If you don't see the Location field, click the notepad button to
toggle to text-based location bar.
3. Double click on the file main.cf to open it for editing. We need to make it listen to network request, accept mails bound to
our domain and use maildir which is a better mailbox format than mbox the default.
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
home_mailbox = Maildir/
In main.cf, lines starting with # are comments. Save the file after completing your changes.
Note: Make sure that all mail_spool_directory lines are commented out. Otherwise, it will override the setting in the
home_mailbox line above.
Test Postfix
1. Click Applications, select Accessories, and click Terminal. This will launch the Terminal window.
Sample postfix session. Replace johndoe with any valid user account. The dot after the line test is a command that should be
typed in.
In Linux, new user accounts automatically receive mail accounts. Here are the steps for add ing a new user account in Red
Hat Enterprise Linux 5 and its derivative CentOS 5.
1. Click Applications then select System Settings and click Users and Groups. This will launch the User Manager window.
2. In the User Manager window, click Add User. This will show the Create New User window.
3. In the Create New User window, fill in the User Name, Full Name, Password and Confirm Password. Click Ok when
you.re done.
4. That.s it, you have just created a new user. To remove a user, select the user you want to remove and click Delete.
Don.t worry, you don.t have to type in the whole filename above. Just type in the first few characters say 118 then press Tab
to activate automatic completion.
test
[root@mail mail]#
NoteIf you encounter any problems, check the log file at /var/log/maillog.
ImportantBy default Postfix does not require authentication to send emails. This means any Tom, Dick and Harry that have
access to your network can use your SMTP server to send spam emails.
Install Dovecot
1. If you did not add dovecot during the CentOS installation, you can add it now using Package Manager.
Configure Dovecot
1. Click Applications, select System Tools then click File Browser. This will launch the File Browser window.
2. In the Location field, type in /etc and press Enter. If you don.t see the Location field, click the notepad button to toggle to
text-based location bar.
3. Double click on the file dovecot.conf to open it for editing. We need to change a few key items.
Lines starting with # are comments. The last two line enables workarounds for various client bugs. Save the file after
completing your changes.
Test Dovecot
1. Click Applications, select System Tools, and click Terminal. This will launch the Terminal window.
Sample dovecot session. Replace johndoe and password with any valid user name and password.
test
.
quit
+OK Logging out.
Connection closed by foreign host.
[zubzero@wmail ~]#
Note: If you encounter any problems, check the log file at /var/log/maillog.
SquirrelMail is an open source standards-based webmail package written in PHP. When installed, SquirrelMail is ready out
of the box. All it needs is an installed web server like Apache, SMTP server like Postfix, and IMAP server like Dovecot.
1. If you did not add Web Server and squirrelmail during installation, you can add it now. Using the Package Manager tool,
add the Web Server package in the Servers category. Also add the optional package squirrelmail located in the Mail Server
package under the category Servers.
Starting and stopping services is easy in CentOS 5. Both includes the Service Configuration tool which simplifies service
administration.
a. Click System, select Administration, select Server Settings and click Services. This will launch the Service Configuration
window.
b. In the Service Configuration window, check the service you wish to start on the next system startup, in this case the
service postfix. To start the service immediately, press Start.
Unchecked services will not be started on the next system startup. To immediately stop a service, select the service and
press Stop.
Testing SquirrelMail
1. Click the globe icon at the top near the System menu to launch the Firefox web browser.
If an error occurs, you probably did not install the Graphical Internet package. You can add it now using the Package
Manager tool.
2. In the address box, type in http://localhost/webmail and press Enter. Type in a valid username and password and click
Login.
If you are using Linux system accounts as your mail accounts, you can install the change_passwd plugin to enable
SquirrelMail to provide a password change utility.
2. Extract the downloaded files and put them into the /usr/share/squirrelmail/plugins directory.
3. From a Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press Enter. This will launch the
SquirrelMail Configuration utility.
5. Install the change_passwd plugin by typing in the number corresponding to it and press Enter. Do the same for the
compatibility plugin. When you are done, type in q and press Enter to quit then type in y and press Enter to save your
changes.
1. Login to SquirrelMail and go to the Options page. You should see the new Change Password section.
2. Click the Change Password link to view the new Change Password page.
This guide will show you how to integrate Active Directory/LDAP into the SquirrelMail addressbook. In this page, you will
learn how to configure SquirrelMail to activate the Javascript addressbook and to include your Active Directory or LDAP
server into the addressbook lookup list.
* cn - Common Name
* mail - Email Address
Configure the SquirrelMail Addressbook
We will be using the Perl based SquirrelMail configuration utility to configure the addressbook.
2. In the Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press Enter. This will launch the SquirrelMail
Configuration utility.
If your Terminal window has a white background, make sure that the colors are off by looking for the command Turn color
on. If the command is Turn color off, type in C and press Enter to turn the colors off. This will ensure that you will be able
to read all of the text.
4. Select the Javascript address book as the default by typing in 2 and press Enter then type in y and press Enter.
5. Add your Active Directory/LDAP server by typing in 1 and press Enter then type in + and press Enter. You will now be
asked a series of questions regarding your Active Directory/LDAP server configuration, see the sample session below.
Next, we need the server root (base dn). For this, an empty
string is allowed.
Example: ou=member_directory,o=netcenter.com
base: dc=acme,dc=local
This is the TCP/IP port number for the LDAP server. Default
port is 389. This is optional. Press ENTER for default.
port:
This is the name for the server, used to tag the results of
the search. Default it .LDAP: hostname.. Press ENTER for default
name:
You can specify the maximum number of rows in the search result.
Default is unlimited. Press ENTER for default.
maxrows:
If your LDAP server does not like anonymous logins, you can specify.
Default is none, anonymous bind. Press ENTER for default.
binddn: cn=mailuser,dc=acme,dc=local
If you are connecting to an Active Directory server, binddn can also be in the form of acme\mailuser or
[email protected]
You should now be back at the Address Books sub menu, type in q and press Enter to quit and type in y and press Enter to
save your changes.
2. Click the Addresses button (not the Addresses link). This will launch the SquirrelMail Addressbook window. Click the
List all button, you should now see your Active Directory/LDAP email addresses.
If you are querying a Windows 2003 Server and you are encountering an Operations error message, try enabling the
Windows 2003 Active Directory anonymous ldap operations.
If you are querying a Windows 2003 Active Directory, some query operations does not work. This is because certain
queries performs anonymous LDAP operations even if you have binded your connection. To fix this problem, you have to
implement the change specified in the Microsoft Knowledge Base at http://support.microsoft.com/kb/326690. The steps
below describes one way to implement this change using ADSI Edit included in the Windows Server 2003 Support Tools.
The Windows Support Tools are not automatically installed when you install Windows Server 2003. To install the Windows
Support Tools on a computer that is running Windows Server 2003, run the Suptools.msi program that is in the Support\
Tools folder on the Windows Server 2003 CD.
1. Click Start then click Run and type in adsiedit.msc. This will launch the ADSI Edit application.
2. In the ADSI Edit window, navigate to Configuration, CN=Configuration, CN=Services, CN=Windows NT and right click
CN=Directory Service and click on Properties.
4. Set the value of dsHeuristics to 0000002. If a previous value already exists, set the seventh character of the previous
value to 2.
Before using SquirrelMail, the user should first fill in at least the name and email address in the Personal Information
option. But we can eliminate this step by using the RetrieveUserData plugin to retrieve this information from a variety of
sources and automatically update this information.
2. Extract the downloaded file and put it into the /usr/share/squirrelmail/plugins directory.
3. From a Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press Enter. This will launch the
SquirrelMail Configuration utility.
If your Terminal window has a white background, make sure that the colors are off by looking for the command Turn color
on. If the command is Turn color off, type in C and press Enter to turn the colors off. This will ensure that you will be able
to read all of the text.
5. Install the retrieveuserdata plugin by typing in the number corresponding to it and press Enter.
6. Return to the Main Menu by typing in 9 and press Enter. Go to the General Options by typing in 4 and press Enter. In the
General Options, type in 9 and press Enter to configure the editing of identity. This option will allow you to disable editing
of the name and email address since this will be automatically updated. Save your changes when you are done.
7. Login to SquirrelMail and go to the Options page and click Personal Information. The Full Name and E-mail Address
should have been automatically filled up.
By default, RetrieveUserData will retrieve the name and email address from the Linux system accounts, but you can
configure this by editing the file /usr/share/squirrelmail/plugins/retrieveuserdata/config.php. If you will be retrieving user
information from an Active Directory or LDAP server, it will be easier if you setup the LDAP addressbook first so that the
plugin can use the LDAP connection details there. Then all you have to do is comment the line
$SQRUD_RETRIEVE_DATA_FROM = .passwd.php. and uncomment the line $SQRUD_RETRIEVE_DATA_FROM
= .ldap.php. in the configuration file.
Red Hat Enterprise Linux 5 and its derivative CentOS 5 includes a graphical tool called Security Level Configuration for
configuring the firewall options. This guide describes how to use this tool to open up the ports necessary for providing an
email server.
1. Click System, select Administration and click Security Level and Firewall. This will launch the Security Level
Configuration window.
2. For a mail server with webmail, check Mail (SMTP), Secure WWW (HTTPS) and WWW (HTTP) in the Trusted services
list.
3. We also need to open the ports for the POP3 and IMAP services. In the Other ports field, add the port numbers below.
Service
Port
POP3
110:tcp
POP3S
995:tcp
IMAP
143:tcp
IMAPS
993:tcp
Important: You can see more service and port numbers by typing in "/usr/bin/getent services" from the Terminal window.
We will be using Clam AntiVirus for virus scanning, SpamAssassin for the spam tagging and MailScanner to integrate them
into Postfix.
To install MailScanner, we are going to download the latest source code from the MailScanner web site and build it. For this
to work, it needs the Development Tools package. If you did not include this during installation, you must add it now.
Red Hat Enterprise Linux 5 and its derivative CentOS 5 includes an extensive list of applications that can be easily added or
removed. This guide will show you how to do it using the Package Manager tool.
1. Click Applications and click Add/Remove Software. This will launch the Package Manager window.
2. Select the Category of the package on the left column. On the right column, check the package you wish to install or
uncheck it to remove it.
3. Click Optional packages to to check or uncheck the individual application inside the package you wish to install or
remove respectively. Click Close when you.re done.
You can also check or uncheck the individual applications by searching for it in the Search tab.
Or you can locate individual applications in a list by clicking the List tab.
4. Finally, click Apply. You will be asked to verify your changes. Just click Continue to proceed.
Getting MailScanner
1. Click the globe icon at the top near the System menu to launch the Firefox web browser.
If an error occurs, you probably did not install the Graphical Internet package. You can add it now using the Package
Manager tool.
2. In the address box, type in http://www.mailscanner.info/downloads.html and press Enter. Download the stable version for
RedHat, Fedora and Mandrake Linux.
1. The MailScanner source code should now be on your desktop. Right click the newly downloaded file and click Extract
Here.
2. After extracting, a MailScanner folder should be found on your Desktop. Double click the MailScanner folder to open it.
3. Next, double click the file install.sh. On the Run or Display window, select Run in Terminal. This will now build and
install MailScanner. This will take a while so just wait until the Terminal window disappears.
To install Clam AntiVirus (ClamAV), we are going to use the precompiled binaries from Dag Wieers RPM packages for
Red Hat, RHEL, CentOS and Fedora.
1. Launch Firefox and go to http://dag.wieers.com/rpm/FAQ.php#B2. Click on the package appropriate for your version of
Red Hat Enterprise Linux or CentOS.
4. Finally click Ok. You now have access to an extensive library of precompiled binaries.
If you prefer not to use the GUI tool below, you can also install the Clam AntiVirus by typing in yum install clamd in a
Terminal window.
1. Click Applications then click Add/Remove Software. This will launch the Package Manager window.
2. Click the Search tab. Next type in clamd and click the Search button.
3. Select the latest version of clamd then click Apply. Next click on Continue until it proceeds with the installation.
4. After installation, click Ok. You now have successfully installed Clam Antivirus.
This page will guide you in configuring MailScanner, ClamAV and SpamAssassin to work in Postfix. Before proceeding,
please make sure that all of the above components are already installed.
SpamAssassin is included in Red Hat Enterprise Linux 5 and CentOS 5 and it.s ready to go out of the box. Just add it using
the Package Manager tool if you haven.t done so during installation.
Configuring MailScanner
2. Click Applications and click File Browser to launch the File Browser window and go to the /var/spool/MailScanner
directory.
3. In the File Browser window, click File and click Create Folder. Name the new folder spamassassin.
5. In the Properties window, click the Permissions tab. In the Permissions page, set the Owner as postfix, the Group as
postfix and the Owner Folder Access as Create and delete files. Set the rest of the Folder Access as None. Click Close when
you are done. Repeat this for the quarantine and spamassassin folders.
1. Edit the file /etc/postfix/main.cf and remove the # in front of the line below
header_checks = regexp:/etc/postfix/header_checks
2. Edit the file /etc/postfix/header_checks and add the line below to the bottom of the file
/^Received:/ HOLD
This will now place all incoming mail into the holding area until released by MailScanner.
3. MailScanner should now be the one to start the Postfix service. Stop the Postfix service and start the MailScanner service
in that order. Learn how to stop and start services here.
Your mails are now checked for spam and viruses. Each mail you send or receive will now contain the lines below to
indicate that MailScanner is doing its job.
You can greatly reduce the volume of spam and viruses reaching your mail server if you are willing to give up something. If
you are willing to have your mail delayed (time), install Postgrey.
Postgrey is a simple and powerful anti-spam tool for Postfix. It works by using a technique called Greylisting. Adding
greylisting in Postfix will give your Postfix mail server a simple and effective first line of defense against spam, at a cost of
a few minor delays for newly identified senders. To install Postgrey, we are going to use the precompiled binaries from Dag
Wieers RPM packages for Red Hat, RHEL, CentOS and Fedora.
1. Launch Firefox and go to http://dag.wieers.com/rpm/FAQ.php#B2. Click on the package appropriate for your version of
Red Hat Enterprise Linux or CentOS.
4. Finally click Ok. You now have access to an extensive library of precompiled binaries.
If you are using Red Hat Enterprise Linux 4 or CentOS 4, you have an older version of the Package Manager tool. Instead
of using the GUI tool below, you can use the command yum install postgrey in a Terminal window to install Postgrey.
1. Click Applications then click Add/Remove Software. This will launch the Package Manager window.
2. Click the Search tab. Next type in postgrey and click the Search button.
3. Select the latest version of postgrey then click Apply. Next click on Continue until it proceeds with the installation.
4. After installation, click Ok. You now have successfully installed Postgrey Postfix Greylisting Policy Server.
Configuring Postfix
1. Edit /etc/postfix/main.cf and add reject_unlisted_recipient and check_policy_service unix:postgrey/socket to the value of
smtpd_recipient_restrictions.
check_policy_service unix:postgrey/socket performs the greylisting while adding reject_unlisted_recipient before it enables
Postfix to immediately reject unknown recipients instead of having clients go through the greylisting process before being
informed that the recipient does not exist.
2. Start Postgrey and restart Postfix or MailScanner (if you have installed MailScanner). Learn how to start and restart
services here.
3. Test Postfix. Do not use localhost to connect to Postfix since localhost will bypass Postgrey. After typing in the rcpt to
command, it should reply with Recipient address rejected: Greylisted and it should work if you try it again after at least five
minutes.
Whitelist enables you to disable greylisting for certain email accounts or client ip addresses or hostnames.
1. To disable greylisting for certain email accounts, add their email address into the file
/etc/postfix/postgrey_whitelist_recipients.
2. To disable greylisting for certain IP addresses or hostnames, add the IP address, hostname or regular expression to match
hostnames into the file /etc/postfix/postgrey_whitelist_clients.local. Hostnames are identified by performing a reverse DNS
on the client.s IP address. For sample entries, view the file /etc/postfix/postgrey_whitelist_clients.
Integrating Active Directory/LDAP into your mail server will turn your Linux email server into a lean and mean Exchange
like server.
This guide will show you how to integrate Active Directory/LDAP into Postfix and Dovecot. In this page, you will learn
how to enable Postfix to lookup email addresses in LDAP and how to enable Dovecot to authenticate to an LDAP server.
Since the Active Directory/OpenLDAP user names are not part of the Linux system, we will have to create a user that will
be the owner for all the files belonging to the LDAP user names.
. Create a new user, we will call it vmail. Change the Login Shell to /sbin/nologin, this user account should not be used for
logging in.
3. Click the Groups tab and now note down the Group ID of vmail. We.ll be needing all of them later.
Change samaccountname to uid if you will be connecting to an OpenLDAP server. If your server requires authentication,
add the lines below
bind = yes
bind_dn = cn=mailuser,dc=acme,dc=local
bind_pw = password
Replace the value of bind_dn and bind_pw with a valid user account and password respectively. If you will be connecting to
an Active Directory server, bind_dn can also be
bind_dn = acme\mailuser
or
bind_dn = [email protected]
3. Edit the postfix configuration file /etc/postfix/main.cf and edit the line below
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /home/vmail/
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_uid_maps = static:501
virtual_gid_maps = static:501
virtual_mailbox_base, virtual_uid_maps and virtual_gid_maps should contain the home directory, user id and group id of
vmail respectively.
5. You should now be able to send email to addresses found in your LDAP server.
Depending on the LDAP server and the layout you are going query, you have 3 ways to enable Dovecot to authenticate to
your LDAP server.
auth_bind_userdn = acme\%u
auth_bind_userdn = uid=%u,ou=people,dc=acme,dc=local
pass_filter = (&(objectclass=person)(uid=%u))
2. Edit the file /etc/dovecot.conf and change the value of the following keys below
passdb ldap {
args = /etc/dovecot-ldap.conf
}
userdb static {
args = uid=501 gid=501 home=/home/vmail/%u
}
uid, gid and home should contain the user id, group id and home directory respectively of the vmail user account.
4. You should now be able to login using the user names found in your LDAP server.
Active Directory has a type of grouping called Distribution group used solely as an email distribution list. This page will
show you how to use the distribution group as a mailing list for Postfix. But first, you need to upgrade Postfix to version
2.4. You can download Postfix RPM Packages here.
http://postfix.wl0.org/en/available-packages/
How to setup
leaf_result_attribute only works with Postfix 2.4 or higher which is why we really need to upgrade to version 2.4.
3. Edit the file /etc/postfix/main.cf. You have 2 ways to add the configuration file into Postfix depending on how you
integrated Active Directory. If you used the virtual user solution, add this line
virtual_alias_maps = ldap:/etc/postfix/ldap-groups.cf
But if you used Winbind and the Active Directory users are part of your system account then use this line
alias_maps = ldap:/etc/postfix/ldap-groups.cf
That.s it. You should now be able to send email to your distribution group.
Installation:
vi /usr/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
Then we set the hostname in our Postfix installation (make sure you replace
server1.example.com with your own hostname):
cat /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
mynetworks = 127.0.0.0/8
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
myhostname = server1.example.com
To see if SMTP-AUTH and TLS work properly now run the following command:
After you have established the connection to your Postfix mail server type
ehlo localhost
250-STARTTLS
and
everything is fine.
Type
quit
This guide will show you how to integrate Active Directory/LDAP into the SquirrelMail addressbook. In this page, you will
learn how to configure SquirrelMail to activate the Javascript addressbook and to include your Active Directory or LDAP
server into the addressbook lookup list.
* cn - Common Name
* mail - Email Address
We will be using the Perl based SquirrelMail configuration utility to configure the addressbook.
2. In the Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press Enter. This will launch the SquirrelMail
Configuration utility.
If your Terminal window has a white background, make sure that the colors are off by looking for the command Turn color
on. If the command is Turn color off, type in C and press Enter to turn the colors off. This will ensure that you will be able
to read all of the text.
4. Select the Javascript address book as the default by typing in 2 and press Enter then type in y and press Enter.
5. Add your Active Directory/LDAP server by typing in 1 and press Enter then type in + and press Enter. You will now be
asked a series of questions regarding your Active Directory/LDAP server configuration, see the sample session below.
Next, we need the server root (base dn). For this, an empty
string is allowed.
Example: ou=member_directory,o=netcenter.com
base: dc=acme,dc=local
This is the TCP/IP port number for the LDAP server. Default
port is 389. This is optional. Press ENTER for default.
port:
This is the name for the server, used to tag the results of
the search. Default it .LDAP: hostname.. Press ENTER for default
name:
You can specify the maximum number of rows in the search result.
Default is unlimited. Press ENTER for default.
maxrows:
If your LDAP server does not like anonymous logins, you can specify.
Default is none, anonymous bind. Press ENTER for default.
binddn: cn=mailuser,dc=acme,dc=local
If you are connecting to an Active Directory server, binddn can also be in the form of acme\mailuser or
[email protected]
You should now be back at the Address Books sub menu, type in q and press Enter to quit and type in y and press Enter to
save your changes.
2. Click the Addresses button (not the Addresses link). This will launch the SquirrelMail Addressbook window. Click the
List all button, you should now see your Active Directory/LDAP email addresses.
This page will show you how to join your Linux server into the Active Directory domain, how to integrate the Active
Directory user accounts into the Linux user accounts and how to authenticate users in Active Directory using Winbind, a
component of Samba.
Samba is installed by default when you select the Server installation type during the installation process. In case you need to
install or reinstall it, just add the Windows File Server package located in the Servers category using the Package Manager
tool.
2. Check the Enable Winbind Support and click Configure Winbind. This will launch the Winbind Settings window.
3. In the Winbind Settings window, set the Security Model to ads and fill in the Winbind Domain, Winbind ADS Realm and
Winbind Domain Controllers. See sample settings below.
Winbind Domain
acme
Winbind ADS Realm
acme.local
Domain Controllers
server1.acme.local,server2.acme.local
Important: To ensure the success of the Active Directory integration, make sure that you can ping the domain controllers
and that the difference between the domain controllers. clock and the mail server.s clock is not more than five minutes.
4. Click Join Winbind Domain. You will be asked to save your changes, click Save. In the Joining Winbind Domain
window, fill in the Domain Administrator and Password. Click Ok when you are done. Click Ok again to close the Winbind
Settings window.
5. Click the Authentication tab and check the Enable Winbind Support.
6. Click the Options tab and check the Local authorization is sufficient for local users. Click Ok when you are done.
7. Open the file /etc/samba/smb.conf for editing and change the key values below.
8. Create the folder that will contain the home directory of the Active Directory users. From the terminal window, type in
the commands below.
mkdir /home/DOMAIN
chmod 777 /home/DOMAIN
Replace DOMAIN with your domain. Make sure to capitalize your domain like ACME in our example.
Changed the directory permission to 777, meaning anyone can read, write and execute because the users. home directory
will be created later by Postfix or Dovecot when a mail is received or a user checks his email. The created home directory
on the other hand will have its permission set to read, write and execute by the owner only.
9. Edit the file /etc/pam.d/system-auth and add the line session required pam_mkhomedir.so skel=/etc/skel/ umask=0022.
This will automatically create the user.s home directory whenever a PAM session is opened. Dovecot will be opening the
PAM session thus automatically creating the user.s home directory.
1. From a terminal window, type in wbinfo -u. You should see the Active Directory user accounts.