การเข้าใช้งาน Roundcube
- เปิด URL ต่อไปนี้ในเบราว์เซอร์ของคุณ:
https://<SERVER_IP> - การติดตั้งใช้ใบรับรอง TLS แบบลงนามเอง เบราว์เซอร์จึงจะแสดงคำเตือนด้านความปลอดภัย ให้ยอมรับใบรับรองเพื่อดำเนินการต่อ
- คำขอ HTTP บนพอร์ต 80 จะถูกเปลี่ยนเส้นทางไปยัง HTTPS โดยอัตโนมัติ
เข้าสู่ระบบ
- Roundcube ไม่ได้สร้างหรือจัดเก็บบัญชีกล่องจดหมาย
- เข้าสู่ระบบด้วยชื่อผู้ใช้และรหัสผ่านของกล่องจดหมายที่มีอยู่บนเซิร์ฟเวอร์ IMAP ที่คุณตั้งค่าไว้
ตั้งค่าเมลเซิร์ฟเวอร์ของคุณ
การตั้งค่าการเชื่อมต่อเมลเซิร์ฟเวอร์ถูกเก็บไว้ที่: /root/roundcube/.env
การตั้งค่าที่สำคัญ:
- โฮสต์ IMAP:
IMAP_HOST - พอร์ต IMAP:
IMAP_PORT - โฮสต์ SMTP:
SMTP_HOST - พอร์ต SMTP:
SMTP_PORT - โดเมนของชื่อผู้ใช้:
USERNAME_DOMAIN
การตั้งค่าเริ่มต้นใช้ค่าตัวอย่าง:
IMAP_HOST=ssl://mail.example.org
IMAP_PORT=993
SMTP_HOST=tls://mail.example.org
SMTP_PORT=587
แก้ไขค่าเหล่านั้นเป็นชื่อโฮสต์จริงของเมลเซิร์ฟเวอร์คุณ
หลังจากเปลี่ยนการตั้งค่าแล้ว ให้นำไปใช้ด้วย:
cd /root/roundcube && docker compose up -d
ประเภทการเชื่อมต่อ TLS
ใช้คำนำหน้าที่เหมาะกับเมลเซิร์ฟเวอร์ของคุณ:
ssl://: Implicit TLS, typically used with IMAP port993or SMTP port465.tls://: STARTTLS, typically used with IMAP port143or SMTP port587.
ใบรับรองเมลเซิร์ฟเวอร์แบบลงนามเอง
หากเซิร์ฟเวอร์ IMAP หรือ SMTP ของคุณใช้ใบรับรองแบบลงนามเอง Roundcube อาจปฏิเสธการเชื่อมต่อ
การตั้งค่าการตรวจสอบ TLS แบบเลือกได้อยู่ที่: /root/roundcube/config/custom.inc.php
ให้ยกเลิกการคอมเมนต์และตั้งค่าตัวเลือกการเชื่อมต่อ IMAP หรือ SMTP ที่เกี่ยวข้องเฉพาะเมื่อคุณเชื่อถือเมลเซิร์ฟเวอร์และเครือข่ายนั้น
ใช้การกำหนดค่า:
cd /root/roundcube && docker compose restart roundcube
ปลั๊กอินและธีม
การติดตั้งเริ่มต้นจะเปิดใช้:
archivezipdownload
Plugins are configured through the PLUGINS variable in: /root/roundcube/.env
ตัวอย่างเช่น:
PLUGINS=archive,zipdownload,managesieve
ใช้การเปลี่ยนแปลง:
cd /root/roundcube && docker compose up -d
Bundled plugins such as managesieve, markasjunk, และ enigma can be enabled by adding them to PLUGINS, when supported by the image.
For third-party plugins, add them to ROUNDCUBEMAIL_COMPOSER_PLUGINS in the Compose file and include their names in PLUGINS.
การจัดการ Roundcube
ดูสถานะคอนเทนเนอร์:
cd /root/roundcube && docker compose ps
ดู logs:
cd /root/roundcube && docker compose logs -f
รีสตาร์ท Roundcube:
cd /root/roundcube && docker compose restart roundcube
หยุด stack:
cd /root/roundcube && docker compose down
เริ่ม stack:
cd /root/roundcube && docker compose up -d
ไฟล์และไดเรกทอรีที่สำคัญ
- เส้นทางการติดตั้ง:
/root/roundcube - ไฟล์ Compose:
/root/roundcube/docker-compose.yml - ไฟล์สภาพแวดล้อม:
/root/roundcube/.env - การตั้งค่าเพิ่มเติม:
/root/roundcube/config/custom.inc.php - โวลุ่มฐานข้อมูล:
/var/lib/docker/volumes/roundcube_db_data - การตั้งค่า Nginx:
/etc/nginx/sites-available/roundcube - ใบรับรอง TLS:
/etc/nginx/ssl/roundcube.crt - คีย์ส่วนตัว TLS:
/etc/nginx/ssl/roundcube.key
โดเมนและ HTTPS
1. Point your domain to the server's IP address (e.g., yourdomain.com;).
2. ติดตั้ง Certbot:
apt update
apt install -y certbot python3-certbot-nginx
3. Edit NGINX config and replace both server_name _; entries with your domain (e.g., server_name yourdomain.com;):
vim /etc/nginx/sites-available/roundcube
4. ออกใบรับรอง TLS:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แก้ไข /etc/nginx/sites-available/roundcube และอัปเดต ssl_certificate และ ssl_certificate_key directive เพื่อใช้ใบรับรอง Let's Encrypt ของคุณ
Before:
ssl_certificate /etc/nginx/ssl/roundcube.crt;
ssl_certificate_key /etc/nginx/ssl/roundcube.key;
After:
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. ทดสอบการตั้งค่า:
nginx -t
7. รีโหลด NGINX:
systemctl reload nginx
8. เปิดเบราว์เซอร์แล้วไปที่: https://yourdomain.com
หมายเหตุ
- Roundcube is publicly accessible through Nginx on ports
80และ443. - The Roundcube container itself listens only on
127.0.0.1:8000. - MariaDB เป็นบริการภายในของ Docker และไม่ได้เปิดออกสู่โฮสต์โดยตรง
- หน้าเว็บเริ่มต้นใช้ใบรับรอง TLS แบบลงนามเอง
- The upload limit is set to
25 MB; increase bothUPLOAD_MAX_FILESIZEand Nginx'sclient_max_body_sizefor larger uploads. - ปรับการตั้งค่า Roundcube ตามความต้องการของคุณ