*
* This file contains functions needed to handle mime messages.
*
- * @copyright © 2003-2005 The SquirrelMail Project Team
+ * @copyright © 2003-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
$attachment->mime_header = $mime_header;
$this->entities[]=$attachment;
}
-}
-?>
\ No newline at end of file
+ /**
+ * Delete all attachments from this object from disk.
+ * @since 1.5.1
+ */
+ function purgeAttachments() {
+ if ($this->att_local_name && file_exists($this->att_local_name)) {
+ unlink($this->att_local_name);
+ }
+ // recursively delete attachments from entities contained in this object
+ for ($i=0, $entCount=count($this->entities);$i< $entCount; ++$i) {
+ $this->entities[$i]->purgeAttachments();
+ }
+ }
+}