anonaddy / anonaddy

Anonymous email forwarding
https://addy.io
GNU Affero General Public License v3.0
3.44k stars 187 forks source link

Self Hosted Store Failed Deliveries not working as expected #619

Closed koolsb closed 8 months ago

koolsb commented 8 months ago

I have a self hosted instance of anonaddy. My user has store failed deliveries enabled and I have failed deliveries in the database but no files have been saved for download. Reviewing my user shows the flag set correctly and the eamil types are not those the controller shouldn't store. Reviewing my error logs only has the relay issue, nothing related to a storage failure.

User attributes


> $user = User::find('<redacted>')
[!] Aliasing 'User' to 'App\Models\User' for this Tinker session.
= App\Models\User {#6237
    id: "<redacted>",
    default_username_id: "<redacted>",
    from_name: null,
    email_subject: null,
    banner_location: "top",
    display_from_format: 0,
    login_redirect: 0,
    bandwidth: 8867178,
    reject_until: null,
    defer_until: null,
    defer_new_aliases_until: null,
    username_count: 0,
    default_recipient_id: "<redacted>",
    default_alias_domain: "<redacted>,
    default_alias_format: "random_words",
    use_reply_to: 0,
    store_failed_deliveries: 1,
    created_at: "2022-12-06 04:07:40",
    updated_at: "2024-03-22 14:01:20",
  }

> $user->failedDeliveries
= Illuminate\Database\Eloquent\Collection {#6277
    all: [
      App\Models\FailedDelivery {#6292
        id: "<redacted>",
        user_id: "<redacted>",
        recipient_id: "<redacted>",
        alias_id: "<redacted>",
        is_stored: 0,
        bounce_type: null,
        remote_mta: null,
        sender: "<redacted>",
        destination: null,
        email_type: "F",
        status: null,
        code: "Expected response code "250/251/252" but got code "454", with message "454 4.7.1 <<redacted>>: Relay access denied".",
        attempted_at: "2024-03-19 11:06:28",
        created_at: "2024-03-19 11:06:28",
        updated_at: "2024-03-19 11:06:28",
      },
      App\Models\FailedDelivery {#6291
        id: "<redacted>",
        user_id: "<redacted>",
        recipient_id: "<redacted>",
        alias_id: "<redacted>",
        is_stored: 0,
        bounce_type: null,
        remote_mta: null,
        sender: "<redacted>",
        destination: null,
        email_type: "F",
        status: null,
        code: "Expected response code "250/251/252" but got code "454", with message "454 4.7.1 <<redacted>>: Relay access denied".",
        attempted_at: "2024-03-20 23:27:26",
        created_at: "2024-03-20 23:27:26",
        updated_at: "2024-03-20 23:27:26",
      },

Laravel logs

[2024-03-20 23:27:25] production.ERROR: Expected response code "250/251/252" but got code "454", with message "454 4.7.1 <<redacted>>: Relay access denied". {"exception":"[object] (Symfony\\Component\\Mailer\\Exception\\TransportException(code: 454): Expected response code \"250/251/252\" but got code \"454\", with message \"454 4.7.1 <<redacted>>: Relay access denied\". at /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php:338)
[stacktrace]
#0 /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(201): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->assertResponseCode()
#1 /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php(117): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->executeCommand()
#2 /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(264): Symfony\\Component\\Mailer\\Transport\\Smtp\\EsmtpTransport->executeCommand()
#3 /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(220): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->doRcptToCommand()
#4 /var/www/anonaddy/vendor/symfony/mailer/Transport/AbstractTransport.php(69): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->doSend()
#5 /var/www/anonaddy/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(137): Symfony\\Component\\Mailer\\Transport\\AbstractTransport->send()
#6 /var/www/anonaddy/app/CustomMailDriver/CustomMailer.php(185): Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport->send()
#7 /var/www/anonaddy/app/CustomMailDriver/CustomMailer.php(136): App\\CustomMailDriver\\CustomMailer->sendSymfonyMessage()
#8 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(205): App\\CustomMailDriver\\CustomMailer->send()
#9 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\\Mail\\Mailable->Illuminate\\Mail\\{closure}()
#10 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(198): Illuminate\\Mail\\Mailable->withLocale()
#11 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php(83): Illuminate\\Mail\\Mailable->send()
#12 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Mail\\SendQueuedMailable->handle()
#13 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#14 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#15 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#16 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#17 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#18 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#19 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#21 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Bus\\Dispatcher->dispatchNow()
#22 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#23 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#25 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#26 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\\Queue\\CallQueuedHandler->call()
#27 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\\Queue\\Jobs\\Job->fire()
#28 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\\Queue\\Worker->process()
#29 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\\Queue\\Worker->runJob()
#30 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(137): Illuminate\\Queue\\Worker->daemon()
#31 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(120): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#32 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#33 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#34 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#35 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#36 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#37 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call()
#38 /var/www/anonaddy/vendor/symfony/console/Command/Command.php(326): Illuminate\\Console\\Command->execute()
#39 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run()
#40 /var/www/anonaddy/vendor/symfony/console/Application.php(1096): Illuminate\\Console\\Command->run()
#41 /var/www/anonaddy/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()
#42 /var/www/anonaddy/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
#43 /var/www/anonaddy/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\\Component\\Console\\Application->run()
#44 /var/www/anonaddy/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#45 {main}
"} 
willbrowningme commented 8 months ago

That delivery failed locally which is why it wasn't saved.

I've just pushed a new release that will now save any local failed deliveries like that one.

koolsb commented 8 months ago

Thanks for the quick reply/fix!

Tazzios commented 7 months ago

With the hosted version on app.addy.io i have some Failed Deliveries incoming mails, they are 'classified as SPAM'. When i click on 'download' i only get the header info in an .eml file instead of the actual mail.

Should this also been resolved with issue?