您好,登錄后才能下訂單哦!
下文主要給大家?guī)韕ostfix+mysql發(fā)送郵件服務(wù),希望這些內(nèi)容能夠帶給大家實(shí)際用處,這也是我編輯postfix+mysql發(fā)送郵件服務(wù)這篇文章的主要目的。好了,廢話不多說,大家直接看下文吧。
1.配置mysql
*實(shí)驗(yàn)之前,制作要使用數(shù)據(jù)庫和表
*添加數(shù)據(jù)庫用戶,并給其授權(quán)
* vim /etc/postfix/mailuser.cf ##查詢用戶名
1 host = localhost ##數(shù)據(jù)庫主機(jī)
2 user = postuser ##登錄數(shù)據(jù)庫用戶
3 password = 123 ##登錄密碼
4 dbname = email ##postfix查詢庫的名稱
5 table = emailuser ##postfix查詢表的名稱
6 select_field = username ##postfix查詢的字段
7 where_field = username ##給postfix查詢的條件
* vim /etc/postfix/maildomain.cf ##域名查詢
1 host = localhost
2 user = postuser
3 password = 123
4 dbname = email
5 table = emailuser
6 select_field = domain
7 where_field = domain
* vim /etc/postfix/mailbox.cf ##郵箱位置查詢
1 host = localhost
2 user = postuser
3 password = 123
4 dbname = email
5 table = emailuser
6 select_field = maildir
7 where_field = username
測(cè)試
2.配置postfix
* groupadd -g 666 vmail ##添加用戶組并指定gid為666
useradd -s /sbin/nologin -u 666 vmail -g 666 ##添加用戶,并指定uid和gid為666
* postconf -e "virtual_mailbox_base = /home/vmail" ##設(shè)定虛擬用戶郵件目錄
postconf -e "virtual_uid_maps = static:666" ##指定虛擬用戶建立文件uid
postconf -e "virtual_gid_maps = static:666" ##指定虛擬用戶建立文件gid
postconf -e "virtual_alias_maps = mysql:/etc/postfix/mailuser.cf" ##指定MySQL查找主機(jī)
postconf -e "virtual_mailbox_domains = mysql:/etc/postfix/maildomain.cf" ##指定MySQL查找域名
postconf -e "virtual_mailbox_maps = mysql:/etc/postfix/mailbox.cf" ##指定MySQL查找郵箱
*systemctl restart postfix ##重啟postfix服務(wù)
測(cè)試
發(fā)送給linux@linux.com的郵件在/home/vmail/linux/new/里找到
對(duì)于以上關(guān)于postfix+mysql發(fā)送郵件服務(wù),大家是不是覺得非常有幫助。如果需要了解更多內(nèi)容,請(qǐng)繼續(xù)關(guān)注我們的行業(yè)資訊,相信你會(huì)喜歡上這些內(nèi)容的。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。