浏览代码

Merge pull request #238 from william-stacken/master

Resolve "Anyone can send mails from a local user as long as the recipient is another local user"
pull/258/head
Luke Smith 1年前
committed by GitHub
父节点
当前提交
2dc5e05754
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      emailwiz.sh

+ 6
- 0
emailwiz.sh 查看文件

@@ -94,6 +94,8 @@ postconf -e 'smtpd_sasl_type = dovecot'
postconf -e 'smtpd_sasl_path = private/auth' postconf -e 'smtpd_sasl_path = private/auth'


# Sender and recipient restrictions # Sender and recipient restrictions
postconf -e "smtpd_sender_login_maps = pcre:/etc/postfix/login_maps.pcre"
postconf -e "smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_sender_login_mismatch"
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unknown_recipient_domain' postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unknown_recipient_domain'


# NOTE: the trailing slash here, or for any directory name in the home_mailbox # NOTE: the trailing slash here, or for any directory name in the home_mailbox
@@ -106,6 +108,10 @@ postconf -e 'home_mailbox = Mail/Inbox/'
# Prevent "Received From:" header in sent emails in order to prevent leakage of public ip addresses # Prevent "Received From:" header in sent emails in order to prevent leakage of public ip addresses
postconf -e "header_checks = regexp:/etc/postfix/header_checks" postconf -e "header_checks = regexp:/etc/postfix/header_checks"


# Create a login map file that ensures that if a sender wants to send a mail from a user at our local
# domain, they must be authenticated as that user
echo "/^(.*)@$(sh -c "echo $domain | sed 's/\./\\\./'")$/ \${1}" > /etc/postfix/login_maps.pcre

# strips "Received From:" in sent emails # strips "Received From:" in sent emails
echo "/^Received:.*/ IGNORE echo "/^Received:.*/ IGNORE
/^X-Originating-IP:/ IGNORE" >> /etc/postfix/header_checks /^X-Originating-IP:/ IGNORE" >> /etc/postfix/header_checks


正在加载...
取消
保存