差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
| 软件:email [2025/12/03 15:00] – admin | 软件:email [2026/01/02 00:57] (当前版本) – 外部编辑 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== EMail ====== | ||
| + | |||
| 电子邮件(E-mail) | 电子邮件(E-mail) | ||
| + | |||
| + | SMTP服务器: | ||
| + | |||
| + | IMAP服务器: | ||
| + | |||
| + | POP3服务器: | ||
| SMTP | SMTP | ||
| 行 12: | 行 20: | ||
| 浏览器访问[[http:// | 浏览器访问[[http:// | ||
| + | |||
| + | ====== postfix ====== | ||
| <code -> | <code -> | ||
| - | sudo apt-get update | + | sudo apt update |
| - | sudo apt-get install postfix | + | sudo apt install postfix |
| + | sudo dpkg-reconfigure postfix | ||
| + | General type of mail configuration: | ||
| + | NONE doesn' | ||
| + | System mail name: example.com | ||
| + | Root and postmaster mail recipient: < | ||
| + | Other destinations for mail: server1.example.com, | ||
| + | Force synchronous updates on mail queue?: No | ||
| + | Local networks: 127.0.0.0/ | ||
| + | Yes doesn' | ||
| + | Mailbox size limit (bytes): 0 | ||
| + | Local address extension character: + | ||
| + | Internet protocols to use: all | ||
| + | |||
| + | #方法二 | ||
| sudo vi / | sudo vi / | ||
| - | 我的主机名 | + | myhostname |
| - | 我的域名 | + | alias_maps |
| - | 我的原产地 = $mydomain | + | </code> |
| - | inet_interfaces = 全部 | + | |
| - | mydestination = $myhostname、localhost.$mydomain、localhost、$mydomain | + | |
| - | mynetworks = 127.0.0.0/8 [:: | + | |
| - | home_mailbox = Maildir/ | + | |
| - | 为确保配置安全,应激活 SMTP 身份验证。为此,请在您的 main.cf 中: | + | |
| - | smtpd_sasl_type | + | ====== dovecot ====== |
| - | smtpd_sasl_path | + | |
| - | smtpd_sasl_auth_enable | + | |
| - | smtpd_sasl_security_options | + | |
| - | smtpd_sasl_local_domain | + | |
| - | smtpd_recipient_restrictions | + | |
| - | 激活 TLS 加密 | + | |
| - | 为确保连接安全,应为 Postfix 激活 TLS 加密。在您的 main.cf 中: | + | |
| - | smtpd_tls_cert_file | + | <code -> |
| - | smtpd_tls_key_file | + | sudo apt install dovecot-core dovecot-imapd dovecot-pop3d |
| - | smtpd_use_tls | + | |
| - | smtpd_tls_session_cache_database | + | sudo vi / |
| - | smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache | + | protocols |
| + | sudo vi /etc/dovecot/conf.d/10-mail.conf | ||
| + | mail_location | ||
| + | sudo vi /etc/dovecot/conf.d/10-auth.conf | ||
| + | disable_plaintext_auth = no | ||
| + | auth_mechanisms = plain login | ||
| + | !include auth-system.conf.ext | ||
| + | sudo systemctl restart dovecot | ||
| + | </ | ||
| + | |||
| + | ====== Roundcube ====== | ||
| + | |||
| + | ===== 依赖 ===== | ||
| + | |||
| + | <code -> | ||
| + | sudo apt install mariadb-server unzip | ||
| + | sudo apt install php php-mysql php-gd php-mbstring php-xml php-intl php-curl | ||
| + | </ | ||
| + | |||
| + | ===== sql ===== | ||
| + | |||
| + | <code -> | ||
| + | sudo mysql -u root -p | ||
| + | CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | ||
| + | GRANT ALL PRIVILEGES ON roundcubemail.* TO ' | ||
| + | FLUSH PRIVILEGES; | ||
| + | EXIT; | ||
| + | </ | ||
| + | |||
| + | ===== nginx ===== | ||
| + | |||
| + | <code -> | ||
| + | server { | ||
| + | listen 80; | ||
| + | server_name mail.example.com; | ||
| + | |||
| + | root / | ||
| + | index index.php; | ||
| + | |||
| + | location ~ \.php$ { | ||
| + | include snippets/fastcgi-php.conf; | ||
| + | | ||
| + | fastcgi_param SCRIPT_FILENAME | ||
| + | include fastcgi_params; | ||
| + | } | ||
| + | |||
| + | location ~ /\.ht { | ||
| + | deny all; | ||
| + | | ||
| + | |||
| + | location ~ ^/ | ||
| + | deny all; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== 部署 ===== | ||
| + | |||
| + | <code -> | ||
| + | cd /var/www/ | ||
| + | wget https:// | ||
| + | tar -xzf roundcubemail-1.6.9-complete.tar.gz | ||
| + | mv roundcubemail-1.6.9 roundcube | ||
| + | chown -R www-data: | ||
| + | 访问 http:// | ||
| + | Database setup: 填入之前创建的 roundcubemail 数据库信息 | ||
| + | IMAP Settings: | ||
| + | IMAP Host: ssl:// | ||
| + | Port: 993 | ||
| + | SMTP Settings: | ||
| + | SMTP Host: tls:// | ||
| + | Port: 587 | ||
| + | Use SMTP authentication: | ||
| + | Username: %u,Password: | ||
| </ | </ | ||