diff --git a/README.md b/README.md index 2bae4a0..a805c25 100644 --- a/README.md +++ b/README.md @@ -1 +1,172 @@ -Dovecot setup +# 📧 Dovecot Local Setup & IMAP Testing + +## 📌 Overview + +This project demonstrates the setup and validation of a local Dovecot IMAP server on Ubuntu. +It includes installation, configuration, authentication, and IMAP testing. + +--- + +## 🧱 Installation + +```bash +sudo apt update +sudo apt install dovecot-core dovecot-imapd +``` + +--- + +## ⚙️ Configuration + +Edit the mail configuration file: + +```bash +sudo nano /etc/dovecot/conf.d/10-mail.conf +``` + +Update: + +```ini +mail_location = maildir:~/Maildir +``` + +--- + +## 📁 Maildir Setup + +```bash +mkdir -p ~/Maildir/{cur,new,tmp} +``` + +### Structure: + +```text +Maildir/ + ├── cur/ # Read messages + ├── new/ # New messages + └── tmp/ # Temporary storage +``` + +�� Example: +![Maildir](screenshots/maildir.png) + +--- + +## 🔄 Restart Service + +```bash +sudo systemctl restart dovecot +``` + +--- + +## ✅ Check Status + +```bash +systemctl status dovecot +``` + +📸 Output: +![Status](screenshots/status.png) + +--- + +## 🌐 Check Ports + +```bash +sudo ss -tulpn | grep dovecot +``` + +Ports: + +* 143 → IMAP +* 993 → IMAP SSL + +--- + +## 🔐 Authentication Test + +```bash +sudo doveadm auth test gebely 5095 +``` + +📸 Output: +![Auth](screenshots/auth-test.png) + +--- + +## 📡 IMAP Testing + +```bash +openssl s_client -connect localhost:143 -starttls imap +``` + +Login: + +```text +a login gebely 5095 +``` + +--- + +## 📬 IMAP Commands + +```text +b LIST "" "*" +c SELECT INBOX +d FETCH 1 BODY[] +``` + +📸 IMAP Session: +![IMAP](screenshots/imap-login.png) + +--- + +## 🧠 Architecture + +```text +Client → Dovecot → PAM → passwd → Maildir +``` + +--- + +## ⚙️ Configuration Summary + +* Mail storage: Maildir +* Authentication: PAM +* User database: passwd +* Protocol: IMAP +* SSL enabled + +--- + +## 🚨 Troubleshooting + +### 1. Port already in use + +```bash +sudo netstat -tulpn | grep 143 +``` + +--- + +### 2. Network issue (VM) + +* Enable VMware NAT +* Start VMware NAT Service + +--- + +### 3. Authentication failure + +* Check username/password +* Verify PAM configuration + +--- + +## 🎯 Status + +✅ Dovecot installed +✅ Maildir configured +✅ Authentication working +✅ IMAP tested successfully