Truy cập Roundcube
- Mở URL sau trong trình duyệt của bạn:
https://<SERVER_IP> - Bản cài đặt dùng chứng chỉ TLS tự ký nên trình duyệt sẽ hiện cảnh báo bảo mật. Hãy chấp nhận chứng chỉ để tiếp tục.
- Các yêu cầu HTTP trên cổng 80 được tự động chuyển hướng sang HTTPS.
Đăng nhập
- Roundcube không tạo hay lưu trữ tài khoản hộp thư.
- Đăng nhập bằng tên người dùng và mật khẩu của một hộp thư sẵn có trên máy chủ IMAP bạn đã cấu hình.
Cấu hình máy chủ thư của bạn
Các thiết lập kết nối máy chủ thư được lưu tại: /root/roundcube/.env
Các thiết lập quan trọng:
- Máy chủ IMAP:
IMAP_HOST - Cổng IMAP:
IMAP_PORT - Máy chủ SMTP:
SMTP_HOST - Cổng SMTP:
SMTP_PORT - Tên miền của tên người dùng:
USERNAME_DOMAIN
Cấu hình mặc định dùng các giá trị mẫu:
IMAP_HOST=ssl://mail.example.org
IMAP_PORT=993
SMTP_HOST=tls://mail.example.org
SMTP_PORT=587
Hãy thay chúng bằng tên máy chủ thư thực tế của bạn.
Sau khi thay đổi thiết lập, hãy áp dụng bằng:
cd /root/roundcube && docker compose up -d
Các kiểu kết nối TLS
Hãy dùng tiền tố phù hợp với máy chủ thư của bạn:
ssl://: Implicit TLS, typically used with IMAP port993or SMTP port465.tls://: STARTTLS, typically used with IMAP port143or SMTP port587.
Chứng chỉ tự ký của máy chủ thư
Nếu máy chủ IMAP hoặc SMTP của bạn dùng chứng chỉ tự ký, Roundcube có thể từ chối kết nối.
Các thiết lập xác minh TLS tùy chọn nằm ở: /root/roundcube/config/custom.inc.php
Chỉ bỏ chú thích và cấu hình các tùy chọn kết nối IMAP hoặc SMTP tương ứng khi bạn tin tưởng máy chủ thư và mạng.
Áp dụng cấu hình:
cd /root/roundcube && docker compose restart roundcube
Plugin và giao diện
Bản cài đặt mặc định bật:
archivezipdownload
Plugins are configured through the PLUGINS variable in: /root/roundcube/.env
Ví dụ:
PLUGINS=archive,zipdownload,managesieve
Áp dụng thay đổi:
cd /root/roundcube && docker compose up -d
Bundled plugins such as managesieve, markasjunk, và 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.
Quản lý Roundcube
Xem trạng thái container:
cd /root/roundcube && docker compose ps
Xem log:
cd /root/roundcube && docker compose logs -f
Khởi động lại Roundcube:
cd /root/roundcube && docker compose restart roundcube
Dừng stack:
cd /root/roundcube && docker compose down
Khởi động stack:
cd /root/roundcube && docker compose up -d
File và thư mục quan trọng
- Đường dẫn cài đặt:
/root/roundcube - Tệp Compose:
/root/roundcube/docker-compose.yml - Tệp môi trường:
/root/roundcube/.env - Cấu hình bổ sung:
/root/roundcube/config/custom.inc.php - Volume Cơ sở Dữ liệu:
/var/lib/docker/volumes/roundcube_db_data - Cấu hình Nginx:
/etc/nginx/sites-available/roundcube - Chứng chỉ TLS:
/etc/nginx/ssl/roundcube.crt - Khóa riêng TLS:
/etc/nginx/ssl/roundcube.key
Tên miền và HTTPS
1. Point your domain to the server's IP address (e.g., yourdomain.com;).
2. Cài đặt 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. Cấp một chứng chỉ TLS:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Chỉnh sửa /etc/nginx/sites-available/roundcube và cập nhật ssl_certificate và ssl_certificate_key chỉ thị để sử dụng chứng chỉ Let's Encrypt của bạn.
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. Kiểm tra cấu hình:
nginx -t
7. Tải lại NGINX:
systemctl reload nginx
8. Mở trình duyệt và truy cập: https://yourdomain.com
Ghi chú
- Roundcube is publicly accessible through Nginx on ports
80và443. - The Roundcube container itself listens only on
127.0.0.1:8000. - MariaDB là dịch vụ nội bộ của Docker và không được mở trực tiếp ra máy chủ.
- Giao diện web mặc định dùng chứng chỉ TLS tự ký.
- The upload limit is set to
25 MB; increase bothUPLOAD_MAX_FILESIZEand Nginx'sclient_max_body_sizefor larger uploads. - Thay đổi cấu hình Roundcube theo nhu cầu của bạn.