Now that the mail server "Postfix" is installed, we will install the access protocols to your E- Mails :
- POP3 : courier-pop
- IMAP : courier-imap
As we store our e-mail addresses in a MySQL database, we will install also "courier-authlib-mysql" and "courier-authdaemon" (for authentication).
Bash
apt-get install courier-base courier-authdaemon courier-authlib-mysql courier-imap courier-pop
When "courier-base" will ask the question "Should we create the necessary directories for the web administration ?", Answer "No".
Once the installation is complete, go to the "/etc/courier" folder.
Bash
cd /etc/courier
Then, edit the "authdaemonrc" file to configure the authentication module on authmysql.
Bash
vi authdaemonrc
Locate the line authmodulelist="authpam" and change the value to "authmysql."
Plain Text
authmodulelist="authmysql"
Then, edit the "authmysqlrc" file to configure the information of connection to MySQL server and the "mapping" of mail server data.
Bash
vi authmysqlrc
In this file, change the following information :
Plain Text
MYSQL_SERVER localhost MYSQL_USERNAME postfix MYSQL_PASSWORD his_password ... MYSQL_DATABASE postfix ... # Table containing users MYSQL_USER_TABLE mailbox ... # Field containing the encrypted password of a user MYSQL_CRYPT_PWFIELD password ... # postfix User ID (on Linux) MYSQL_UID_FIELD 4000 ... # postfix Group ID (on Linux) MYSQL_GID_FIELD 4000 ... # Field containing the username (or email address) of a user MYSQL_LOGIN_FIELD username ... # Folder of all emails MYSQL_HOME_FIELD "/var/spool/vmail" ... # Name (and firstname) of the user. (the full name specified using Postfix Admin) MYSQL_NAME_FIELD name ... # Indicates where the requested user emails found. # WARNING : This line is commented out by default. Therefore, you must remove the # at the start of this line to activate it. MYSQL_MAILDIR_FIELD maildir
Once you have set up this file, restart mail services (authentication, POP3 and IMAP).
Bash
service courier-authdaemon restart service courier-pop restart service courier-imap restart
And finally, check in the logs if no error is displayed.
Bash
cat /var/log/syslog
If you try to connect to your mail server imap, it's possible that an error is displayed.
This error is : "Filesystem notification initialization error - Contact your email administrator (check for configuration errors with the FAM / Gamin library)
To solve the problem, install the package "gamin" who has the same functionality as "libfam0".
Note : Installing this package will automatically uninstall the package "libfam0" which caused a problem. Apparently, this error occurs with any IMAP client.
Bash
apt-get install gamin
Bash
The following extra packages will be installed : libgamin0 The following packages will be REMOVED : libfam0 The following NEW packages will be installed : gamin libgamin0
Once the package installed, restart the "courier" IMAP service.
Bash
service courier-imap restart
By default, POP3 downloads emails WITHOUT leave emails on the server. Which is a problem, because, when you log through Webmail (RoundCube in this case), you will no longer have your emails.
To work around this problem :
- Use the protocol "imap" if it's available (in our case : yes)
- Or use the protocol "pop3" but say to the email client, don't delete messages from the server.
In Outlook, go to "Tools -> Account Settings ...". Select your email account and click "Edit". Click the "More Settings" button and go to the "Advanced" tab.
In this tab, check "Leave a copy of messages on the server".
Nevertheless, it's recommended to set this option when you add your e-mail account in your email client. Otherwise, messages have been deleted from the server at the first synchronization.
For this, use the manual method of your e-mail client when you want to use the POP3 protocol to retrieve e-mails.
Linux 12/26/2014
Linux 1/15/2014
Linux 1/31/2014
Linux 2/13/2014
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
No comment