Author Message
liu159
Joined: Jan 19, 2015
Messages: 96
Offline
I am using EDP 3.0.3

And my app requires sending emails to users from "itoc@avaya.com".

I have my app installed in two environments:

In testing environment, we use account "edptest@avata.com", which does not require authentication and it allows us to send as whatever we want. So we can just assign "itoc@avaya.com" to be "from" parameter in the EmailRequest.

In production environment, we use account "engage@avaya.com", which requires authentication, and when it does that, can only send as itself.

My code works fine in testing environment as following:

EmailRequest emailRequest = EmailFactory.createEmailRequest();
emailRequest.setFrom(from);
emailRequest.getBcc().add(to);
emailRequest.setSubject(title);
emailRequest.setTextBody(text);

final MyEmailListener myEmailListener =
new MyEmailListener(emailRequest);
emailRequest.setListener(myEmailListener);

try
{
emailRequest.send();
logger.info("SendEmail: Sent message successfully....");
}

But when it comes to production environment, I got this error by using "itoc@avaya.com" as sender (from field):

[Status= 500 Detail= 550 5.7.1 Client does not have permissions to send as this sender ] for emailRequest[ Bcc=liu159@avaya.com, Subject=test prod Message=test prod]

What should I do to achieve my goal ?

KurtHaserodt
Joined: Nov 12, 2013
Messages: 21
Offline
This message is coming back from the SMTP server. You'll need to work with the owner of that server to determine why the account you send from has no permissions. Using "tshark" to take a trace of the session that the EmailConnector creates should help. On the Breeze node, run: tshark -i eth1 -w /tmp/mail.pcap tcp port 25

Send your test email. It will be queued, but should send out to the email server within 60 seconds. If you don't see packets exchanged within this time, try tshark -i eth0

Also you should upgrade to Breeze 3.2.
uhaani
Joined: Jun 9, 2016
Messages: 8
Offline
Can you have the credentials provisioned on the Connector for the account that is authorized to use in the given “from” address.
KurtHaserodt
Joined: Nov 12, 2013
Messages: 21
Offline
The From: and ReplyTo: addresses are set by the proper methods on the EmailRequest class. The account (user) and password used to login to the email sending server is only specified in the connector's attributes. Some email servers restrict the From: address to be the same as the account, though usually not the ReplyTo. If the From or ReplyTo is not specified in the EmailRequest, then the connector's Default Sender's or Reply To settings are used. If there is no default From (and no From in the EmailRequest) an error will be posted.

Most email sending servers have tightened their security requirements, so that they allow sending only as the logged in user. You'll have to negotiate with your sending server provider if you want to send as others from a single account. The default email connector can login only as a single account. If you have more than one account you'll need either to write your own email connector or use the JavaMail API (https://java.net/projects/javamail/pages/Home) from your snap-in directly (the default email connector uses JavaMail).

We have found that restrictions on ReplyTo have not been tightened, and you're more free to put other addresses there.
Go to:   
Mobile view