diff --git a/app/ColorPicker.php b/app/ColorPicker.php new file mode 100644 index 0000000..e6a1bb8 --- /dev/null +++ b/app/ColorPicker.php @@ -0,0 +1,47 @@ + ["dark" => "dark:bg-amber-500", "light" => "bg-amber-800"], + "B" => ["dark" => "dark:bg-blue-500", "light" => "bg-blue-800"], + "C" => ["dark" => "dark:bg-cyan-500", "light" => "bg-cyan-800"], + "D" => ["dark" => "dark:bg-emerald-500", "light" => "bg-emerald-800"], + "E" => ["dark" => "dark:bg-fuchsia-500", "light" => "bg-fuchsia-800"], + "F" => ["dark" => "dark:bg-gray-500", "light" => "bg-gray-800"], + "G" => ["dark" => "dark:bg-green-500", "light" => "bg-green-800"], + "H" => ["dark" => "dark:bg-indigo-500", "light" => "bg-indigo-800"], + "I" => ["dark" => "dark:bg-lime-500", "light" => "bg-lime-800"], + "J" => ["dark" => "dark:bg-neutral-500", "light" => "bg-neutral-800"], + "K" => ["dark" => "dark:bg-orange-500", "light" => "bg-orange-800"], + "L" => ["dark" => "dark:bg-pink-500", "light" => "bg-pink-800"], + "M" => ["dark" => "dark:bg-purple-500", "light" => "bg-purple-800"], + "N" => ["dark" => "dark:bg-red-500", "light" => "bg-red-800"], + "O" => ["dark" => "dark:bg-rose-500", "light" => "bg-rose-800"], + "P" => ["dark" => "dark:bg-sky-500", "light" => "bg-sky-800"], + "Q" => ["dark" => "dark:bg-slate-500", "light" => "bg-slate-800"], + "R" => ["dark" => "dark:bg-stone-500", "light" => "bg-stone-800"], + "S" => ["dark" => "dark:bg-teal-500", "light" => "bg-teal-800"], + "T" => ["dark" => "dark:bg-violet-500", "light" => "bg-violet-800"], + "U" => ["dark" => "dark:bg-yellow-500", "light" => "bg-yellow-800"], + "V" => ["dark" => "dark:bg-zinc-500", "light" => "bg-zinc-800"], + "W" => ["dark" => "dark:bg-neutral-500", "light" => "bg-neutral-800"], + "X" => ["dark" => "dark:bg-slate-500", "light" => "bg-slate-800"], + "Y" => ["dark" => "dark:bg-stone-500", "light" => "bg-stone-800"], + "Z" => ["dark" => "dark:bg-teal-500", "light" => "bg-teal-800"] + ]; + + $letter = strtoupper($letter); + + if (isset($colorReferences[$letter])) { + return $colorReferences[$letter]; + } + + return ["dark" => "dark:bg-gray-500", "light" => "bg-gray-800"]; + + } +} diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index c1e8bfe..8d1a89c 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -26,6 +26,32 @@ class AppController extends Controller public function app() { return redirect()->route('home'); } + public function switch($email) { + ZEmail::setEmail($email); + if (json_decode(config('app.settings.configuration_settings'))->disable_mailbox_slug) { + return redirect()->route('home'); + } + return redirect()->route('mailbox'); + } + + public function delete($email = null) { + if ($email) { + $emails = ZEmail::getEmails(); + ZEmail::removeEmail($email); + return redirect()->route('mailbox'); + } else { + return redirect()->route('home'); + } + } + + public function locale($locale) { + if (in_array($locale, config('app.locales'))) { + session(['locale' => $locale]); + return redirect()->back(); + } + abort(400); + } + private function getStringBetween($string, $start, $end) { $string = ' ' . $string; diff --git a/app/Livewire/Frontend/Action.php b/app/Livewire/Frontend/Action.php index a9ea897..3c68e13 100644 --- a/app/Livewire/Frontend/Action.php +++ b/app/Livewire/Frontend/Action.php @@ -41,8 +41,7 @@ class Action extends Component } $this->email = ZEmail::createCustomEmail($this->username, $this->domain); - $this->dispatch('updateEmail'); - $this->dispatch('closeModal'); + return redirect()->route('mailbox'); } public function random() { @@ -50,10 +49,8 @@ class Action extends Component return $this->showAlert('error', __('You have reached daily limit of maximum ') . json_decode(config('app.settings.configuration_settings'))->email_limit . __(' temp mail addresses.')); } $this->email = ZEmail::generateRandomEmail(); - $this->dispatch('updateEmail'); - $this->dispatch('closeModal'); - //$this->redirect(route('mailbox')); + return redirect()->route('mailbox'); } public function gmail() { @@ -61,21 +58,12 @@ class Action extends Component return $this->showAlert('error', __('You have reached daily limit of maximum ') . json_decode(config('app.settings.configuration_settings'))->email_limit . __(' temp mail addresses.')); } $this->email = ZEmail::generateRandomGmail(); - $this->dispatch('updateEmail'); - $this->dispatch('closeModal'); + return redirect()->route('mailbox'); } - public function deleteEmail(): void + public function deleteEmail() { - ZEmail::removeEmail($this->email); -// if (count($this->emails) <= 1 && json_decode(config('app.settings.configuration_settings'))->after_last_email_delete == 'redirect_to_homepage') { -// return redirect()->route('home'); -// } - $this->email = ZEmail::getEmail(true); - $this->emails = ZEmail::getEmails(); - - $this->dispatch('updateEmail'); - $this->dispatch('closeModal'); + return redirect()->route('delete', ['email' => $this->email]); } private function showAlert($type, $message): void diff --git a/app/Livewire/Frontend/Components/Mail.php b/app/Livewire/Frontend/Components/Mail.php index a581011..a601fc2 100644 --- a/app/Livewire/Frontend/Components/Mail.php +++ b/app/Livewire/Frontend/Components/Mail.php @@ -7,6 +7,12 @@ use Livewire\Component; class Mail extends Component { public $message; + public $messageId; + + public function setMessageId($messageId): void + { + $this->dispatch('setMessageId', ['messageId' => $messageId]); + } public function render() { diff --git a/app/Livewire/Frontend/Components/Message.php b/app/Livewire/Frontend/Components/Message.php new file mode 100644 index 0000000..5ab94dd --- /dev/null +++ b/app/Livewire/Frontend/Components/Message.php @@ -0,0 +1,16 @@ +email = $email; - $this->dispatch('updateEmail'); + return redirect()->route('switch', ['email' => $email]); } public function syncEmail(): void diff --git a/app/Livewire/Frontend/Mailbox.php b/app/Livewire/Frontend/Mailbox.php index dc8d415..6cd6143 100644 --- a/app/Livewire/Frontend/Mailbox.php +++ b/app/Livewire/Frontend/Mailbox.php @@ -2,13 +2,17 @@ namespace App\Livewire\Frontend; +use App\ColorPicker; use App\Models\Message; use App\Models\ZEmail; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Log; use Livewire\Component; class Mailbox extends Component { + use ColorPicker; + public $messages = []; public $deleted = []; public $error = ''; @@ -16,25 +20,32 @@ class Mailbox extends Component public $initial = false; public $type; public $overflow = false; + public $messageId; - protected $listeners = ['fetchMessages' => 'fetch', 'syncMailbox' => 'syncEmail']; + protected $listeners = ['fetchMessages' => 'fetch', 'syncMailbox' => 'syncEmail', 'setMessageId' => 'setMessageId']; - public function mount(): void + public function mount() { $this->email = ZEmail::getEmail(); $this->initial = false; + if (!ZEmail::getEmail()) { + return redirect()->route('home'); + } } public function syncEmail($email): void { $this->email = $email; $this->initial = false; + $this->messages = []; } public function fetch(): void { try { $count = count($this->messages); - + if ($count > 0) { + $this->messages = []; + } $responses = []; if (config('app.beta_feature') || !json_decode(config('app.settings.imap_settings'))->cc_check) { $responses = [ @@ -51,21 +62,6 @@ class Mailbox extends Component ]; } -// $responses = [ -// 'to' => ZEmail::getMessages($this->email, 'to', $this->deleted), -// ]; -// $imapSettings = json_decode(config('app.settings.imap_settings')); -// $betaFeature = config('app.beta_feature'); -// -// if ($betaFeature || empty($imapSettings?->cc_check)) { -// $responses['cc'] = [ -// 'data' => [], -// 'notifications' => [] -// ]; -// } else { -// $responses['cc'] = ZEmail::getMessages($this->email, 'cc', $this->deleted); -// } - $this->deleted = []; $this->messages = array_merge($responses['to']['data'], $responses['cc']['data']); $notifications = array_merge($responses['to']['notifications'], $responses['cc']['notifications']); @@ -90,22 +86,33 @@ class Mailbox extends Component } } $this->dispatch('stopLoader'); - $this->dispatch('loadDownload'); $this->initial = true; } public function delete($messageId) { - if (config('app.beta_feature')) { - Message::find($messageId)->delete(); - } - $this->deleted[] = $messageId; - foreach ($this->messages as $key => $message) { - if ($message['id'] == $messageId) { - $directory = './tmp/attachments/' . $messageId; - $this->rrmdir($directory); - unset($this->messages[$key]); + + try { + if (config('app.beta_feature')) { + Message::find($messageId)->delete(); } + if (config('app.fetch_from_db')) { + \App\Models\Email::where(['message_id' => $messageId])->delete(); + } + $this->deleted[] = $messageId; + foreach ($this->messages as $key => $message) { + if ($message['id'] == $messageId) { + $directory = public_path('tmp/attachments/') . $messageId; + $this->rrmdir($directory); + unset($this->messages[$key]); + } + } + + } catch ( + \Exception $exception + ) { + Log::error($exception->getMessage()); } + } public function render() diff --git a/app/Livewire/Home.php b/app/Livewire/Home.php index 0374ba4..fdef19b 100644 --- a/app/Livewire/Home.php +++ b/app/Livewire/Home.php @@ -2,10 +2,21 @@ namespace App\Livewire; +use App\Models\ZEmail; use Livewire\Component; class Home extends Component { + protected $listeners = ['fetchMessages' => 'checkIfAnyMessage']; + + public function checkIfAnyMessage() + { + $email = ZEmail::getEmail(); + $messages = ZEmail::getMessages($email); + if (count($messages['data']) > 0) { + return redirect()->route('mailbox'); + } + } public function render() { return view('livewire.home'); diff --git a/app/Models/Email.php b/app/Models/Email.php new file mode 100644 index 0000000..1e8f0e5 --- /dev/null +++ b/app/Models/Email.php @@ -0,0 +1,431 @@ + 'array', + 'cc' => 'array', + 'bcc' => 'array', + 'attachments' => 'array', // If attachments are stored as a JSON field + 'timestamp' => 'datetime', // Cast timestamp to Carbon instance + ]; + + public static function connectMailBox($imap = null): \Ddeboer\Imap\ConnectionInterface + { + if ($imap === null) { + $imap = json_decode(config('app.settings.imap_settings'), true); + } + $flags = $imap['protocol'] . '/' . $imap['encryption']; + if ($imap['validate_cert']) { + $flags = $flags . '/validate-cert'; + } else { + $flags = $flags . '/novalidate-cert'; + } + $server = new Server($imap['host'], $imap['port'], $flags); + return $server->authenticate($imap['username'], $imap['password']); + } + + public static function fetchProcessStoreEmail() + { + + try { + $allowed = explode(',', 'doc,docx,xls,xlsx,ppt,pptx,xps,pdf,dxf,ai,psd,eps,ps,svg,ttf,zip,rar,tar,gzip,mp3,mpeg,wav,ogg,jpeg,jpg,png,gif,bmp,tif,webm,mpeg4,3gpp,mov,avi,mpegs,wmv,flx,txt'); + $connection = \App\Models\Email::connectMailBox(); + $mailbox = $connection->getMailbox('INBOX'); +// $search = new SearchExpression(); +// $email = "gegsaf@e-pool.co.uk"; +// $search->addCondition(new To($email)); + + $messages = $mailbox->getMessages(); + //$messages = $mailbox->getMessages($search, \SORTDATE, true); + + $result = ''; + + foreach ($messages as $message) { + + $sender = $message->getFrom(); + $date = $message->getDate(); + if (!$date) { + $date = new \DateTime(); + if ($message->getHeaders()->get('udate')) { + $date->setTimestamp($message->getHeaders()->get('udate')); + } + } + $content = ''; + $contentText = ''; + $html = $message->getBodyHtml(); + $text = $message->getBodyText(); + + if ($text) { + $contentText = str_replace('', $text)); + } + + $obj = []; + + $to = $message->getHeaders()->get('To') ? array_map(function ($entry) { + return $entry->mailbox . '@' . $entry->host; + }, $message->getHeaders()->get('To')) : []; + + $cc = $message->getHeaders()->get('Cc') ? array_map(function ($entry) { + return $entry->mailbox . '@' . $entry->host; + }, $message->getHeaders()->get('Cc')) : []; + + $bcc = $message->getHeaders()->get('Bcc') ? array_map(function ($entry) { + return $entry->mailbox . '@' . $entry->host; + }, $message->getHeaders()->get('Bcc')) : []; + + $messageTime = $message->getDate(); + $utcTime = CarbonImmutable::instance($messageTime)->setTimezone('UTC')->toDateTimeString(); + + $obj['id'] = $message->getNumber(); + $obj['to'] = $to; + $obj['cc'] = $cc; + $obj['bcc'] = $bcc; + $obj['subject'] = $message->getSubject(); + $obj['sender_name'] = $sender->getName(); + $obj['sender_email'] = $sender->getAddress(); + $obj['timestamp'] = $utcTime; + $obj['size'] = $message->getSize(); + //$obj['date'] = $date->format(json_decode(config('app.settings.configuration_settings'))->date_format ?? 'd M Y h:i A'); + $obj['content'] = $content; + $obj['contentText'] = $contentText; + $obj['attachments'] = []; + //$obj['raw_headers'] = $message->getRawHeaders(); + //$obj['raw_body'] = $message->getRawMessage(); + + if ($message->hasAttachments()) { + $attachments = $message->getAttachments(); + $directory = './tmp/attachments/' . $obj['id'] . '/'; + + is_dir($directory) || mkdir($directory, 0777, true); + foreach ($attachments as $attachment) { + $filenameArray = explode('.', $attachment->getFilename()); + $extension = $filenameArray[count($filenameArray) - 1]; + if (in_array($extension, $allowed)) { + if (!file_exists($directory . $attachment->getFilename())) { + try { + file_put_contents( + $directory . $attachment->getFilename(), + $attachment->getDecodedContent() + ); + } catch (\Exception $e) { + \Illuminate\Support\Facades\Log::error($e->getMessage()); + } + + } + if ($attachment->getFilename() !== 'undefined') { + $url = config('app.settings.app_base_url') . str_replace('./', '/', $directory . $attachment->getFilename()); + $structure = $attachment->getStructure(); + if (isset($structure->id) && str_contains($obj['content'], trim($structure->id, '<>'))) { + $obj['content'] = str_replace('cid:' . trim($structure->id, '<>'), $url, $obj['content']); + } + $obj['attachments'][] = [ + 'file' => $attachment->getFilename(), + 'url' => $url + ]; + } + } + + } + + } + + $response['data'][] = $obj; + + if (!$message->isSeen()) { + $initialData = $obj; + $data = [ + 'message_id' => Carbon::parse($utcTime)->format('Ymd').$initialData['id'], + 'subject' => $initialData['subject'], + 'from_name' => $initialData['sender_name'], + 'from_email' => $initialData['sender_email'], + 'to' => $initialData['to'], + 'cc' => $initialData['cc'], + 'bcc' => $initialData['bcc'], + 'timestamp' => $initialData['timestamp'], // store in UTC + 'body_text' => $initialData['contentText'], + 'body_html' => $initialData['content'], + 'is_seen' => false, + 'is_flagged' => false, + 'size' => $initialData['size'], + 'mailbox' => 'INBOX', + 'raw_headers' => null, + 'raw_body' => null, + 'attachments' => $initialData['attachments'], + ]; + + try { + self::create($data); + $checkAction = config('app.move_or_delete'); + if ($checkAction != null) { + if ($checkAction == 'delete') { + $message->delete(); + } else { + $newMailBox = $connection->getMailbox($checkAction); + $message->move($newMailBox); + } + } + + } catch (\Exception $e) { + // \Log::error($e); + } + } else { + $initialData = $obj; + $data = [ + 'message_id' => Carbon::parse($utcTime)->format('Ymd').$initialData['id'], + 'subject' => $initialData['subject'], + 'from_name' => $initialData['sender_name'], + 'from_email' => $initialData['sender_email'], + 'to' => $initialData['to'], + 'cc' => $initialData['cc'], + 'bcc' => $initialData['bcc'], + 'timestamp' => $initialData['timestamp'], // store in UTC + 'body_text' => $initialData['contentText'], + 'body_html' => $initialData['content'], + 'is_seen' => true, + 'is_flagged' => false, + 'size' => $initialData['size'], + 'mailbox' => 'INBOX', + 'raw_headers' => null, + 'raw_body' => null, + 'attachments' => $initialData['attachments'], + ]; + + try { + self::create($data); + $checkAction = config('app.move_or_delete'); + if ($checkAction != null) { + if ($checkAction == 'delete') { + $message->delete(); + } else { + $newMailBox = $connection->getMailbox($checkAction); + $message->move($newMailBox); + } + } + + } catch (\Exception $e) { + // \Log::error($e); + } + } + + + + } + + $connection->expunge(); + + } catch (\Exception $e) { + \Illuminate\Support\Facades\Log::error($e->getMessage()); + } + } + + public static function fetchEmailFromDB($email) { + + $validator = Validator::make(['email' => $email], [ + 'email' => 'required|email' + ]); + + if ($validator->fails()) { + return []; + } + return self::whereJsonContains('to', $email)->orderBy('timestamp', 'desc')->get(); + } + + public static function parseEmail($email, $deleted = []): array + { + $messages = self::fetchEmailFromDB($email); + $limit = json_decode(config('app.settings.configuration_settings'))->fetch_messages_limit ?? 15; + $count = 1; + $response = [ + 'data' => [], + 'notifications' => [] + ]; + + foreach ($messages as $message) { + + if (in_array($message['message_id'], $deleted)) { + // If it exists, delete the matching record from the 'emails' table + Email::where('message_id', $message['message_id'])->delete(); + continue; + } + + $blocked = false; + + $timestamp = $message['timestamp']; + $carbonTimestamp = Carbon::parse($timestamp, 'UTC'); + $obj = []; + $obj['subject'] = $message['subject']; + $obj['sender_name'] = $message['from_name']; + $obj['sender_email'] = $message['from_email']; + $obj['timestamp'] = $message['timestamp']; + $obj['date'] = $carbonTimestamp->format('d M Y h:i A'); + $obj['datediff'] = $carbonTimestamp->diffForHumans(Carbon::now('UTC')); + $obj['id'] = $message['message_id']; + $obj['content'] = $message['body_html']; + $obj['contentText'] = $message['body_text']; + $obj['attachments'] = []; + $obj['is_seen'] = $message['is_seen']; + $obj['sender_photo'] = self::chooseColor(strtoupper(substr($message['from_name'] ?: $message['from_email'], 0, 1) )); + + + $domain = explode('@', $obj['sender_email'])[1]; + $blocked = in_array($domain, json_decode(config('app.settings.configuration_settings'))->blocked_domains); + if ($blocked) { + $obj['subject'] = __('Blocked'); + $obj['content'] = __('Emails from') . ' ' . $domain . ' ' . __('are blocked by Admin'); + $obj['contentText'] = __('Emails from') . ' ' . $domain . ' ' . __('are blocked by Admin'); + } + + if (count($message['attachments']) > 0 && !$blocked) { + $obj['attachments'] = $message['attachments']; + + } + + $response['data'][] = $obj; + if (!$message['is_seen']) { + $response['notifications'][] = [ + 'subject' => $obj['subject'], + 'sender_name' => $obj['sender_name'], + 'sender_email' => $obj['sender_email'] + ]; + if (config('app.zemail_log')) { + file_put_contents(storage_path('logs/zemail.csv'), request()->ip() . "," . date("Y-m-d h:i:s a") . "," . $obj['sender_email'] . "," . $email . PHP_EOL, FILE_APPEND); + } + } + Email::where('message_id', $message['message_id'])->update(['is_seen' => true]); + if (++$count > $limit) { + break; + } + } + return $response; + } + + public static function deleteBulkAttachments() + { + $dir = public_path('/tmp/attachments'); + + try { + if (File::exists($dir)) { + File::cleanDirectory($dir); + } + } catch (\Exception $e) { + \Illuminate\Support\Facades\Log::error($e->getMessage()); + } + } + + public static function deleteBulkMailboxes() + { + + + $foldersToClean = ['Trash', 'ZDUMP', 'INBOX']; + $cutoff = (new \DateTime())->modify('-3 hours'); + $totalDeleted = 0; + $maxToDelete = 100; + + foreach ($foldersToClean as $folderName) { + $connection = \App\Models\Email::connectMailBox(); + if ($totalDeleted >= $maxToDelete) { + $connection->expunge(); + break; + } + + if ($connection->hasMailbox($folderName)) { + $mailbox = $connection->getMailbox($folderName); + $messages = $mailbox->getMessages(new Since(new \DateTime('today'))); + + foreach ($messages as $message) { + if ($totalDeleted >= $maxToDelete) { + $connection->expunge(); + break 2; // exit both loops + } + + $messageDate = $message->getDate(); + if ($messageDate < $cutoff) { + $message->delete(); + $totalDeleted++; + } + } + } + $connection->expunge(); + } + + return "$totalDeleted message(s) deleted from Trash and ZDUMP."; + } + + public static function deleteMessagesFromDB() { + $cutoff = Carbon::now('UTC')->subHours(6)->toDateTimeString(); + $count = count(self::where('timestamp', '<', $cutoff) + ->orderBy('timestamp', 'desc') + ->get()); + + if ($count > 0) { + self::where('timestamp', '<', $cutoff)->delete(); + return "$count old message(s) deleted from the database."; + } + return "No messages older than 6 hours found."; + } + + public static function mailToDBStatus(): bool + { + $latestRecord = self::orderBy('timestamp', 'desc')->first(); + + if (!$latestRecord) { + return false; + } + + $currentTime = Carbon::now('UTC'); + $lastRecordTime = Carbon::parse($latestRecord->timestamp); + + // Check if the last record was added within the last 1 hour + if ($lastRecordTime->diffInMinutes($currentTime) < 5) { + return true; + } + return false; + } + +} diff --git a/app/Models/Message.php b/app/Models/Message.php index 58900ee..5ca944b 100644 --- a/app/Models/Message.php +++ b/app/Models/Message.php @@ -2,6 +2,7 @@ namespace App\Models; +use App\ColorPicker; use Carbon\Carbon; use Ddeboer\Imap\Search\Date\Since; use Ddeboer\Imap\Search\Email\Cc; @@ -14,7 +15,7 @@ use Illuminate\Support\Facades\Storage; class Message extends Model { - use HasFactory; + use HasFactory, ColorPicker; public static function store(Request $request): void { @@ -149,7 +150,6 @@ class Message extends Model $content = ''; $contentText = ''; $html = $message->getBodyHtml(); - $text = $message->getBodyText(); if ($text) { $contentText = str_replace('getName() ?: $sender->getAddress(), 0, 1) )); + //Checking if Sender is Blocked $domain = explode('@', $obj['sender_email'])[1]; $blocked = in_array($domain, json_decode(config('app.settings.configuration_settings'))->blocked_domains); if ($blocked) { $obj['subject'] = __('Blocked'); $obj['content'] = __('Emails from') . ' ' . $domain . ' ' . __('are blocked by Admin'); + $obj['contentText'] = __('Emails from') . ' ' . $domain . ' ' . __('are blocked by Admin'); } if ($message->hasAttachments() && !$blocked) { $attachments = $message->getAttachments(); @@ -189,10 +193,14 @@ class Message extends Model $extension = $filenameArray[count($filenameArray) - 1]; if (in_array($extension, $allowed)) { if (!file_exists($directory . $attachment->getFilename())) { - file_put_contents( - $directory . $attachment->getFilename(), - $attachment->getDecodedContent() - ); + try { + file_put_contents( + $directory . $attachment->getFilename(), + $attachment->getDecodedContent() + ); + } catch (\Exception $e) { + \Illuminate\Support\Facades\Log::error($e->getMessage()); + } } if ($attachment->getFilename() !== 'undefined') { $url = config('app.settings.app_base_url') . str_replace('./', '/', $directory . $attachment->getFilename()); diff --git a/app/Models/ZEmail.php b/app/Models/ZEmail.php index 910cf9f..577c082 100644 --- a/app/Models/ZEmail.php +++ b/app/Models/ZEmail.php @@ -14,11 +14,6 @@ use function str_replace; class ZEmail extends Model { - public static function check() - { - return ZEmail::createCustomEmail(username: 'sdcs', domain: 'e-pool.uk'); - } - public static function connectMailBox($imap = null): \Ddeboer\Imap\ConnectionInterface { if ($imap === null) { @@ -39,6 +34,16 @@ class ZEmail extends Model if (config('app.beta_feature')) { return Message::getMessages($email); } + if (config('app.force_db_mail')) { + return Email::parseEmail($email, $deleted); + } + if (config('app.fetch_from_db')) { + if (Email::mailToDBStatus()) { + return Email::parseEmail($email, $deleted); + } else { + return Message::fetchMessages($email, $type, $deleted); + } + } return Message::fetchMessages($email, $type, $deleted); } diff --git a/composer.json b/composer.json index f51eba3..73264b9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "laravel/framework": "^12.0", "laravel/tinker": "^2.10.1", "livewire/flux": "^2.1", - "livewire/livewire": "^3.6" + "livewire/livewire": "^3.6", + "ext-imap": "*" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.15", diff --git a/composer.lock b/composer.lock index 2a4065e..122a729 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8a5cd9a0ccf67c460d95ecb968192ef2", + "content-hash": "b4dcaf149eb8c0291c1de5ccd42c8f94", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -2102,16 +2102,16 @@ }, { "name": "laravel/framework", - "version": "v12.10.0", + "version": "v12.10.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "be0d6f39e18dd28d29f5dd2819a6c02eba61b7e5" + "reference": "0f123cc857bc177abe4d417448d4f7164f71802a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/be0d6f39e18dd28d29f5dd2819a6c02eba61b7e5", - "reference": "be0d6f39e18dd28d29f5dd2819a6c02eba61b7e5", + "url": "https://api.github.com/repos/laravel/framework/zipball/0f123cc857bc177abe4d417448d4f7164f71802a", + "reference": "0f123cc857bc177abe4d417448d4f7164f71802a", "shasum": "" }, "require": { @@ -2313,7 +2313,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-04-22T13:55:18+00:00" + "time": "2025-04-24T14:11:20+00:00" }, { "name": "laravel/prompts", @@ -3145,16 +3145,16 @@ }, { "name": "livewire/flux", - "version": "v2.1.4", + "version": "v2.1.5", "source": { "type": "git", "url": "https://github.com/livewire/flux.git", - "reference": "a19709fc94f5a1b795ce24ad42662bd398c19371" + "reference": "e24f05be20fa1a0ca027a11c2eea763cc539c82e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/flux/zipball/a19709fc94f5a1b795ce24ad42662bd398c19371", - "reference": "a19709fc94f5a1b795ce24ad42662bd398c19371", + "url": "https://api.github.com/repos/livewire/flux/zipball/e24f05be20fa1a0ca027a11c2eea763cc539c82e", + "reference": "e24f05be20fa1a0ca027a11c2eea763cc539c82e", "shasum": "" }, "require": { @@ -3202,9 +3202,9 @@ ], "support": { "issues": "https://github.com/livewire/flux/issues", - "source": "https://github.com/livewire/flux/tree/v2.1.4" + "source": "https://github.com/livewire/flux/tree/v2.1.5" }, - "time": "2025-04-14T11:59:19+00:00" + "time": "2025-04-24T22:52:25+00:00" }, { "name": "livewire/livewire", @@ -10929,7 +10929,8 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.2" + "php": "^8.2", + "ext-imap": "*" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/config/app.php b/config/app.php index d7bc011..51562e2 100644 --- a/config/app.php +++ b/config/app.php @@ -30,6 +30,9 @@ return [ 'zemail_log' => env('ENABLE_ZEMAIL_LOGS', false), 'beta_feature' => env('APP_BETA_FEATURE', false), + 'fetch_from_db' => env('FETCH_FETCH_FOR_DB', false), + 'force_db_mail' => env('FORCE_DB_MAIL', false), + 'move_or_delete' => env('MOVE_OR_DELETE', null), /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2025_04_25_195348_create_emails_table.php b/database/migrations/2025_04_25_195348_create_emails_table.php new file mode 100644 index 0000000..fc17184 --- /dev/null +++ b/database/migrations/2025_04_25_195348_create_emails_table.php @@ -0,0 +1,44 @@ +id(); + $table->string('message_id')->unique()->index(); + $table->string('subject')->nullable(); + $table->string('from_name')->nullable(); + $table->string('from_email'); + $table->text('to'); + $table->text('cc')->nullable(); + $table->text('bcc')->nullable(); + $table->dateTime('timestamp')->nullable(); + $table->longText('body_text')->nullable(); + $table->longText('body_html')->nullable(); + $table->boolean('is_seen')->default(false); + $table->boolean('is_flagged')->default(false); + $table->unsignedBigInteger('size')->nullable(); + $table->string('mailbox')->default('INBOX'); + $table->longText('raw_headers')->nullable(); + $table->longText('raw_body')->nullable(); + $table->json('attachments')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('emails'); + } +}; diff --git a/public/tmp/attachments/8079041/IMG-20250425-WA0000.jpg b/public/tmp/attachments/8079041/IMG-20250425-WA0000.jpg deleted file mode 100644 index e6b52c2..0000000 Binary files a/public/tmp/attachments/8079041/IMG-20250425-WA0000.jpg and /dev/null differ diff --git a/public/tmp/attachments/8079041/Screenshot_2025-04-22-10-12-51-40_6012fa4d4ddec268fc5c7112cbb265e7.jpg b/public/tmp/attachments/8079041/Screenshot_2025-04-22-10-12-51-40_6012fa4d4ddec268fc5c7112cbb265e7.jpg deleted file mode 100644 index 17898ae..0000000 Binary files a/public/tmp/attachments/8079041/Screenshot_2025-04-22-10-12-51-40_6012fa4d4ddec268fc5c7112cbb265e7.jpg and /dev/null differ diff --git a/public/tmp/attachments/8079041/null-20250325-WA0031.jpg b/public/tmp/attachments/8079041/null-20250325-WA0031.jpg deleted file mode 100644 index ed7e547..0000000 Binary files a/public/tmp/attachments/8079041/null-20250325-WA0031.jpg and /dev/null differ diff --git a/public/tmp/attachments/8079161/null-20250325-WA0031.jpg b/public/tmp/attachments/8079161/null-20250325-WA0031.jpg deleted file mode 100644 index ed7e547..0000000 Binary files a/public/tmp/attachments/8079161/null-20250325-WA0031.jpg and /dev/null differ diff --git a/resources/css/boil.css b/resources/css/boil.css index 345d9e2..5529522 100644 --- a/resources/css/boil.css +++ b/resources/css/boil.css @@ -58,3 +58,7 @@ .animate-progress { animation: progress 4s linear forwards; } + +.mailbox-min-height { + min-height: 60vh; +} diff --git a/resources/js/boil.js b/resources/js/boil.js index 3470bab..7ef20ed 100644 --- a/resources/js/boil.js +++ b/resources/js/boil.js @@ -1,14 +1,9 @@ document.addEventListener('DOMContentLoaded', () => { if (window.Livewire && typeof window.Livewire.dispatch === 'function') { - setTimeout(() => { - Livewire.dispatch('getEmail'); - }, 2000); - document.addEventListener('closeModal', () => { document.querySelectorAll('dialog[data-modal]').forEach(dialog => { if (typeof dialog.close === 'function') { dialog.close(); - console.log(`Closed dialog with data-modal="${dialog.getAttribute('data-modal')}"`); } }); }); @@ -55,15 +50,81 @@ toast.remove(); }, 4000); } -function handleDispatches(dispatches) { -dispatches.forEach(dispatch => { - if (dispatch.name === "showAlert") { - const params = dispatch.params[0]; - showToast(params); - } -}); -} window.addEventListener("showAlert", (event) => { const detail = event.detail[0]; showToast(detail); }); + +window.addEventListener("copyEmail", (event) => { + const element = document.getElementById("copyEmail"); + if (element) { + const textToCopy = element.innerHTML; + navigator.clipboard.writeText(textToCopy).then(() => { + const detail = { type: 'success', message: 'Email copied to clipboard' }; + showToast(detail); + }).catch(err => { + const detail = { type: 'error', message: 'Failed to copy email' }; + showToast(detail); + console.error('Copy failed:', err); + }); + } +}); + +window.addEventListener("downloadFile", function (event) { + const downloadId = event.detail?.download_id; + if (!downloadId) return; + + const messageContainer = document.querySelector(`#message-${downloadId}`); + if (!messageContainer) return; + + const textarea = messageContainer.querySelector("textarea"); + if (!textarea) return; + + const content = textarea.value; + const blob = new Blob([content], { type: "message/rfc822" }); + const url = URL.createObjectURL(blob); + + const link = document.createElement("a"); + link.href = url; + link.download = `email-${downloadId}.eml`; + document.body.appendChild(link); + link.click(); + + setTimeout(() => { + link.remove(); + URL.revokeObjectURL(url); + }, 2000); +}); + +window.addEventListener("printFile", function (event) { + const printId = event.detail?.print_id; + if (!printId) return; + + const messageContainer = document.querySelector(`#message-${printId}`); + if (!messageContainer) return; + + const textarea = messageContainer.querySelector("textarea"); + if (!textarea) return; + + const content = textarea.value; + + const printWindow = window.open('', '', 'width=800,height=600'); + if (!printWindow) return; + + printWindow.document.write(` + + + Email Print + + + ${content.replace(/\n/g, '
')} + + `); + + printWindow.document.close(); + printWindow.focus(); + printWindow.print(); + printWindow.close(); +}); diff --git a/resources/lang/ar.json b/resources/lang/ar.json new file mode 100644 index 0000000..647a95b --- /dev/null +++ b/resources/lang/ar.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "ارجع إلى صندوق البريد", + "Enter Username": "أدخل اسم المستخدم", + "Select Domain": "حدد المجال", + "Create": "إنشاء", + "Random": "عشوائي", + "Custom": "مخصص", + "Menu": "القائمة", + "Cancel": "إلغاء", + "Copy": "نسخة", + "Refresh": "تحديث", + "New": "جديد", + "Delete": "حذف", + "Download": "تنزيل", + "Fetching": "جلب", + "Empty Inbox": "علبة الوارد الفارغة", + "Error": "خطأ", + "Success": "النجاح", + "Close": "إغلاق", + "Email ID Copied to Clipboard": "تم نسخ معرف البريد الإلكتروني إلى الحافظة", + "Please enter Username": "الرجاء إدخال اسم المستخدم", + "Please Select a Domain": "الرجاء تحديد نطاق", + "Username not allowed": "اسم المستخدم غير مسموح به", + "Your Temporary Email Address": "عنوان بريدك الإلكتروني المؤقت", + "Attachments": "المرفقات", + "Blocked": "محظور", + "Emails from": "رسائل البريد الإلكتروني", + "are blocked by Admin": "يتم حظرها من قبل المشرف", + "No Messages": "لا توجد رسائل", + "Waiting for Incoming Messages": "انتظار الرسائل الواردة", + "Scan QR Code to access": "مسح رمز الاستجابة السريعة للوصول", + "Create your own Temp Mail": "قم بإنشاء بريد Temp الخاص بك", + "Your Temprorary Email": "بريدك الإلكتروني المؤقت", + "Enter a Username and Select the Domain": "أدخل اسم مستخدم وحدد المجال", + "Username length cannot be less than": "لا يمكن أن يكون طول اسم المستخدم أقل من", + "and greator than": "و أكبر من", + "Create a Random Email": "إنشاء بريد إلكتروني عشوائي", + "Sender": "مرسل", + "Subject": "موضوع", + "Time": "الوقت", + "Open": "افتح", + "Go Back to Inbox": "العودة إلى علبة الوارد", + "Date": "التاريخ", + "Copyright": "حق المؤلف", + "Ad Blocker Detected": "تم الكشف عن مانع الإعلانات", + "Disable the Ad Blocker to use ": "قم بتعطيل مانع الإعلانات لاستخدامه ", + "Your temporary email address is ready": "عنوان بريدك الإلكتروني المؤقت جاهز", + "You have reached daily limit of MAX ": "لقد وصلت إلى الحد اليومي لـ MAX ", + " temp mail": " بريد مؤقت", + "Sorry! That email is already been used by someone else. Please try a different email address.": "آسف! تم استخدام هذا البريد الإلكتروني بالفعل من قبل شخص آخر. يرجى تجربة عنوان بريد إلكتروني مختلف.", + "Invalid Captcha. Please try again": "كلمة التحقق غير صالحة. يرجى المحاولة مرة أخرى" +} \ No newline at end of file diff --git a/resources/lang/de.json b/resources/lang/de.json new file mode 100644 index 0000000..6fd6cef --- /dev/null +++ b/resources/lang/de.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Geh zurück zu MailBox", + "Enter Username": "Benutzername eingeben", + "Select Domain": "Wählen Sie Domäne", + "Create": "Erstellen", + "Random": "Zufällig", + "Custom": "Brauch", + "Menu": "Speisekarte", + "Cancel": "Stornieren", + "Copy": "Kopie", + "Refresh": "Aktualisieren", + "New": "Neue", + "Delete": "löschen", + "Download": "Downloaden", + "Fetching": "Abrufen", + "Empty Inbox": "Leerer Posteingang", + "Error": "Fehler", + "Success": "Erfolgreich", + "Close": "Schliessen", + "Email ID Copied to Clipboard": "E-Mail-ID in die Zwischenablage kopiert", + "Please enter Username": "Bitte geben Sie Ihren Benutzernamen", + "Please Select a Domain": "Bitte wählen Sie eine Domain", + "Username not allowed": "Benutzername ist nicht erlaubt", + "Your Temporary Email Address": "Ihre temporäre E-Mail-Adresse", + "Attachments": "Anhänge", + "Blocked": "Blockiert", + "Emails from": "E-Mails von", + "are blocked by Admin": "werden von Admin blockiert", + "No Messages": "Keine Nachrichten", + "Waiting for Incoming Messages": "Warten auf eingehende Nachrichten", + "Scan QR Code to access": "Scannen Sie den QR-Code für den Zugriff", + "Create your own Temp Mail": "Erstellen Sie Ihre eigene Temp Mail", + "Your Temprorary Email": "Ihre temporäre E-Mail", + "Enter a Username and Select the Domain": "Geben Sie einen Benutzernamen ein und wählen Sie die Domain", + "Username length cannot be less than": "Die Länge des Benutzernamens darf nicht kleiner sein als", + "and greator than": "und größer als", + "Create a Random Email": "Erstellen Sie eine zufällige E-Mail", + "Sender": "Absender", + "Subject": "Subjekt", + "Time": "Zeit", + "Open": "Offen", + "Go Back to Inbox": "Gehe zurück zum Posteingang", + "Date": "Datum", + "Copyright": "Copyright", + "Ad Blocker Detected": "Werbeblocker erkannt", + "Disable the Ad Blocker to use ": "Deaktivieren Sie den zu verwendenden Werbeblocker ", + "Your temporary email address is ready": "Ihre temporäre E-Mail-Adresse ist bereit", + "You have reached daily limit of MAX ": "Sie haben das Tageslimit von MAX erreicht ", + " temp mail": " Temporäre E-Mail", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Entschuldigung! Diese E-Mail wurde bereits von jemand anderem verwendet. Bitte versuchen Sie es mit einer anderen E-Mail-Adresse.", + "Invalid Captcha. Please try again": "Ungültiges Captcha. Bitte versuche es erneut" +} \ No newline at end of file diff --git a/resources/lang/en.json b/resources/lang/en.json new file mode 100644 index 0000000..34c0ac5 --- /dev/null +++ b/resources/lang/en.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Get back to MailBox", + "Enter Username": "Enter Username", + "Select Domain": "Select Domain", + "Create": "Create", + "Random": "Random", + "Custom": "Custom", + "Menu": "Menu", + "Cancel": "Cancel", + "Copy": "Copy", + "Refresh": "Refresh", + "New": "New", + "Delete": "Delete", + "Download": "Download", + "Fetching": "Fetching", + "Empty Inbox": "Empty Inbox", + "Error": "Error", + "Success": "Success", + "Close": "Close", + "Email ID Copied to Clipboard": "Email ID Copied to Clipboard", + "Please enter Username": "Please enter Username", + "Please Select a Domain": "Please Select a Domain", + "Username not allowed": "Username not allowed", + "Your Temporary Email Address": "Your Temporary Email Address", + "Attachments": "Attachments", + "Blocked": "Blocked", + "Emails from": "Emails from", + "are blocked by Admin": "are blocked by Admin", + "No Messages": "No Messages", + "Waiting for Incoming Messages": "Waiting for Incoming Messages", + "Scan QR Code to access": "Scan QR Code to access", + "Create your own Temp Mail": "Create your own Temp Mail", + "Your Temprorary Email": "Your Temprorary Email", + "Enter a Username and Select the Domain": "Enter a Username and Select the Domain", + "Username length cannot be less than": "Username length cannot be less than", + "and greator than": "and greator than", + "Create a Random Email": "Create a Random Email", + "Sender": "Sender", + "Subject": "Subject", + "Time": "Time", + "Open": "Open", + "Go Back to Inbox": "Go Back to Inbox", + "Date": "Date", + "Copyright": "Copyright", + "Ad Blocker Detected": "Ad Blocker Detected", + "Disable the Ad Blocker to use ": "Disable the Ad Blocker to use ", + "Your temporary email address is ready": "Your temporary email address is ready", + "You have reached daily limit of MAX ": "You have reached daily limit of MAX ", + " temp mail": " temp mail", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Sorry! That email is already been used by someone else. Please try a different email address.", + "Invalid Captcha. Please try again": "Invalid Captcha. Please try again" +} \ No newline at end of file diff --git a/resources/lang/es.json b/resources/lang/es.json new file mode 100644 index 0000000..b2a450b --- /dev/null +++ b/resources/lang/es.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Regresar al buzón", + "Enter Username": "Introduce tu nombre", + "Select Domain": "Seleccionar dominio", + "Create": "Crear", + "Random": "aleatorio", + "Custom": "Personalizado", + "Menu": "Menú", + "Cancel": "Cancelar", + "Copy": "Copia", + "Refresh": "Actualizar", + "New": "Nuevo", + "Delete": "Borrar", + "Download": "Descargar", + "Fetching": "Atractivo", + "Empty Inbox": "Bandeja de entrada vacía", + "Error": "Error", + "Success": "Éxito", + "Close": "Cerrar", + "Email ID Copied to Clipboard": "ID de correo electrónico copiado en el portapapeles", + "Please enter Username": "Introduce tu nombre de usuario", + "Please Select a Domain": "Seleccione un dominio", + "Username not allowed": "Nombre de usuario no permitido", + "Your Temporary Email Address": "Su dirección de correo electrónico temporal", + "Attachments": "Archivos adjuntos", + "Blocked": "Bloqueado", + "Emails from": "Correos electrónicos de", + "are blocked by Admin": "están bloqueados por el administrador", + "No Messages": "Sin mensajes", + "Waiting for Incoming Messages": "Esperando mensajes entrantes", + "Scan QR Code to access": "Escanea el código QR para acceder", + "Create your own Temp Mail": "Crea tu propio correo temporal", + "Your Temprorary Email": "Tu correo electrónico temporal", + "Enter a Username and Select the Domain": "Ingrese un nombre de usuario y seleccione el dominio", + "Username length cannot be less than": "El nombre de usuario no puede ser inferior a", + "and greator than": "y mayor que", + "Create a Random Email": "Crear un correo electrónico aleatorio", + "Sender": "Remitente", + "Subject": "Asunto", + "Time": "Tiempo", + "Open": "Abierto", + "Go Back to Inbox": "Regresar a la bandeja de entrada", + "Date": "Fecha", + "Copyright": "derechos de autor", + "Ad Blocker Detected": "Bloqueador de anuncios detectado", + "Disable the Ad Blocker to use ": "Desactivar el bloqueador de anuncios para usar ", + "Your temporary email address is ready": "Tu dirección de correo electrónico temporal está lista", + "You have reached daily limit of MAX ": "Has alcanzado el límite diario de MAX ", + " temp mail": " correo temporal", + "Sorry! That email is already been used by someone else. Please try a different email address.": "¡Lo siento! Ese correo electrónico ya lo ha utilizado otra persona. Prueba con otra dirección de correo electrónico.", + "Invalid Captcha. Please try again": "Captcha no válido. Inténtalo de nuevo" +} \ No newline at end of file diff --git a/resources/lang/fr.json b/resources/lang/fr.json new file mode 100644 index 0000000..bd6eb24 --- /dev/null +++ b/resources/lang/fr.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Revenir à la boîte aux lettres", + "Enter Username": "Entrez votre nom", + "Select Domain": "Sélectionner un domaine", + "Create": "Créer", + "Random": "Aléatoire", + "Custom": "Personnalisé", + "Menu": "Menu", + "Cancel": "Annuler", + "Copy": "Copier", + "Refresh": "Actualiser", + "New": "Nouveau", + "Delete": "Supprimer", + "Download": "Télécharger", + "Fetching": "Récupération", + "Empty Inbox": "Boîte de réception vide", + "Error": "Erreur", + "Success": "Le succès", + "Close": "Fermer", + "Email ID Copied to Clipboard": "ID d'e-mail copié dans le presse-papiers", + "Please enter Username": "Veuillez entrer votre nom d'utilisateur", + "Please Select a Domain": "Veuillez sélectionner un domaine", + "Username not allowed": "Nom d'utilisateur non autorisé", + "Your Temporary Email Address": "Votre adresse e-mail temporaire", + "Attachments": "Pièces jointes", + "Blocked": "Bloqué", + "Emails from": "E-mails de", + "are blocked by Admin": "sont bloqués par l'administrateur", + "No Messages": "Aucun message", + "Waiting for Incoming Messages": "En attente de messages entrants", + "Scan QR Code to access": "Scannez le code QR pour y accéder", + "Create your own Temp Mail": "Créez votre propre courrier temporaire", + "Your Temprorary Email": "Votre e-mail temporaire", + "Enter a Username and Select the Domain": "Entrez un nom d'utilisateur et sélectionnez le domaine", + "Username length cannot be less than": "La longueur du nom d'utilisateur ne peut être inférieure à", + "and greator than": "et plus grand que", + "Create a Random Email": "Créer un e-mail aléatoire", + "Sender": "L'expéditeur", + "Subject": "Objet", + "Time": "Heure", + "Open": "Ouvert", + "Go Back to Inbox": "Revenir à la boîte de réception", + "Date": "Date", + "Copyright": "Copyright", + "Ad Blocker Detected": "Bloqueur de publicité détecté", + "Disable the Ad Blocker to use ": "Désactiver le bloqueur de publicités pour utiliser ", + "Your temporary email address is ready": "Votre adresse e-mail temporaire est prête", + "You have reached daily limit of MAX ": "Vous avez atteint la limite quotidienne de MAX ", + " temp mail": " courrier temporaire", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Désolé ! Cette adresse e-mail a déjà été utilisée par quelqu'un d'autre. Veuillez essayer une autre adresse e-mail.", + "Invalid Captcha. Please try again": "Captcha non valide. Veuillez réessayer" +} \ No newline at end of file diff --git a/resources/lang/hi.json b/resources/lang/hi.json new file mode 100644 index 0000000..4a0afb6 --- /dev/null +++ b/resources/lang/hi.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "MailBox पर वापस जाएं", + "Enter Username": "यूजरनेम डालें", + "Select Domain": "डोमेन चुनें", + "Create": "सृजन करना", + "Random": "रैंडम", + "Custom": "मनपसंद", + "Menu": "मेन्यू", + "Cancel": "रद्द करना", + "Copy": "नक़ल", + "Refresh": "रिफ्रेश", + "New": "नवीन व", + "Delete": "मिटाएँ", + "Download": "डाऊलोड", + "Fetching": "ला रहा है", + "Empty Inbox": "खाली इनबॉक्स", + "Error": "एरर", + "Success": "सक्सेस", + "Close": "बन्द करें", + "Email ID Copied to Clipboard": "क्लिपबोर्ड में कॉपी की गई ईमेल आईडी", + "Please enter Username": "कृपया यूजरनेम डालें", + "Please Select a Domain": "कृपया एक डोमेन चुनें", + "Username not allowed": "उपयोगकर्ता नाम की अनुमति नहीं है", + "Your Temporary Email Address": "आपका अस्थाई ईमेल पता", + "Attachments": "अटैचमेंट", + "Blocked": "अवरोधित", + "Emails from": "से ईमेल", + "are blocked by Admin": "व्यवस्थापक द्वारा अवरोधित हैं", + "No Messages": "कोई सन्देश नहीं", + "Waiting for Incoming Messages": "आने वाले संदेशों की प्रतीक्षा कर रहा है", + "Scan QR Code to access": "एक्सेस करने के लिए QR कोड स्कैन करें", + "Create your own Temp Mail": "अपना खुद का टेम्प मेल बनाएं", + "Your Temprorary Email": "आपका अस्थायी ईमेल", + "Enter a Username and Select the Domain": "एक उपयोगकर्ता नाम दर्ज करें और डोमेन चुनें", + "Username length cannot be less than": "उपयोगकर्ता नाम की लंबाई से कम नहीं हो सकती", + "and greator than": "और अधिक से अधिक", + "Create a Random Email": "रैंडम ईमेल बनाएँ", + "Sender": "प्रेषक", + "Subject": "विषय", + "Time": "टाइम", + "Open": "ओपन", + "Go Back to Inbox": "इनबॉक्स पर वापस जाएँ", + "Date": "दिनांक", + "Copyright": "कॉपीराइट", + "Ad Blocker Detected": "विज्ञापन अवरोधक का पता चला", + "Disable the Ad Blocker to use ": "उपयोग करने के लिए विज्ञापन अवरोधक को अक्षम करें ", + "Your temporary email address is ready": "आपका अस्थायी ईमेल पता तैयार है", + "You have reached daily limit of MAX ": "आप MAX की दैनिक सीमा तक पहुँच चुके हैं ", + " temp mail": " अस्थायी मेल", + "Sorry! That email is already been used by someone else. Please try a different email address.": "माफ़ करना! उस ईमेल का उपयोग पहले से ही किसी और द्वारा किया जा चुका है। कृपया एक अलग ईमेल पता आज़माएं।", + "Invalid Captcha. Please try again": "अमान्य कैप्चा। कृपया फिर से कोशिश करें" +} \ No newline at end of file diff --git a/resources/lang/id.json b/resources/lang/id.json new file mode 100644 index 0000000..a6a43f4 --- /dev/null +++ b/resources/lang/id.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Kembali Ke Kotak Surat", + "Enter Username": "Masukkan Nama Pengguna", + "Select Domain": "Pilih Domain", + "Create": "Buat", + "Random": "Acak", + "Custom": "kustom", + "Menu": "Menu", + "Cancel": "Batal", + "Copy": "Copy", + "Refresh": "Segarkan", + "New": "Baru", + "Delete": "Hapus", + "Download": "Unduh", + "Fetching": "Fetching", + "Empty Inbox": "Kotak Masuk Kosong", + "Error": "Error", + "Success": "Suksess", + "Close": "Tutup", + "Email ID Copied to Clipboard": "Salin Email ID Ke Papan Klip", + "Please enter Username": "Silahkan Masukkan Nama Pengguna", + "Please Select a Domain": "Silahkan Pilih Domain", + "Username not allowed": "Nama Pengguna Tidak Diizinkan", + "Your Temporary Email Address": "Alamat Email Sementara Anda", + "Attachments": "Attachments", + "Blocked": "Di Blokir", + "Emails from": "Emails Dari", + "are blocked by Admin": "Di Blokir Oleh Admin", + "No Messages": "Tidak Ada Pesan", + "Waiting for Incoming Messages": "Menunggu Email Masuk", + "Scan QR Code to access": "Scan QR Code Untuk Mengakses", + "Create your own Temp Mail": "Buat Email Sementara Anda", + "Your Temprorary Email": "Email Sementara Anda", + "Enter a Username and Select the Domain": "Masukkan Nama Pengguna Dan Pilih Nama Domain", + "Username length cannot be less than": "Panjang Nama Pengguna Tidak Boleh Kurang Dari", + "and greator than": "dan lebih besar dari", + "Create a Random Email": "Bikin Email Acak", + "Sender": "Pengirim", + "Subject": "Subjek", + "Time": "Waktu", + "Open": "Buka", + "Go Back to Inbox": "kembali Ke Kotak Masuk", + "Date": "Tanggal", + "Copyright": "Copyright", + "Ad Blocker Detected": "Ad Blocker Terdeteksi", + "Disable the Ad Blocker to use ": "Nonaktifkan Ad Blocker untuk Melanjutkan ", + "Your temporary email address is ready": "Alamat Email Sementara Anda Sudah SIAP", + "You have reached daily limit of MAX ": "Anda Sudah Mencapai Batas Maksimal", + " temp mail": " Email Sementara", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Maaf! Email Tersebut Sudah digunakan oleh user lain, Silahkan mencoba dengan alamat email lain.", + "Invalid Captcha. Please try again": "Invalid Captcha. Silahkan Coba Lagi" +} \ No newline at end of file diff --git a/resources/lang/no.json b/resources/lang/no.json new file mode 100644 index 0000000..7299217 --- /dev/null +++ b/resources/lang/no.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Gå tilbake til innboks", + "Enter Username": "Fyll inn brukernavn", + "Select Domain": "Velg domene", + "Create": "Opprett", + "Random": "Random", + "Custom": "Tilpass", + "Menu": "Meny", + "Cancel": "Avbryt", + "Copy": "Kopier", + "Refresh": "Oppdater", + "New": "Ny", + "Delete": "Slett", + "Download": "Last ned", + "Fetching": "Mottar", + "Empty Inbox": "Tom Innboks", + "Error": "Feil", + "Success": "Suksess", + "Close": "Lukk", + "Email ID Copied to Clipboard": "E-post-adresse kopiert til utklippstavlen", + "Please enter Username": "Vennligst fyll inn brukernavn", + "Please Select a Domain": "Vennligst velg domene", + "Username not allowed": "Brukernavn ikke tillatt", + "Your Temporary Email Address": "Din Midlertidige E-postadresse", + "Attachments": "Vedlegg", + "Blocked": "Blokkert", + "Emails from": "E-post fra", + "are blocked by Admin": "er blokkert av Admin", + "No Messages": "Ingen Meldinger", + "Waiting for Incoming Messages": "Venter på innkommende meldinger", + "Scan QR Code to access": "Skann QR Kode for tilgang", + "Create your own Temp Mail": "Opprett din egen Midlertidige E-post", + "Your Temprorary Email": "Din Mindlertidige E-post", + "Enter a Username and Select the Domain": "Fyll inn brukernavn og velg domene", + "Username length cannot be less than": "Brukernavnet kan ikke inneholde mindre enn", + "and greator than": "og mer enn", + "Create a Random Email": "Opprett tilfeldig e-post", + "Sender": "Sendt fra", + "Subject": "Tittel", + "Time": "Tid", + "Open": "Åpne", + "Go Back to Inbox": "Gå tilbake til innboks", + "Date": "Dato", + "Copyright": "Copyright", + "Ad Blocker Detected": "Annonseblokkering oppdaget", + "Disable the Ad Blocker to use ": "Deaktiver annonseblokkeringen som skal brukes ", + "Your temporary email address is ready": "Din midlertidige e-postadresse er klar", + "You have reached daily limit of MAX ": "Du har nådd en daglig grense på MAX ", + " temp mail": " temp post", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Unnskyld! Den e-posten er allerede brukt av noen andre. Prøv en annen e-postadresse.", + "Invalid Captcha. Please try again": "Ugyldig Captcha. Vennligst prøv på nytt" +} \ No newline at end of file diff --git a/resources/lang/pl.json b/resources/lang/pl.json new file mode 100644 index 0000000..369196d --- /dev/null +++ b/resources/lang/pl.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Wróć do skrzynki pocztowej", + "Enter Username": "Wprowadź nazwę użytkownika", + "Select Domain": "Wybierz domenę", + "Create": "Stwórz", + "Random": "losowe", + "Custom": "Niestandardowe", + "Menu": "Menu", + "Cancel": "Anuluj", + "Copy": "Kopiuj", + "Refresh": "Odśwież", + "New": "Nowość", + "Delete": "Usuń", + "Download": "Pobierz", + "Fetching": "Pobieranie", + "Empty Inbox": "Puste Skrzynka", + "Error": "Błąd", + "Success": "Sukces", + "Close": "Zamknij", + "Email ID Copied to Clipboard": "Identyfikator e-mail skopiowany do schowka", + "Please enter Username": "Podaj nazwę użytkownika", + "Please Select a Domain": "Wybierz domenę", + "Username not allowed": "Nazwa użytkownika niedozwolona", + "Your Temporary Email Address": "Twój tymczasowy adres e-mail", + "Attachments": "Załączniki", + "Blocked": "Blokowane", + "Emails from": "E-maile od", + "are blocked by Admin": "są blokowane przez administratora", + "No Messages": "Brak wiadomości", + "Waiting for Incoming Messages": "Oczekiwanie na wiadomości przychodzących", + "Scan QR Code to access": "Zeskanuj kod QR, aby uzyskać dostęp", + "Create your own Temp Mail": "Stwórz własną pocztę tymczasową", + "Your Temprorary Email": "Twój Temprorary Email", + "Enter a Username and Select the Domain": "Wprowadź nazwę użytkownika i wybierz domenę", + "Username length cannot be less than": "Długość nazwy użytkownika nie może być mniejsza niż", + "and greator than": "i greator niż", + "Create a Random Email": "Utwórz losową wiadomość e-mail", + "Sender": "Nadawca", + "Subject": "Temat", + "Time": "Czas", + "Open": "Otwórz", + "Go Back to Inbox": "Wróć do skrzynki odbiorczej", + "Date": "Data", + "Copyright": "Prawo autorskie", + "Ad Blocker Detected": "Wykryto blokowanie reklam", + "Disable the Ad Blocker to use ": "Wyłącz bloker reklam w celu użycia ", + "Your temporary email address is ready": "Twój tymczasowy adres e-mail jest gotowy", + "You have reached daily limit of MAX ": "Osiągnąłeś dzienny limit MAX ", + " temp mail": " tymczasowa poczta", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Przepraszam! Ten e-mail jest już używany przez kogoś innego. Wypróbuj inny adres e-mail.", + "Invalid Captcha. Please try again": "Nieprawidłowy Captcha. Proszę spróbować ponownie" +} \ No newline at end of file diff --git a/resources/lang/ru.json b/resources/lang/ru.json new file mode 100644 index 0000000..a54aa36 --- /dev/null +++ b/resources/lang/ru.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Вернитесь в Mailbox", + "Enter Username": "Введите имя пользователя", + "Select Domain": "Выберите домен", + "Create": "Создайте", + "Random": "Случайный", + "Custom": "Пользовательский", + "Menu": "меню", + "Cancel": "Отмена", + "Copy": "Копировать", + "Refresh": "Обновить", + "New": "Новый", + "Delete": "Удалить", + "Download": "Загрузить", + "Fetching": "Выбивка", + "Empty Inbox": "Пустой почтовый ящик", + "Error": "ошибка", + "Success": "Успех", + "Close": "Закрыть", + "Email ID Copied to Clipboard": "Идентификатор электронной почты скопирован в буфер обмена", + "Please enter Username": "Пожалуйста, введите имя пользователя", + "Please Select a Domain": "Пожалуйста, выберите домен", + "Username not allowed": "Имя пользователя не разрешено", + "Your Temporary Email Address": "Ваш временный адрес электронной почты", + "Attachments": "Вложения", + "Blocked": "Заблокировано", + "Emails from": "Письма от", + "are blocked by Admin": "заблокированы администратором", + "No Messages": "Нет сообщений", + "Waiting for Incoming Messages": "Ожидание входящих сообщений", + "Scan QR Code to access": "Отсканируйте QR-код для доступа", + "Create your own Temp Mail": "Создайте свою собственную Temp Mail", + "Your Temprorary Email": "Ваш временный адрес электронной почты", + "Enter a Username and Select the Domain": "Введите имя пользователя и выберите домен", + "Username length cannot be less than": "Длина имени пользователя не может быть меньше", + "and greator than": "и больше, чем", + "Create a Random Email": "Создайте случайное письмо", + "Sender": "Отправитель", + "Subject": "Тема", + "Time": "Время", + "Open": "Открыть", + "Go Back to Inbox": "Вернуться в папку «Входящие»", + "Date": "Дата", + "Copyright": "авторское", + "Ad Blocker Detected": "Обнаружен блокировщик рекламы", + "Disable the Ad Blocker to use ": "Отключите блокировщик рекламы для использования ", + "Your temporary email address is ready": "Ваш временный адрес электронной почты готов", + "You have reached daily limit of MAX ": "Вы достигли суточного лимита MAX ", + " temp mail": " временная почта", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Извините! Этим письмом уже воспользовался кто-то другой. Пожалуйста, укажите другой адрес электронной почты.", + "Invalid Captcha. Please try again": "Неверная капча. Пожалуйста, попробуйте еще раз" +} \ No newline at end of file diff --git a/resources/lang/tr.json b/resources/lang/tr.json new file mode 100644 index 0000000..53c20d4 --- /dev/null +++ b/resources/lang/tr.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "MailBox'a geri dön", + "Enter Username": "Kullanıcı Adı Girin", + "Select Domain": "Alan Adı Seç", + "Create": "Oluştur", + "Random": "Rastgele", + "Custom": "Özel", + "Menu": "Menü", + "Cancel": "İptal", + "Copy": "Kopya", + "Refresh": "Yenile", + "New": "Yeni", + "Delete": "Sil", + "Download": "İndir", + "Fetching": "Gedirme", + "Empty Inbox": "Boş Gelen Kutusu", + "Error": "Hata", + "Success": "Başarı", + "Close": "Kapat", + "Email ID Copied to Clipboard": "E-posta Kimliği Panoya Kopyalandı", + "Please enter Username": "Lütfen Kullanıcı Adı girin", + "Please Select a Domain": "Lütfen Bir Alan Adı Seçiniz", + "Username not allowed": "Kullanıcı adı izin verilmiyor", + "Your Temporary Email Address": "Geçici E-posta Adresiniz", + "Attachments": "Ekler", + "Blocked": "Engellendi", + "Emails from": "E-postalar", + "are blocked by Admin": "Admin tarafından engellendi", + "No Messages": "Mesaj Yok", + "Waiting for Incoming Messages": "Gelen Mesajları Bekleme", + "Scan QR Code to access": "Erişim için QR Kodunu tarayın", + "Create your own Temp Mail": "Kendi Temp Mail'inizi Oluşturun", + "Your Temprorary Email": "Geçici E-postanız", + "Enter a Username and Select the Domain": "Bir Kullanıcı Adı Girin ve Etki Alanını Seçin", + "Username length cannot be less than": "Kullanıcı adı uzunluğu", + "and greator than": "ve greator", + "Create a Random Email": "Rastgele E-posta Oluşturma", + "Sender": "Gönderen", + "Subject": "Konu", + "Time": "Zaman", + "Open": "Aç", + "Go Back to Inbox": "Gelen Kutusuna Geri Dön", + "Date": "Tarih", + "Copyright": "Telif hakkı", + "Ad Blocker Detected": "Reklam Engelleyici Algılandı", + "Disable the Ad Blocker to use ": "Kullanmak için Reklam Engelleyiciyi devre dışı bırakın ", + "Your temporary email address is ready": "Geçici e-posta adresiniz hazır", + "You have reached daily limit of MAX ": "Günlük MAX sınırına ulaştınız ", + " temp mail": " geçici posta", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Üzgünüm! Bu e-posta zaten başka biri tarafından kullanılmış. Lütfen farklı bir e-posta adresi deneyin.", + "Invalid Captcha. Please try again": "Geçersiz Captcha. Lütfen tekrar deneyin" +} \ No newline at end of file diff --git a/resources/lang/vi.json b/resources/lang/vi.json new file mode 100644 index 0000000..ba6c27c --- /dev/null +++ b/resources/lang/vi.json @@ -0,0 +1,52 @@ +{ + "Get back to MailBox": "Quay lại Mailbox", + "Enter Username": "Nhập tên người dùng", + "Select Domain": "Chọn tên miền", + "Create": "Tạo", + "Random": "Ngẫu nhiên", + "Custom": "Tùy chỉnh", + "Menu": "Menu", + "Cancel": "Hủy", + "Copy": "Sao chép", + "Refresh": "Làm mới", + "New": "Mới", + "Delete": "Xoá", + "Download": "Tải xuống", + "Fetching": "Lấy", + "Empty Inbox": "Hộp thư đến trống", + "Error": "Lỗi", + "Success": "Thành công", + "Close": "Đóng", + "Email ID Copied to Clipboard": "Email ID được sao chép vào bảng tạm", + "Please enter Username": "Vui lòng nhập tên người dùng", + "Please Select a Domain": "Vui lòng chọn một tên miền", + "Username not allowed": "Tên người dùng không được phép", + "Your Temporary Email Address": "Địa chỉ email tạm thời của bạn", + "Attachments": "Phần đính kèm", + "Blocked": "Bị chặn", + "Emails from": "Email từ", + "are blocked by Admin": "bị chặn bởi Admin", + "No Messages": "Không có tin nhắn", + "Waiting for Incoming Messages": "Đang chờ tin nhắn đến", + "Scan QR Code to access": "Quét mã QR để truy cập", + "Create your own Temp Mail": "Tạo Thư tạm thời của riêng bạn", + "Your Temprorary Email": "Email tạm thời của bạn", + "Enter a Username and Select the Domain": "Nhập tên người dùng và chọn tên miền", + "Username length cannot be less than": "Độ dài tên người dùng không thể nhỏ hơn", + "and greator than": "và greator hơn", + "Create a Random Email": "Tạo Email Ngẫu nhiên", + "Sender": "Người gửi", + "Subject": "Subject", + "Time": "Thời gian", + "Open": "Mở", + "Go Back to Inbox": "Quay lại Hộp thư đến", + "Date": "Ngày", + "Copyright": "Bản quyền", + "Ad Blocker Detected": "Đã phát hiện Quảng cáo Blocker", + "Disable the Ad Blocker to use ": "Tắt Trình chặn quảng cáo để sử dụng ", + "Your temporary email address is ready": "Địa chỉ email tạm thời của bạn đã sẵn sàng", + "You have reached daily limit of MAX ": "Bạn đã đạt đến giới hạn hàng ngày của MAX ", + " temp mail": " thư tạm thời", + "Sorry! That email is already been used by someone else. Please try a different email address.": "Xin lỗi! Email đó đã được người khác sử dụng. Vui lòng thử một địa chỉ email khác.", + "Invalid Captcha. Please try again": "Captcha không hợp lệ. Vui lòng thử lại" +} \ No newline at end of file diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php index dfb95d3..4c72c29 100644 --- a/resources/views/components/layouts/app.blade.php +++ b/resources/views/components/layouts/app.blade.php @@ -21,8 +21,18 @@ - Inbox - Refresh + Inbox +{{-- Refresh--}} + sideAds @@ -34,8 +44,9 @@ Contacts -

© {{ config('app.settings.app_name') }}

+

© {{ config('app.settings.app_name') }}

+ @@ -43,14 +54,27 @@ - - - + + + + + + + + @foreach(config('app.locales') as $item => $language) + {{ config('app.locales_text')[$item] }} + @endforeach + + + + + + You are signed in as:
@@ -71,57 +95,92 @@ + +
+
+ Generate Your Temporary Email +
+ + + + + + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ Delete account? + +

You're about to delete this account.

+
+
+
+ + + Cancel + + +
+
+
- - -
-
- Generate Your Temporary Email -
- - - - - - -
-
- -
-
- -
-
- -
-
- - -
-
- Delete account? - -

You're about to delete this account.

-
-
-
- - - Cancel - - -
-
-
- {{ $slot }}
- @fluxScripts + diff --git a/resources/views/livewire/frontend/action.blade.php b/resources/views/livewire/frontend/action.blade.php index 261a405..7509723 100644 --- a/resources/views/livewire/frontend/action.blade.php +++ b/resources/views/livewire/frontend/action.blade.php @@ -14,7 +14,7 @@
- +
+ +
+ + +
+
+

+ {{ $message['subject'] }} +

+
+
+ Download +{{-- Source--}} + Print + Delete +
+
+
+
+
+
+
+ + + +
+
+
+ {{ $message['sender_name'] }} + {{ $message['sender_email'] }} +
+ +
+
+
+
+ +
+
+
+ +
+ + @if (count($message['attachments']) > 0) +
+ @foreach ($message['attachments'] as $attachment) + + @endforeach +
+ @endif + +
+
+
+
+ @endforeach +
+ @else - {{ $initial ? __('Empty Inbox') : __('Fetching') . '...' }} + Inbox +
+ +
+
+
+
+ +
+ + + + + + {{ $initial ? __('Empty Inbox') : __('Fetching') }} +
+
+
+ @endif - + diff --git a/resources/views/livewire/home.blade.php b/resources/views/livewire/home.blade.php index 256a93b..ab3e1f9 100644 --- a/resources/views/livewire/home.blade.php +++ b/resources/views/livewire/home.blade.php @@ -1,5 +1,63 @@
-Inbox -
- +
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +

Secure Temporary Email

+

+ Your temporary email address is protected by a reliable password, generated randomly in your browser, providing a barrier against unauthorized access and potential breaches. +

+
+
+
+
+ + +
+
+ +
+
+ +

Instant Disposable Email

+

+ No more wasting precious time on registrations, form-filling, or solving captchas. Your temp email address is ready for use instantly, putting you in control effortlessly. +

+
+
+
+
+ + +
+
+ +
+
+ +

Fast and Anonymous Email Service

+

Experience fast message delivery without delays or restrictions. Our service is finely tuned for maximum delivery speed, ensuring you stay connected seamlessly.

+
+
+
+
+ +
+
diff --git a/routes/console.php b/routes/console.php index 3c9adf1..3e1c570 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,8 +1,21 @@ comment(Inspiring::quote()); })->purpose('Display an inspiring quote'); + +Schedule::call(function () { + Email::fetchProcessStoreEmail(); +})->everyMinute(); + +Schedule::call(function () { + Email::deleteBulkAttachments(); +})->daily(); + +Schedule::call(function () { + Email::deleteBulkMailboxes(); +})->everyMinute(); diff --git a/routes/web.php b/routes/web.php index 59d67fb..8627dad 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,14 +1,27 @@ name('home'); -Route::get('/mailbox', Email::class)->name('mailbox'); +Route::get('/mailbox', Mailbox::class)->name('mailbox'); + +Route::get('/switch/{email}', [AppController::class, 'switch'])->name('switch'); +Route::get('/delete/{email?}', [AppController::class, 'delete'])->name('delete'); + +Route::get('locale/{locale}', [AppController::class, 'locale'])->name('locale'); + +Route::get('/download-email', function () { + $data = 'Your content here'; // or pull from DB / session + $filename = 'data.txt'; + + return response($data) + ->header('Content-Type', 'text/plain') + ->header('Content-Disposition', "attachment; filename={$filename}"); +})->name('download.txt'); Route::get('/msg/{email?}/', function ($email) { $responses = [ @@ -19,3 +32,17 @@ Route::get('/msg/{email?}/', function ($email) { $notifications = array_merge($responses['to']['notifications'], $responses['cc']['notifications']); return $messages; })->name('test'); + +Route::get('/fetchStore', function () { + \App\Models\Email::fetchProcessStoreEmail(); + return 'Email fetched and saved!'; +}); + +Route::get('/get/{email?}', function ($email) { + return \App\Models\Email::parseEmail($email); +}); + +Route::get('/del', function () { + dd(\App\Models\Email::mailToDBStatus()); + return \App\Models\Email::mailToDBStatus(); +}); diff --git a/vite.config.js b/vite.config.js index bf9d553..3d12e48 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,7 +5,7 @@ import tailwindcss from '@tailwindcss/vite'; export default defineConfig({ plugins: [ laravel({ - input: ['resources/css/app.css', 'resources/css/boil.css', 'resources/js/app.js', 'resources/css/boil.js'], + input: ['resources/css/app.css', 'resources/css/boil.css', 'resources/js/app.js', 'resources/js/boil.js'], refresh: true, }), tailwindcss(),