Jump to content
  • 0

Setting An Email Return-Path For Bounces


Question

6 answers to this question

Recommended Posts

  • 0
Posted
  On 10/4/2014 at 11:59 AM, Licensecart said:

That should be done via the control panel / mail program if I understand you correctly, we can do it on InterWorx:

 

 

 

that for serverwide . the OP ask i think for single account , with return-patch else than the sender email . this option should be added the email header php .

 

i have not make a deep looking for it . but i believe it should do some tweak in php file .

  • 0
Posted

Correct. I don't want to change it server-wide, just for mail sent from Blesta.

 

After some more digging, it looks like Blesta uses Swift Mailer for email. According to the Swift Mailer docs, it's possible to set a separate return-path, but I couldn't find the identical code in Blesta's implementation. Unfortunately, I don't know enough about coding to recognize variations, so I'm not sure what change, or where to change it.

  • 0
Posted

Found it!
 
In components/email/email.php at line 90

private function newMessage() {
  $this->message = Swift_Message::newInstance();
  $this->message->setMaxLineLength($this->max_line_length);
  
  $this->message->setCharset($this->charset);
}

add this line before the closing curly bracket:

$this->message->setReturnPath('bounces@example.com');

so that you end up with this:

private function newMessage() {
  $this->message = Swift_Message::newInstance();
  $this->message->setMaxLineLength($this->max_line_length);
		
  $this->message->setCharset($this->charset);
  $this->message->setReturnPath('bounces@example.com');
}

It will add your custom return-path to outgoing mail.
 
It would be nice to see this as an option for each company in Settings.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...