使用postfix和roundcube搭建webemail

友鏈

參考文章:https://www.cnblogs.com/chris-cp/p/4843407.html
備份連接

主要參考文章:https://www.cnblogs.com/tssc/p/7683809.html

其中有一個地方有問題,就是在/etc/postfix/main.cf配置文件的mynetworks的配置需要注意

官方文檔中對該參數值的描述:
http://www.postfix.org/postconf.5.html

The list of "trusted" remote SMTP clients that have more privileges than "strangers".

In particular, "trusted" SMTP clients are allowed to relay mail through Postfix. See the smtpd_relay_restrictions parameter description in the postconf(5) manual.

You can specify the list of "trusted" network addresses by hand or you can let Postfix do it for you (which is the default). See the description of the mynetworks_style parameter for more information.

If you specify the mynetworks list by hand, Postfix ignores the mynetworks_style setting.

Specify a list of network addresses or network/netmask patterns, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace.

The netmask specifies the number of bits in the network part of a host address. You can also specify "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored).

The list is matched left to right, and the search stops on the first match. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.

Note 1: Pattern matching of domain names is controlled by the or absence of "mynetworks" in the parent_domain_matches_subdomains parameter value.

Note 2: IP version 6 address information must be specified inside [] in the mynetworks value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.

Examples:

mynetworks = 127.0.0.0/8 168.100.189.0/28
mynetworks = !192.168.0.1, 192.168.0.0/28
mynetworks = 127.0.0.0/8 168.100.189.0/28 [::1]/128 [2001:240:587::]/64
mynetworks = $config_directory/mynetworks
mynetworks = hash:/etc/postfix/network_table

大致意思就是匹配到mynetworks配置的網絡段的客戶端IP可以將其郵件轉發給我們的25端口進行郵件的轉發,我們配置webmail,只需要將其設置爲127.0.0.0/8,也就是本地環回地址即可

還有一個地方就是第一篇文章,沒有創建存放用戶郵件的目錄

mkdir -p /var/mailbox
chown -R  postfix /var/mailbox

按照第一篇文章操作完成後,我們可以使用telnet對我們的郵件服務器進行測試

在這裏插入圖片描述
現在我們的smtp服務器已經配置成功了,可以正常發信了

以上配置過程中更改之後的所有配置文件:https://gitee.com/wochinijiamile/suiyi/raw/master/123.tar.gz

下面我們進行smtp用戶認證的配置

在編譯安裝courier-authlib會遇到如下錯誤:
configure: error: Unable to find ltdl.h. Please install Libtool's ltdl library
解決方案:
yum install libtool-ltdl-devel

然後我們還會遇到下面這個錯誤

configure: error: --with-authmysql specified but no mysqlclient.so

這時我們需要安裝mysql-server

參考文章
備份連接

安裝完成之後還是會報上面那個錯誤,我們的解決方案就是,先使用ldconfig -v | grep mysql找到mysql的庫文件的位置

然後在編譯安裝的configure中進行一下更改

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章