Загрузка данных


Вот обновленный пошаговый план на английском языке без раздела FTP, оформленный в виде простых и понятных инструкций и команд для ввода в OpenCode/терминал.

---

### **Step 1: Hostname and Network Configuration**

1. Set the server hostname:
   ```bash
   sudo hostnamectl set-hostname mail.technikum.uczen3.local
   ```

2. Map your server's IP address to the domain in `/etc/hosts`:
   ```bash
   echo "192.168.1.100 mail.technikum.uczen3.local technikum.uczen3.local" | sudo tee -a /etc/hosts
   ```
   *(Replace `192.168.1.100` with your actual server IP address).*

---

### **Step 2: Install and Configure Postfix (SMTP Server)**

1. Install Postfix package:
   ```bash
   sudo apt update && sudo apt install postfix -y
   ```
   *During interactive configuration, select **Internet Site** and enter `mail.technikum.uczen3.local` as the **System mail name**.*

2. Set the mailbox storage format to Maildir:
   ```bash
   sudo postconf -e "home_mailbox = Maildir/"
   ```

---

### **Step 3: Install and Configure Dovecot (IMAP Server)**

1. Install Dovecot IMAP daemon:
   ```bash
   sudo apt install dovecot-imapd -y
   ```

2. Configure storage path in `/etc/dovecot/conf.d/10-mail.conf`:
   ```bash
   sudo sed -i 's|^#\?mail_location =.*|mail_location = maildir:~/Maildir|' /etc/dovecot/conf.d/10-mail.conf
   ```

3. Allow plaintext authentication for local testing in `/etc/dovecot/conf.d/10-auth.conf`:
   ```bash
   sudo sed -i 's|^#\?disable_plaintext_auth =.*|disable_plaintext_auth = no|' /etc/dovecot/conf.d/10-auth.conf
   ```

---

### **Step 4: Create Test Users**

Create user accounts for mail testing:
```bash
sudo adduser uczen1
sudo adduser uczen2
```

---

### **Step 5: Restart Services and Test Connection**

1. Restart Postfix and Dovecot services:
   ```bash
   sudo systemctl restart postfix dovecot
   sudo systemctl status postfix dovecot
   ```

2. Test SMTP port 25 connection via Telnet:
   ```bash
   telnet mail.technikum.uczen3.local 25
   ```
   *(Type `QUIT` and press Enter to exit Telnet once connected).*

---

### **Step 6: Install and Configure Mail Client (`mailutils`)**

1. Install `mailutils`:
   ```bash
   sudo apt install mailutils -y
   ```

2. Create the `~/.mail` configuration file for user `uczen1`:
   ```bash
   su - uczen1 -c 'cat << "EOF" > ~/.mail
   mailbox {
     mailbox-pattern "maildir://~/Maildir";
   };
   EOF'
   ```

3. Create the `~/.mail` configuration file for user `uczen2`:
   ```bash
   su - uczen2 -c 'cat << "EOF" > ~/.mail
   mailbox {
     mailbox-pattern "maildir://~/Maildir";
   };
   EOF'
   ```

---

### **Step 7: Send and Verify Test Email**

1. Send a test email from `uczen1` to `uczen2`:
   ```bash
   su - uczen1 -c 'echo "Hello, this is a test email!" | mail -s "Test Email" uczen2@technikum.uczen3.local'
   ```

2. Read received emails as `uczen2`:
   ```bash
   su - uczen2 -c 'mail'
   ```

---

✉️ Нужно ли добавить пояснения по отладке, если Postfix или Dovecot выдадут ошибку при запуске?