antedebaas / Viesti-Reports

DMARC & SMTP-TLS Reports processor and visualizer and BIMI file hoster
https://docs.viestireports.com/
GNU Affero General Public License v3.0
83 stars 16 forks source link

On Error, successfull reports are not stored #40

Closed basti1508 closed 8 months ago

basti1508 commented 9 months ago

If you run app::checkmailbox and within the unread mails is one report, that does cause an error, all other reports from that unread mails are getting tagged read, but not processed to the DB. The process should handle those errors better.

Here's a trace from when it fails:

$ php bin/console app:checkmailbox -vv
[critical] Error thrown while running command "app:checkmailbox -vv". Message: "Call to a member function __toString() on null"
[critical] Uncaught Error: Call to a member function __toString() on null

In CheckmailboxCommand.php line 117:

  [Error]                                         
  Call to a member function __toString() on null  

Exception trace:
  at /var/www/dmarc-smtptls-reports/src/Command/CheckmailboxCommand.php:117
 App\Command\CheckmailboxCommand->execute() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Command/Command.php:279
 Symfony\Component\Console\Command\Command->run() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:1049
 Symfony\Component\Console\Application->doRunCommand() at /var/www/dmarc-smtptls-reports/vendor/symfony/framework-bundle/Console/Application.php:125
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:318
 Symfony\Component\Console\Application->doRun() at /var/www/dmarc-smtptls-reports/vendor/symfony/framework-bundle/Console/Application.php:79
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:169
 Symfony\Component\Console\Application->run() at /var/www/dmarc-smtptls-reports/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /var/www/dmarc-smtptls-reports/vendor/autoload_runtime.php:29
 require_once() at /var/www/dmarc-smtptls-reports/bin/console:11

app:checkmailbox [--option1] [--] [<arg1>]
antedebaas commented 9 months ago

Yes it should. And it’s on my list :) I’ll move up the priority

antedebaas commented 8 months ago

@basti1508 could you provide an (anonymized) example of the report causing the issue so i can have a detailed look?

antedebaas commented 8 months ago

fixed in 1.8.0 see releasenotes https://github.com/antedebaas/DMARC-SMTPTLS-Reports/releases/tag/v1.8.0

basti1508 commented 8 months ago

sadly. This issue is still there.

I'm not sure, why the try block does not catch the error...

In GetReportsFromMailboxCommand.php line 293:

  [Error]                                         
  Call to a member function __toString() on null  

Exception trace:
  at /var/www/dmarc-smtptls-reports/src/Command/GetReportsFromMailboxCommand.php:293
 App\Command\GetReportsFromMailboxCommand->process_dmarc_report() at /var/www/dmarc-smtptls-reports/src/Command/GetReportsFromMailboxCommand.php:161
 App\Command\GetReportsFromMailboxCommand->process_email() at /var/www/dmarc-smtptls-reports/src/Command/GetReportsFromMailboxCommand.php:99
 App\Command\GetReportsFromMailboxCommand->open_mailbox() at /var/www/dmarc-smtptls-reports/src/Command/GetReportsFromMailboxCommand.php:60
 App\Command\GetReportsFromMailboxCommand->execute() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Command/Command.php:279
 Symfony\Component\Console\Command\Command->run() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:1049
 Symfony\Component\Console\Application->doRunCommand() at /var/www/dmarc-smtptls-reports/vendor/symfony/framework-bundle/Console/Application.php:125
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:318
 Symfony\Component\Console\Application->doRun() at /var/www/dmarc-smtptls-reports/vendor/symfony/framework-bundle/Console/Application.php:79
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/dmarc-smtptls-reports/vendor/symfony/console/Application.php:169
 Symfony\Component\Console\Application->run() at /var/www/dmarc-smtptls-reports/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /var/www/dmarc-smtptls-reports/vendor/autoload_runtime.php:29
 require_once() at /var/www/dmarc-smtptls-reports/bin/console:11

app:getreportsfrommailbox
antedebaas commented 8 months ago

Actually the mail causing the problem should now be flagged in your inbox. Processing would still continue now Could you find the mail causing the error and post the (anonymized) report here?

basti1508 commented 8 months ago

But the processing does not Continue. I've tested with 1.8.1 today and the issue persists. I can see the try catch Block in the Code, but the Exception is thrown nevertheless.

basti1508 commented 8 months ago

here is the file! dsea.unipi.it!domain.com!1708543501!1708543501.zip

antedebaas commented 8 months ago

Thanks I’ll look into it

antedebaas commented 8 months ago

here is the file! dsea.unipi.it!domain.com!1708543501!1708543501.zip

could you re-upload it? the link seems to be dead

nvm. now the link works again

antedebaas commented 8 months ago

fixed in 1.9.0