You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2015/10/23 19:50:53 UTC

Review Request 39602: Emails Dispatched From Ambari Are Not RFC 2822 Compliant And May Be Rejected

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39602/
-----------------------------------------------------------

Review request for Ambari and Nate Cole.


Bugs: AMBARI-13540
    https://issues.apache.org/jira/browse/AMBARI-13540


Repository: ambari


Description
-------

When dispatching alert emails through some servers they are rejected with:

```
<am...@apache.org>: host smtp.apache.org1.2.3.4 said: 
550-5.7.1 1.2.3.4 11 Our system has detected that this 
message is 550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam 
sent to Gmail, 550-5.7.1 this message has been blocked. Please review 550 
5.7.1 RFC 2822 specifications for more information. f188si13510144qhe.108
```

This is because strict RFC 2822 compliance expects the {{From}} and {{To}} headers in the data of the message body as opposed to the {{MAIL FROM}} and {{RCPT TO}} directives.

Rejected
```
>telnet smtp.ambari.apache.org 25
EHLO
MAIL FROM: ambari@smtp.ambari.apache.org
RCPT TO: ambari@smtp.ambari.apache.org
DATA
Subject: Test message with From and To header
Test.
.
QUIT
```

Accepted
```
>telnet smtp.ambari.apache.org 25
EHLO
MAIL FROM: ambari@smtp.ambari.apache.org
RCPT TO: ambari@smtp.ambari.apache.org
DATA
From: ambari@smtp.ambari.apache.org
To: ambari@smtp.ambari.apache.org
Subject: Test message with From and To header
Test.
.
QUIT
```

We should be setting the headers on the {{MimeMessage}} as well.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java 78c36f8 
  ambari-server/src/main/java/org/apache/ambari/server/notifications/Notification.java 5a58aff 
  ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcher.java f0fc032 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java 70e2940 
  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java e0662fb 
  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAOTest.java 1fded28 

Diff: https://reviews.apache.org/r/39602/diff/


Testing
-------

Verified that emails are delivered through servers that reject non-RFC 2822 compliant emails


Thanks,

Jonathan Hurley


Re: Review Request 39602: Emails Dispatched From Ambari Are Not RFC 2822 Compliant And May Be Rejected

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39602/#review103855
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Oct. 23, 2015, 4:39 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39602/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2015, 4:39 p.m.)
> 
> 
> Review request for Ambari and Nate Cole.
> 
> 
> Bugs: AMBARI-13540
>     https://issues.apache.org/jira/browse/AMBARI-13540
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When dispatching alert emails through some servers they are rejected with:
> 
> ```
> <am...@apache.org>: host smtp.apache.org1.2.3.4 said: 
> 550-5.7.1 1.2.3.4 11 Our system has detected that this 
> message is 550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam 
> sent to Gmail, 550-5.7.1 this message has been blocked. Please review 550 
> 5.7.1 RFC 2822 specifications for more information. f188si13510144qhe.108
> ```
> 
> This is because strict RFC 2822 compliance expects the {{From}} and {{To}} headers in the data of the message body as opposed to the {{MAIL FROM}} and {{RCPT TO}} directives.
> 
> Rejected
> ```
> >telnet smtp.ambari.apache.org 25
> EHLO
> MAIL FROM: ambari@smtp.ambari.apache.org
> RCPT TO: ambari@smtp.ambari.apache.org
> DATA
> Subject: Test message with From and To header
> Test.
> .
> QUIT
> ```
> 
> Accepted
> ```
> >telnet smtp.ambari.apache.org 25
> EHLO
> MAIL FROM: ambari@smtp.ambari.apache.org
> RCPT TO: ambari@smtp.ambari.apache.org
> DATA
> From: ambari@smtp.ambari.apache.org
> To: ambari@smtp.ambari.apache.org
> Subject: Test message with From and To header
> Test.
> .
> QUIT
> ```
> 
> We should be setting the headers on the {{MimeMessage}} as well.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/notifications/Notification.java 5a58aff 
>   ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcher.java f0fc032 
> 
> Diff: https://reviews.apache.org/r/39602/diff/
> 
> 
> Testing
> -------
> 
> Verified that emails are delivered through servers that reject non-RFC 2822 compliant emails
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 39602: Emails Dispatched From Ambari Are Not RFC 2822 Compliant And May Be Rejected

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39602/
-----------------------------------------------------------

(Updated Oct. 23, 2015, 4:39 p.m.)


Review request for Ambari and Nate Cole.


Changes
-------

Fixing bad diff patch


Bugs: AMBARI-13540
    https://issues.apache.org/jira/browse/AMBARI-13540


Repository: ambari


Description
-------

When dispatching alert emails through some servers they are rejected with:

```
<am...@apache.org>: host smtp.apache.org1.2.3.4 said: 
550-5.7.1 1.2.3.4 11 Our system has detected that this 
message is 550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam 
sent to Gmail, 550-5.7.1 this message has been blocked. Please review 550 
5.7.1 RFC 2822 specifications for more information. f188si13510144qhe.108
```

This is because strict RFC 2822 compliance expects the {{From}} and {{To}} headers in the data of the message body as opposed to the {{MAIL FROM}} and {{RCPT TO}} directives.

Rejected
```
>telnet smtp.ambari.apache.org 25
EHLO
MAIL FROM: ambari@smtp.ambari.apache.org
RCPT TO: ambari@smtp.ambari.apache.org
DATA
Subject: Test message with From and To header
Test.
.
QUIT
```

Accepted
```
>telnet smtp.ambari.apache.org 25
EHLO
MAIL FROM: ambari@smtp.ambari.apache.org
RCPT TO: ambari@smtp.ambari.apache.org
DATA
From: ambari@smtp.ambari.apache.org
To: ambari@smtp.ambari.apache.org
Subject: Test message with From and To header
Test.
.
QUIT
```

We should be setting the headers on the {{MimeMessage}} as well.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/notifications/Notification.java 5a58aff 
  ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcher.java f0fc032 

Diff: https://reviews.apache.org/r/39602/diff/


Testing
-------

Verified that emails are delivered through servers that reject non-RFC 2822 compliant emails


Thanks,

Jonathan Hurley