From db22535b60cb0cb07c6b5376051cfd61453591f6 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 8 May 2025 08:33:07 +0530 Subject: [PATCH] minor css bug, added dropper --- dropattachP.php | 41 +++++++++++++++++++++++++++++ dropmail.php | 2 +- dropmailP.php | 60 ++++++++++++++++++++++++++++++++++++++++++ resources/css/boil.css | 2 +- 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 dropattachP.php create mode 100644 dropmailP.php diff --git a/dropattachP.php b/dropattachP.php new file mode 100644 index 0000000..a5fbb0f --- /dev/null +++ b/dropattachP.php @@ -0,0 +1,41 @@ +"; + } else { + echo "Error deleting file '$file'.
"; + } + } + } + } + // Close the directory handle + closedir($handle); + // Attempt to remove the directory itself + if (rmdir($dir)) { + echo "Directory '$dir' deleted successfully.
"; + } else { + echo "Error deleting directory '$dir'.
"; + } + } +} + +$folderPath = '/home/u146541135/domains/zemail.me/public_html/public/tmp/premium/attachments/'; + +// Ensure the folder path exists and is a directory +if (is_dir($folderPath)) { + deleteFiles($folderPath); +} else { + echo "Folder '$folderPath' does not exist or is not a directory."; +} +?> diff --git a/dropmail.php b/dropmail.php index 5abfa59..d4f12a4 100644 --- a/dropmail.php +++ b/dropmail.php @@ -16,7 +16,7 @@ date_default_timezone_set($newTimezone); $imapDB = json_decode(config('app.settings.imap_settings'), true); // Mailbox credentials -$hostname = '{'.$imapDB['host'].':'.$imapDB['premium_port'].'/ssl}INBOX'; +$hostname = '{'.$imapDB['host'].':'.$imapDB['port'].'/ssl}INBOX'; $username = $imapDB['username']; $password = $imapDB['password']; diff --git a/dropmailP.php b/dropmailP.php new file mode 100644 index 0000000..bd3558f --- /dev/null +++ b/dropmailP.php @@ -0,0 +1,60 @@ +make(Illuminate\Contracts\Console\Kernel::class); +$kernel->bootstrap(); + +set_time_limit(0); + +$newTimezone = 'Europe/London'; +date_default_timezone_set($newTimezone); + +$imapDB = json_decode(config('app.settings.imap_settings'), true); + +// Mailbox credentials +$hostname = '{'.$imapDB['premium_host'].':'.$imapDB['premium_port'].'/ssl}INBOX'; +$username = $imapDB['premium_username']; +$password = $imapDB['premium_password']; + +// Connect to mailbox +$inbox = imap_open($hostname, $username, $password); + +// Check for connection errors +if (!$inbox) { + die('Could not connect to mailbox: ' . imap_last_error()); +} + +// Get current time in Unix timestamp +$current_time = time(); + +// Search for messages older than one day +$search_criteria = 'BEFORE "' . date('d-M-Y', strtotime('-3 hours', $current_time)) . '"'; +$messages = imap_search($inbox, $search_criteria); + +$batch_size = 10; +$deleted_count = 0; + +if ($messages) { + $chunks = array_chunk($messages, $batch_size); + foreach ($chunks as $chunk) { + foreach ($chunk as $message_number) { + imap_delete($inbox, $message_number); + } + imap_expunge($inbox); + $deleted_count += count($chunk); + } + echo $deleted_count . ' messages older than specified time have been deleted.'; +} else { + echo 'No messages older than specified time found in mailbox.'; +} + +// Close mailbox connection +imap_close($inbox); + + + +?> diff --git a/resources/css/boil.css b/resources/css/boil.css index 0788878..7de6558 100644 --- a/resources/css/boil.css +++ b/resources/css/boil.css @@ -103,7 +103,7 @@ .premium-btn .crown-bg2 { transform-style: preserve-3d; position: absolute; - background: url('https://zemailnator.test/images/crown.webp') no-repeat center center; + background: url('/images/crown.webp') no-repeat center center; background-size: contain; animation: rotateCrownY 2s linear infinite; }