Skip to content

Commit

Permalink
Merge branches 'master' and 'master' of github.com:HaschekSolutions/o…
Browse files Browse the repository at this point in the history
…pentrashmail
  • Loading branch information
geek-at committed Nov 24, 2023
2 parents b200949 + 97f427b commit 4298f1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -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`
Expand Down
17 changes: 6 additions & 11 deletions web/inc/core.php
Expand Up @@ -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)
Expand Down

0 comments on commit 4298f1a

Please sign in to comment.