Here an easy way to set up an email sandbox in Linux. All email sent from the server will be forwarded to an external email address.

  1. Install postfix with pcre support.

apt-get install postfix postfix-pcre

  1. Create the file /etc/postfix/virtual with the following line it (replace with the email address that should receive all email).


  1. edit /etc/postfix/ and add the following line at the end

virtual_alias_maps = pcre:/etc/postfix/virtual

  1. Restart postfix.