您必须创建/etc/imapd.conf和/etc/cyrus.conf
如果您想使用 sieve (一种邮件过滤语言),您必须更改/etc/services. 对于 SuSE 8.0,请特别注意 sieve 的端口,他们定义了错误的端口。添加或更改以下行
pop3 110/tcp imap 143/tcp imaps 993/tcp pop3s 995/tcp sieve 2000/tcp |
请确保 “servername” 包含您的 FQHN (完全限定主机名)
参数 “unixhierarchysep: yes” 仅在您希望使用类似 “hans.mueller.somedomain.tld” 这样的用户名时使用,更多信息请参见 第 8 节。
postmaster: postmaster configdirectory: /var/imap partition-default: /var/spool/imap # admins: cyrus # no admins! allowanonymouslogin: no allowplaintext: yes sasl_mech_list: PLAIN servername: servername autocreatequota: 10000 reject8bit: no quotawarn: 90 timeout: 30 poptimeout: 10 dracinterval: 0 drachost: localhost sasl_pwcheck_method: saslauthd sievedir: /usr/sieve sendmail: /usr/sbin/sendmail sieve_maxscriptsize: 32 sieve_maxscripts: 5 #unixhierarchysep: yes |
请确保 “servername” 包含您的 FQHN (完全限定主机名)
参数 “unixhierarchysep: yes” 仅在您希望使用类似 “hans.mueller.somedomain.tld” 这样的用户名时使用,更多信息请参见 第 8 节。
第二个文件确保只有管理员用户才能通过 localhost 连接。请自行决定您的站点是否需要此额外的安全功能。
postmaster: postmaster configdirectory: /var/imap partition-default: /var/spool/imap admins: cyrus allowanonymouslogin: no allowplaintext: yes sasl_mech_list: PLAIN servername: servername autocreatequota: 10000 reject8bit: no quotawarn: 90 timeout: 30 poptimeout: 10 dracinterval: 0 drachost: localhost sasl_pwcheck_method: saslauthd sievedir: /usr/sieve sendmail: /usr/sbin/sendmail sieve_maxscriptsize: 32 sieve_maxscripts: 5 #unixhierarchysep: yes |
如果您想启用 Cyrus 的 TLS/SSL 功能,您必须首先创建一个证书。这需要安装 OpenSSL
openssl req -new -nodes -out req.pem -keyout key.pem openssl rsa -in key.pem -out new.key.pem openssl x509 -in req.pem -out ca-cert -req \ -signkey new.key.pem -days 999 mkdir /var/imap cp new.key.pem /var/imap/server.pem rm new.key.pem cat ca-cert >> /var/imap/server.pem chown cyrus:mail /var/imap/server.pem chmod 600 /var/imap/server.pem # Your key should be protected echo tls_ca_file: /var/imap/server.pem >> /etc/imapd.conf echo tls_cert_file: /var/imap/server.pem >> /etc/imapd.conf echo tls_key_file: /var/imap/server.pem >> /etc/imapd.conf |
您需要创建的另一个文件是/etc/cyrus.conf它是 Cyrus 主进程的配置文件。它定义了进程 “master” 启动程序、服务和事件。
# standard standalone server implementation START { # do not delete this entry! recover cmd="ctl_cyrusdb -r" # this is only necessary if using idled for IMAP IDLE # idled cmd="idled" } # UNIX sockets start with a slash and are put into /var/imap/socket SERVICES { # add or remove based on preferences imap cmd="imapd" listen="192.168.0.1:imap" prefork=0 imaplocal cmd="imapd -C /etc/imapd-local.conf" listen="127.0.0.1:imap" prefork=0 imaps cmd="imapd -s" listen="192.168.0.1:imaps" prefork=0 imapslocal cmd="imapd -C /etc/imapd-local.conf" listen="127.0.0.1:imaps" prefork=0 pop3 cmd="pop3d" listen="pop3" prefork=0 pop3s cmd="pop3d -s" listen="pop3s" prefork=0 sieve cmd="timsieved" listen="192.168.0.1:sieve" prefork=0 sievelocal cmd="timsieved -C /etc/imapd-local.conf listen="127.0.0.1:sieve" prefork=0 # at least one LMTP is required for delivery # lmtp cmd="lmtpd" listen="lmtp" prefork=0 lmtpunix cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0 # this is only necessary if using notifications # notify cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1 } EVENTS { # this is required checkpoint cmd="ctl_cyrusdb -c" period=30 # this is only necessary if using duplicate delivery suppression delprune cmd="ctl_deliver -E 3" period=1440 # this is only necessary if caching TLS sessions tlsprune cmd="tls_prune" period=1440 } |
![]() | 请检查您的系统 IP 地址 |
---|---|
在上面的示例中,IP 192.168.0.1 需要替换为您的系统外部 IP 地址。 |