Exim 阻止通过中继发送邮件

Exim 阻止通过中继发送邮件

目前看来,似乎有人在以某种方式使用我的服务器发送垃圾邮件,因为我看到来自其他电子邮件服务(例如 gmail)的数百封拒绝电子邮件,说该消息无法“退回给发件人”并发送到 mydomain.com。

经调查,这些电子邮件是通过远程 IP 中继发送的,而不是来自服务器本身(例如病毒等...)

我可以做些什么来阻止某人使用我的邮件服务器(exim)进行中继?

我的服务器上有 LFD,用于监控通过中继发送的电子邮件,它向我发送了以下警报。我已将 LFD 设置为如果来自该地址的邮件超过 200 封,则阻止发件人。

LFD 警报示例:

Subject: lfd on tent.myotherdomain.com: RELAY Alert for 187.23.175.140 (BR/Brazil/bb17af8c.virtua.com.br)
To: [email protected]

Time:  Wed Dec  5 14:25:46 2012 +0000
Type:  RELAY, Remote IP - 187.23.175.140 (BR/Brazil/bb17af8c.virtua.com.br)
Count: 203 emails relayed
Blocked: Temporary Block

Sample of the first 10 emails:
2012-12-05 14:08:44 1TgFeV-0006I1-7b <= [email protected] H=(Smkt) [187.23.175.140] P=esmtp S=339 T="smtp.mydomain.com:25" from <[email protected]> for [email protected]
2012-12-05 14:08:44 1TgFeV-0006I2-Kn <= [email protected] H=(Smkt) [187.23.175.140] P=esmtp S=343 T="mail.mydomain.com:25" from <[email protected]> for [email protected]
2012-12-05 14:08:46 1TgFeX-0006I1-DR <= [email protected] H=(Smkt) [187.23.175.140] P=esmtp S=351 T="smtp.mydomain.com:25" from <[email protected]> for [email protected]
2012-12-05 14:08:46 1TgFeX-0006I2-Lo <= [email protected] H=(Smkt) [187.23.175.140] P=esmtp S=347 T="mail.mydomain.com:25" from <[email protected]> for [email protected]
etc...

发送的示例消息:(似乎是从我的个人域名发送的)

Return-path: <[email protected]>
Received: from [187.23.175.140] (helo=Smkt)
        by tent.myotherdomain.com with esmtp (Exim 4.72)
        (envelope-from <[email protected]>)
        id 1TgFut-0006k5-1K; Wed, 05 Dec 2012 14:25:40 +0000
From: "TV Digital no PC" <[email protected]>
Subject: CANAIS ADULTOS em HD, FILMES, FUTEBOL
To: [email protected]
Content-Type: text/plain
Reply-To: [email protected]
Date: Wed, 5 Dec 2012 12:25:36 -0200

Olá!

Já imaginou assistir em seu computador, notebook, tablet, etc... a inúmeros canais de televisão, inclusive os fechados?

Isso tudo usando apenas a Internet? E o melhor: Sem pagar assinatura Mensal!!!

Algumas vantagens:

- Com conexão banda larga, você pode assistir de qualquer computador;

- Não precisa instalar nenhum programa;

- Você assiste a canais de TV e Rádio do mundo todo;

- Filmes, Séries, Esportes, Jogos de Futebol que só passam na TV fechada, e muito mais!

拒绝被退回的示例:(到我的个人领域)

---------- Forwarded message ----------
From: Mail Delivery System 
Date: Wednesday, December 5, 2012
Subject: Mail delivery failed: returning message to sender
To: [email protected]


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [email protected]
    SMTP error from remote mail server after end of data:
    host gmail-smtp-in.l.google.com [173.194.67.26]:
    550-5.7.1 [78.129.132.155       7] Our system has detected that this message is
    550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
    550-5.7.1 this message has been blocked. Please visit
    550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for
    550 5.7.1 more information. d60si3060066wej.11
  [email protected]
    SMTP error from remote mail server after end of data:
    host gmail-smtp-in.l.google.com [173.194.67.26]:
    550-5.7.1 [78.129.132.155       7] Our system has detected that this message is
    550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
    550-5.7.1 this message has been blocked. Please visit
    550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for
    550 5.7.1 more information. d60si3060066wej.11

--

进出口银行会议

addresslist whitelist_senders = lsearch;/etc/virtual/whitelist_senders
addresslist blacklist_senders = lsearch;/etc/virtual/blacklist_senders
domainlist blacklist_domains = lsearch;/etc/virtual/blacklist_domains
domainlist whitelist_domains = lsearch;/etc/virtual/whitelist_domains
domainlist local_domains = lsearch;/etc/virtual/domains
domainlist relay_domains = lsearch;/etc/virtual/domains : localhost
domainlist use_rbl_domains = lsearch;/etc/virtual/use_rbl_domains
hostlist auth_relay_hosts = *
hostlist bad_sender_hosts = lsearch;/etc/virtual/bad_sender_hosts
hostlist bad_sender_hosts_ip = net-lsearch;/etc/virtual/bad_sender_hosts
hostlist relay_hosts = net-lsearch;/etc/virtual/pophosts
hostlist whitelist_hosts = lsearch;/etc/virtual/whitelist_hosts
hostlist whitelist_hosts_ip = net-lsearch;/etc/virtual/whitelist_hosts

答案1

请打开您的 Exim 配置文件(很可能是/etc/exim/exim.conf)并查找以下指令:

hostlist relay_from_hosts = 127.0.0.1

应将其设置为 127.0.0.1,以防止您的邮件服务器中继来自其他主机的电子邮件。也许您在那里有一个外部 IP 地址。

相关内容