2

嗨,我正在使用 apache james 电子邮件服务器 2.3.2 通过我的 Java 应用程序发送电子邮件,我已经设置它并使用 JavaMail API 1.4。我正在尝试向 gmail/yahoo 等邮件服务器发送电子邮件。

我可以将邮件发送到 localhost 上的帐户(本地运行的 James 帐户),但不能发送到外部电子邮件服务器。

我也更改了 /apps/config.xml 。我在 james 上有我的 MyMailet 示例。它没有抛出任何异常。但 mailet*.log 就像:

13/06/12 15:20:13 INFO  James.Mailet: MyMailet#init called
13/06/12 15:20:13 INFO  James.Mailet: RemoteAddrNotInNetwork: Authorized addresses: [127.0.0.1/255.255.255.255]
13/06/12 15:20:13 INFO  James.Mailet: RemoteDelivery: Total number of delayTime attempts exceeds maxRetries specified. Increasing maxRetries from 1 to 6
13/06/12 15:20:17 INFO  James.Mailet: MyMailet#service callednull from test@localhost
13/06/12 15:20:23 INFO  James.Mailet: RemoteDelivery: Attempting delivery of Mail1339581017690-0 to host 192.168.15.186 at 192.168.15.186 for addresses [shreyas1910@gmail.com]
13/06/12 15:20:23 INFO  James.Mailet: RemoteDelivery: null
13/06/12 15:20:23 INFO  James.Mailet: RemoteDelivery: Temporary exception delivering mail (Mail1339581017690-0: 
13/06/12 15:20:23 INFO  James.Mailet: RemoteDelivery: Storing message Mail1339581017690-0 into outgoing after 0 retries

dnsserver*.log 就像:

13/06/12 15:20:13 INFO  dnsserver: DNS Server is: 192.168.15.3

james*.log like:
13/06/12 15:20:13 INFO  James: JAMES init...
13/06/12 15:20:13 INFO  James: Local host is: IISD27
13/06/12 15:20:13 INFO  James: Handling mail for: 97.74.180.1
13/06/12 15:20:13 INFO  James: Handling mail for: iisd27
13/06/12 15:20:13 INFO  James: Handling mail for: gmail.com
13/06/12 15:20:13 INFO  James: Handling mail for: 74.125.236.182
13/06/12 15:20:13 INFO  James: Handling mail for: 74.125.236.181
13/06/12 15:20:13 INFO  James: Handling mail for: 127.0.0.1
13/06/12 15:20:13 INFO  James: Handling mail for: localhost
13/06/12 15:20:13 INFO  James: Local users repository opened
13/06/12 15:20:13 INFO  James: Private Repository LocalInbox opened
13/06/12 15:20:13 INFO  James: JAMES ...init end

和 cofig.xml 就像:

    <processor name="transport">
        <mailet match="All" class="RemoteDelivery">
        <outgoing> file://var/mail/outgoing/ </outgoing>

            <gateway>192.168.15.186</gateway>//My IP addresss. Tried with smtp.gmail.com also
            <gatewayPort>25</gatewayPort>
            <gatewayusername>user123</gatewayusername>
        <gatewayPassword>pass123</gatewayPassword>

        <!-- Set the HELO/EHLO name to use when connectiong to remote SMTP-Server -->

        <mail.smtp.localhost>myMailServer</mail.smtp.localhost>

        </mailet>

  </processor>
4

1 回答 1

2

我认为由此引起的问题:

电子邮件服务器在接受任何邮件之前都会执行反向 dns 查询。他们检查电子邮件来自的域的 ip 以及电子邮件真正来自的 ip。

如果域的 ip 和电子邮件发件人的 ip 不匹配,邮件服务器会认为电子邮件是垃圾邮件或垃圾邮件。

在这里,因为您的域(我不知道它是什么 :-? )在电子邮件服务器发送反向 dns 查询没有获得 IP 并认为您的邮件是垃圾邮件或垃圾邮件时不是有效地址。

有关更多信息,请查看:http ://wiki.junkemailfilter.com/index.php/Fixing_Reverse_DNS

于 2012-12-04T15:44:29.190 回答