Use same machanism that phplist uses to download atachments. Using a file similer to dl.php.
In fact the new file dl_mailtolist.php is a copy of dl.php with some tiny changes.
If needed these changes can directly placed inside dl.php.