title: Processing an Email Bounce back in CakePHP and Postfix
body: <p>I'm trying to handle bounced message and send to a responsible System Administrator. </p>
  
  <p>I use CakePHP Email Component to send the message. On server side, I use postfix to transport the message.</p>
  
  <pre><code>function sendAsEmail($data) {
    $Email-&gt;sendAs = 'html';
    $Email-&gt;from = $user['Sender']['username'] . '@example.com';
    $Email-&gt;return = Configure::read('App.systemAdminEmail');
    $Email-&gt;bcc = array($data['Message']['recipient_text']);
    $content = 'Some content';
    $Email-&gt;send($content);
  }
  </code></pre>
  
  <p>As you can see above, I set the $Email->return to sysadmin's email which it will send all the bounced message.</p>
  
  <p>On postfix configuration, I tried creating a bounce.cf template and set bounce_template_file. <a href="http://www.howtoforge.com/configure-custom-postfix-bounce-messages" rel="nofollow noreferrer">http://www.howtoforge.com/configure-custom-postfix-bounce-messages</a></p>
  
  <p>How do I get the bounced message and send it to System Administrator?</p>