Merge branches 'master' and 'master' of github.com:HaschekSolutions/opentrashmail

This commit is contained in:
Chris 2023-11-24 18:19:11 +00:00
commit 4298f1a294
2 changed files with 10 additions and 11 deletions

View file

@ -1,5 +1,9 @@
# Changelog
## V1.2.3
- Fixed attachment deletion bug
- Fixed random email generation
## V1.2.0
- Implemented IP/Subnet filter using the config option `ALLOWED_IPS`
- Implemented Password authentication of the site and API using config option `PASSWORD`

View file

@ -134,17 +134,12 @@ function attachmentExists($email,$id,$attachment=false)
function listAttachmentsOfMailID($email,$id)
{
$o = array();
if ($handle = opendir(getDirForEmail($email).DS.'attachments')) {
while (false !== ($entry = readdir($handle))) {
if (startsWith($entry,$id.'-')) {
$o[] = $entry;
}
}
closedir($handle);
}
return $o;
$data = json_decode(file_get_contents(getDirForEmail($email).DS.$id.'.json'),true);
$attachments = $data['parsed']['attachments'];
if(!is_array($attachments))
return [];
else
return $attachments;
}
function deleteEmail($email,$id)