Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
tutoriaux:install-email-server-part-3 [2022/08/04 11:01] – [Configure PostfixAdmin] frater | tutoriaux:install-email-server:install-email-server-part-3 [2023/01/06 18:22] (Version actuelle) – créée - modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Build Email Server From Scratch on Debian – Part 3 - Create Virtual Mailboxes ====== | ====== Build Email Server From Scratch on Debian – Part 3 - Create Virtual Mailboxes ====== | ||
- | In previous articles, we discussed how to set up your own mail server on Debian from scratch. In [[tutoriaux: | + | In previous articles, we discussed how to set up your own mail server on Debian from scratch. In [[tutoriaux: |
With **virtual mailboxes**, | With **virtual mailboxes**, | ||
Ligne 15: | Ligne 15: | ||
* command line client postfixadmin-cli for those who don’t want to click around in a web interface 😉 | * command line client postfixadmin-cli for those who don’t want to click around in a web interface 😉 | ||
- | < | + | <WRAP round info> |
Once you finish part 3, you can no longer use local Unix accounts as email addresses. You must create email addresses from the PostfixAdmin web interface. | Once you finish part 3, you can no longer use local Unix accounts as email addresses. You must create email addresses from the PostfixAdmin web interface. | ||
</ | </ | ||
Ligne 21: | Ligne 21: | ||
==== Requirements ==== | ==== Requirements ==== | ||
- | I assume that you have followed [[tutoriaux: | + | I assume that you have followed [[tutoriaux: |
Once the above requirements are met, let’s install and configure PostfixAdmin. | Once the above requirements are met, let’s install and configure PostfixAdmin. | ||
Ligne 39: | Ligne 39: | ||
Sample output: | Sample output: | ||
- | {{ :tutoriaux:pasted:20220802-101434.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-mysql-status.png |}} |
If it’s not running, start it with this command: | If it’s not running, start it with this command: | ||
Ligne 55: | Ligne 55: | ||
When it asks you to enter MariaDB root password, press Enter key as the root password isn’t set yet. Your root account is already secured, so you should answer n to not set password. | When it asks you to enter MariaDB root password, press Enter key as the root password isn’t set yet. Your root account is already secured, so you should answer n to not set password. | ||
- | {{ :tutoriaux:pasted:20220802-101730.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-mysql-secure-setup-1.png |}} |
Next, you can press '' | Next, you can press '' | ||
- | {{ :tutoriaux:pasted:20220802-101816.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-mysql-secure-setup-2.png |}} |
===== Download PostfixAdmin on Debian Server ===== | ===== Download PostfixAdmin on Debian Server ===== | ||
Ligne 255: | Ligne 255: | ||
To encrypt the HTTP traffic, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Debian server. | To encrypt the HTTP traffic, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Debian server. | ||
- | Normally this step should have been performed during the [[tutoriaux: | + | Normally this step should have been performed during the [[tutoriaux: |
<code bash> | <code bash> | ||
Ligne 290: | Ligne 290: | ||
The certificate should now be obtained and automatically installed, which is indicated by the message below. | The certificate should now be obtained and automatically installed, which is indicated by the message below. | ||
- | {{ :tutoriaux: | + | {{ tutoriaux: |
===== Enable Statistics in Dovecot ===== | ===== Enable Statistics in Dovecot ===== | ||
Ligne 299: | Ligne 299: | ||
Add the following lines to the end of this file. | Add the following lines to the end of this file. | ||
- | < | + | < |
service stats { | service stats { | ||
unix_listener stats-reader { | unix_listener stats-reader { | ||
Ligne 329: | Ligne 329: | ||
Go to '' | Go to '' | ||
- | {{ :tutoriaux:pasted:20220802-131751.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-postfixadmin-setup.png |}} |
After creating the password hash, PostfixAdmin will display a line like below. | After creating the password hash, PostfixAdmin will display a line like below. | ||
- | {{ :tutoriaux:pasted:20220802-131915.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-postfixadmin-passwordkey.png |}} |
<code php> | <code php> | ||
Ligne 345: | Ligne 345: | ||
Add the line displayed on PostfixAdmin setup page to the end of the file like below. | Add the line displayed on PostfixAdmin setup page to the end of the file like below. | ||
- | {{ :tutoriaux:pasted:20220802-132448.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-postfixadmin-config.png |}} |
After saving the file, you need to refresh the PostfixAdmin setup page and enter the setup password again, then create the admin account. | After saving the file, you need to refresh the PostfixAdmin setup page and enter the setup password again, then create the admin account. | ||
- | {{ :tutoriaux:pasted:20220802-132722.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-postfixadmin-add-admin.png |}} |
Once the superadmin account is created, you can log into PostfixAdmin at '' | Once the superadmin account is created, you can log into PostfixAdmin at '' | ||
- | {{ :tutoriaux:pasted:20220802-132926.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-postfixadmin-login.png |}} |
===== Configure Postfix to Use MySQL/ | ===== Configure Postfix to Use MySQL/ | ||
Ligne 369: | Ligne 369: | ||
Add the following lines at the end of this file. | Add the following lines at the end of this file. | ||
- | < | + | < |
virtual_mailbox_domains = proxy: | virtual_mailbox_domains = proxy: | ||
virtual_mailbox_maps = | virtual_mailbox_maps = | ||
Ligne 388: | Ligne 388: | ||
We want to use dovecot to deliver incoming emails to the virtual users’ message store, so also add the following line at the end of this file. | We want to use dovecot to deliver incoming emails to the virtual users’ message store, so also add the following line at the end of this file. | ||
- | < | + | < |
- | {{ :tutoriaux:pasted:20220802-125410.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-dovecot-transport.png |}} |
Save and close the file. Next, we need to create the '' | Save and close the file. Next, we need to create the '' | ||
Ligne 402: | Ligne 402: | ||
Add the following content. Replace '' | Add the following content. Replace '' | ||
- | < | + | < |
user = postfixadmin | user = postfixadmin | ||
password = postfixadmin_password | password = postfixadmin_password | ||
Ligne 420: | Ligne 420: | ||
Add the following content. | Add the following content. | ||
- | < | + | < |
user = postfixadmin | user = postfixadmin | ||
password = postfixadmin_password | password = postfixadmin_password | ||
Ligne 435: | Ligne 435: | ||
Add the following content. | Add the following content. | ||
- | < | + | < |
user = postfixadmin | user = postfixadmin | ||
password = postfixadmin_password | password = postfixadmin_password | ||
Ligne 449: | Ligne 449: | ||
Add the following content. | Add the following content. | ||
- | < | + | < |
user = postfixadmin | user = postfixadmin | ||
password = postfixadmin_password | password = postfixadmin_password | ||
Ligne 464: | Ligne 464: | ||
Add the following content. | Add the following content. | ||
- | < | + | < |
user = postfixadmin | user = postfixadmin | ||
password = postfixadmin_password | password = postfixadmin_password | ||
Ligne 478: | Ligne 478: | ||
Add the following content. | Add the following content. | ||
- | < | + | < |
# handles catch-all settings of target-domain | # handles catch-all settings of target-domain | ||
user = postfixadmin | user = postfixadmin | ||
Ligne 500: | Ligne 500: | ||
Sample output: | Sample output: | ||
- | < | + | < |
The '' | The '' | ||
Ligne 512: | Ligne 512: | ||
Add the following lines at the end of this file. | Add the following lines at the end of this file. | ||
- | < | + | < |
virtual_mailbox_base = /var/vmail | virtual_mailbox_base = /var/vmail | ||
virtual_minimum_uid = 2000 | virtual_minimum_uid = 2000 | ||
Ligne 554: | Ligne 554: | ||
< | < | ||
- | {{ :tutoriaux:pasted:20220802-133310.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-box-location.png |}} |
Save and close the file. Then edit the // | Save and close the file. Then edit the // | ||
Ligne 583: | Ligne 583: | ||
auth_debug_passwords = yes</ | auth_debug_passwords = yes</ | ||
- | {{ :tutoriaux:pasted:20220802-133339.png |}} | + | {{ tutoriaux:debian-email:debian-virtualmail-auth-config.png |}} |
Save and close the file. | Save and close the file. | ||
Ligne 612: | Ligne 612: | ||
Log in to PostfixAdmin web interface as the admin. Click the '' | Log in to PostfixAdmin web interface as the admin. Click the '' | ||
- | [[debian postfixadmin add domain]] | + | [[..: |
Then click '' | Then click '' | ||
- | [[debian postfixadmin Create a new mailbox]] | + | [[..: |
Next, you can open your desktop email client such as Mozilla Thunderbird and add a mail account. | Next, you can open your desktop email client such as Mozilla Thunderbird and add a mail account. | ||
Ligne 623: | Ligne 623: | ||
* In the outgoing section, select SMTP protocol, enter '' | * In the outgoing section, select SMTP protocol, enter '' | ||
- | [[thunderbird-mail-client-configuration]] | + | [[..:thunderbird-mail-client-configuration]] |
- | < | + | <WRAP round tip> |
You can also use port 993 with SSL/TLS encryption for IMAP, and use port 465 with SSL/TLS encryption for SMTP. You should **not** use port 25 as the SMTP port in mail clients to submit outgoing emails. | You can also use port 993 with SSL/TLS encryption for IMAP, and use port 465 with SSL/TLS encryption for SMTP. You should **not** use port 25 as the SMTP port in mail clients to submit outgoing emails. | ||
</ | </ | ||
Ligne 666: | Ligne 666: | ||
If you see the “relay access denied” error when trying to send emails from a mail client, it’s most likely that you use port 25 as the SMTP port in your mail client. As I said a while ago, you should use port 587 or 465 as the SMTP port in mail clients (Mozilla Thunberbird, | If you see the “relay access denied” error when trying to send emails from a mail client, it’s most likely that you use port 25 as the SMTP port in your mail client. As I said a while ago, you should use port 587 or 465 as the SMTP port in mail clients (Mozilla Thunberbird, | ||
- | [[postfix dovecot relay access denied]] | + | [[..: |
==== iOS Mail App ==== | ==== iOS Mail App ==== |