Is there anyway can overwrite Return-Parth when send email

Is there anyway can overwrite Return-Parth when send email

  

Hi,

We have a requirement to redirect delivery failed (bounced) emails to a generic mail box which is different from email from. And we found a solution that by adding bounced email into "Return-Path" email header. But it doesn't work in outsystems, the bounced email still send to email from address, can expert help? would be very appreciate.

Hui Ping Dong wrote:

Hi,

We have a requirement to redirect delivery failed (bounced) emails to a generic mail box which is different from email from. And we found a solution that by adding bounced email into "Return-Path" email header. But it doesn't work in outsystems, the bounced email still send to email from address, can expert help? would be very appreciate.

Hui,

You can set this up on Email Action. Look above

OutSystems Ver.: 10.0


Hi César,

Thanks for your reply, we only can try with outsystems version 10 in the public cloud, but we don't have a smtp for testing. And I did a try with outsystems version 8, it didn't work, bounced email still sent to email from. I tried a non-bounced email, and find the "Return-Path" in email header still same as email from. Do you have a workaround for outsystems version 8?

Hui Ping Dong wrote:

Hi César,

Thanks for your reply, we only can try with outsystems version 10 in the public cloud, but we don't have a smtp for testing. And I did a try with outsystems version 8, it didn't work, bounced email still sent to email from. I tried a non-bounced email, and find the "Return-Path" in email header still same as email from. Do you have a workaround for outsystems version 8?


Hui,

Here with OS v10 worked perfectly. I´ll put the images or maybe an screencast to show you how I did.

ok?


Using Personal Cloud too.





César Mateus wrote:

Hui Ping Dong wrote:

Hi César,

Thanks for your reply, we only can try with outsystems version 10 in the public cloud, but we don't have a smtp for testing. And I did a try with outsystems version 8, it didn't work, bounced email still sent to email from. I tried a non-bounced email, and find the "Return-Path" in email header still same as email from. Do you have a workaround for outsystems version 8?


Hui,

Here with OS v10 worked perfectly. I´ll put the images or maybe an screencast to show you how I did.

ok?


Using Personal Cloud too.





Hui,

I´ll try to explain. 

You need at first set your enviroment to proper send an email. 

I configured the SMTP with my Personal Environment using GMAIL

Now You can put any email header properties in the Extended Propertie in Email Component.

And Program how you will send the email like above

Log in Service Center

And finally I received the email in my mailbox and see the reply-to. Just what I set in Component email


Hope You understand the dynamic of this development


Best Regards

Hi César,

Thanks for your detail explanation, I also did in this way for setting email header, the problem is only "Return-Path" doesn't work, it always been overwritten to email from by smtp server. Can you help try in Outsystems 10?

Let me explain more detail about my situation:

Below is the source code written by Java, it works fine, email to "xxx@xxx.com" cannot be delivered, and the bounced email send to "generic-bounced@company.com" instead of the email from "email-from@company.com", and it's because of the red line source code. And I also want a workaround in Outsystems, just tell smtp server that don't overwrite "Return-Path".

String to = "xxx@xxx.com";
String from = "email-from@company.com";
String bounceAddr = "generic-bounced@company.com";

Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", "smtpserver");
properties.put("mail.smtp.from", bounceAddr);//This will add "Return-Path: generic-bounced@company.com" in email header, and smtp server won't overwrite also
Session session = Session.getDefaultInstance(properties);

try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Ping");
message.setText("Hello, this is example of sending email  ");

// Send message
Transport.send(message);
System.out.println("message sent successfully....");

} catch (MessagingException mex) {
mex.printStackTrace();
}

Hui Ping Dong wrote:

Hi César,

Thanks for your detail explanation, I also did in this way for setting email header, the problem is only "Return-Path" doesn't work, it always been overwritten to email from by smtp server. Can you help try in Outsystems 10?

Let me explain more detail about my situation:

Below is the source code written by Java, it works fine, email to "xxx@xxx.com" cannot be delivered, and the bounced email send to "generic-bounced@company.com" instead of the email from "email-from@company.com", and it's because of the red line source code. And I also want a workaround in Outsystems, just tell smtp server that don't overwrite "Return-Path".

String to = "xxx@xxx.com";
String from = "email-from@company.com";
String bounceAddr = "generic-bounced@company.com";

Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", "smtpserver");
properties.put("mail.smtp.from", bounceAddr);//This will add "Return-Path: generic-bounced@company.com" in email header, and smtp server won't overwrite also
Session session = Session.getDefaultInstance(properties);

try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Ping");
message.setText("Hello, this is example of sending email  ");

// Send message
Transport.send(message);
System.out.println("message sent successfully....");

} catch (MessagingException mex) {
mex.printStackTrace();
}

Hui,

I undestood the problem but the email componente still changed the header approprietly

Look above

Email Setup

Header Property


Hi César,

I tried gmail smtp in outsystems 10, but unfortunately, bounced mail still sent to email from, not "Return-Path". Can you try send a email to an invalid email address like xxx@xxx.com, and see which email box can receive the bounced email?