日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

LINUX邮件收发

發布時間:2023/12/10 linux 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 LINUX邮件收发 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.一般郵件收發

啟動服務

[root@kittod ~]# systemctl restart postfix

修改配置

vim /etc/postfix/main.cf

?修改如下行

94??myhostname = mail.xixi.com

102 mydomain = xixi.com? #本地域名稱

118 myorigin = $mydomain

132 inet_interfaces = all

183 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

283 mynetworks = 192.168.171.0/24, 127.0.0.0/8 #改為本地網段192.168.171.0

發送郵件 [root@kittod ~]# mail redhat@haha.com Subject: test02 這是測試內容 EOT 注:ctrl+d退出寫入

?2.群發郵件

/etc/aliases 是別名數據庫

vim /etc/aliases??

在文件末尾添加

qunfa : xixi,maomao,zhangsan #發送給qunfa,xixi,maomao,zhangsan也會受到

xixi:xixi,maomao? #xixi能收到的郵件 maomao也能收到

?發送郵件

[root@kittod ~]# mail qunfa Subject: test 這是測試內容 EOT

3.加密郵件收發

在/etc/postfix/下面進行操作

[root@haha ~]# cd /etc/postfix/ [root@haha postfix]# openssl req -new -x509 -nodes -out smtpd.pem -keyout smtpd.pem -days 3650 配置文件/etcpostfix/main.cf #添加到末尾 smtp_use_tls = yes smtpd_use_tls = yes smtp_tls_note_starttls_offer = yes smtpd_tls_key_file = /etc/postfix/smtpd.pem smtpd_tls_cert_file = /etc/postfix/smtpd.pem smtpd_tls_CAfile = /etc/postfix/smtpd.pem smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom 修改文件/etc/postfix/master.cf 29 smtps inet n - n - - smtpd 30 # -o syslog_name=postfix/smtps 31 -o smtpd_tls_wrappermode=yes 32 -o smtpd_sasl_auth_enable=yes

?重啟服務

[root@haha postfix]# systemctl restart postfix [root@haha postfix]# systemctl restart saslauthd [root@haha postfix]# systemctl restart dovecot

4.虛擬別名域

配置文件/etcpostfix/main.cf

virtual_alias_domains = group.com, work.com virtual_alias_maps = hash:/etc/postfix/virtual #添加到末尾 修改虛擬別名域文件/etc/postfix/virtual @group.com? ? ? ? ? ? @baidu.com @work.com? ? ? ? ? ? ? @qq.com 123@group.com? ? ? ?maomao,xixi 234@work.com? ? ? ? ?doudou@work.com,xiaodou@work.com 重新生成虛擬別名域數據庫 [root@mail ~]# postmap /etc/postfix/virtual 重新加載虛擬別名域數據文件 [root@mail ~]# systemctl reload postfix

?5.啟用用戶認證收發實驗

安裝相關軟件 [root@kittod ~]# dnf install cyrus-sasl dovecot *sasl* -y

?配置文件/etc/postfix/main.cf,添加到末尾

#啟用SASL對客戶端進行認證 broken_sasl_auth_clients = yes #啟用SASL認證 smtpd_sasl_auth_enable = yes #禁用匿名用戶 smtpd_sasl_security_options = noanonymous #定義收件人限定 smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

?修改/etc/dovecot/dovecot.conf

25 protocols = imap pop3 lmtp 50 login_trusted_networks = 192.168.226.0/24 修改?/etc/dovecot/conf.d/10-mail.conf文件 32 mail_location = mbox:~/mail:INBOX=/var/mail/%u

?重啟服務

[root@haha postfix]# systemctl restart postfix [root@haha postfix]# systemctl restart saslauthd [root@haha postfix]# systemctl restart dovecot

總結

以上是生活随笔為你收集整理的LINUX邮件收发的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。