📧 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
sudo apt update
sudo apt install dovecot-core dovecot-imapd
⚙️ Configuration
Edit the mail configuration file:
sudo nano /etc/dovecot/conf.d/10-mail.conf
Update:
mail_location = maildir:~/Maildir
📁 Maildir Setup
mkdir -p ~/Maildir/{cur,new,tmp}
Structure:
Maildir/
├── cur/ # Read messages
├── new/ # New messages
└── tmp/ # Temporary storage
🔄 Restart Service
sudo systemctl restart dovecot
✅ Check Status
systemctl status dovecot
🌐 Check Ports
sudo ss -tulpn | grep dovecot
Ports:
🔐 Authentication Test
Credentials:
- Username:
gebely - Password:
5095
sudo doveadm auth test gebely 5095
📡 IMAP Testing
openssl s_client -connect localhost:143 -starttls imap
Login:
a login gebely 5095
📬 IMAP Commands
b LIST "" "*"
c SELECT INBOX
d FETCH 1 BODY[]
🧠 Architecture
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
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
الوصف



