大网数据广告活动
服务器运维问答

Blocking outgoing mails to some users in exim

· 52CE 我爱测

I want to block some users to sending out mails to other domains in Exim4 . I tried the following configuration but did not work. Changes done in exim.conf file: In the main configuration section, enabled the acl_smtp_mail contro…

问题原文

原帖链接 · user210108 · CC BY-SA 3.0

I want to block some users to sending out mails to other domains in Exim4. I tried the following configuration but did not work.

Changes done in exim.conf file:

In the main configuration section, enabled the acl_smtp_mail control as follows:

acl_smtp_mail = acl_check_mail

Then, in the acl_check_rcpt ACL configuration section, created a new rule:

accept   condition = ${lookup{$sender_address}lsearch{/etc/exim/freezelist_sender_addresses}{1}{0}}
         control   = freeze/no_tell

I tried this but not worked. Please advice me with configuration.

社区高分解答

原帖链接 · ALex_hha · CC BY-SA 3.0

You can use the following acl

acl_smtp_rcpt = acl_check_rcpt

acl_check_rcpt:

  deny
     message = The $sender_address is prohibited to send mail to the $domain
     senders = lsearch;/etc/exim/restricted_sender
     domains = lsearch;/etc/exim/restricted_domains

/etc/exim/restricted_sender
[email omitted]

/etc/exim/restricted_domains
gmail.com

Testing

# swaks -s mail.example.net --to [email omitted] --from [email omitted]
=== Trying mail.example.net:25...
=== Connected to mail.example.net.
<-  220 mail.example.net, [xxx.xxx.114.28]
 -> EHLO www.example.net
<-  250-mail.example.net Hello www.example.net [xxx.xxx.114.28]
<-  250-SIZE 52428800
<-  250-PIPELINING
<-  250-STARTTLS
<-  250 HELP
 -> MAIL FROM:<[email omitted]>
<-  250 OK
 -> RCPT TO:<[email omitted]>
<** 550 The [email omitted] is prohobited to sent mail to the gmail.com
 -> QUIT
<-  221 mail.example.net closing connection
=== Connection closed with remote host.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-02-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。