Git Product home page Git Product logo

Comments (20)

webiix avatar webiix commented on May 28, 2024 1

so , you mean everyday i have to loggedin to server go to shell and try this command ? not a solution dear.

You don't understand me...
You put the command line cd /usr/local/share/dmarc-srg && php utils/fetch_reports.php on your cronjob. Usually this should import the reports from the email into the database.
But the fetch_reports.php doesn't work because of the error in 1st message.

from dmarc-srg.

nasirmgcc avatar nasirmgcc commented on May 28, 2024

Hi i configure it and it's working fine as connection but not fetching the emails what is the procedure to import the attachment?

from dmarc-srg.

webiix avatar webiix commented on May 28, 2024

cd /usr/local/share/dmarc-srg && php utils/fetch_reports.php

from dmarc-srg.

nasirmgcc avatar nasirmgcc commented on May 28, 2024

what to write in Cronjob? or what to call from Cronjob?

from dmarc-srg.

webiix avatar webiix commented on May 28, 2024

what to write in Cronjob? or what to call from Cronjob?

Actually, it's the line in my previous message. But it doesn't work.
You can test it by running on the command line...

from dmarc-srg.

nasirmgcc avatar nasirmgcc commented on May 28, 2024

so , you mean everyday i have to loggedin to server go to shell and try this command ? not a solution dear.

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

Hello. The mailbox availability check in the administration panel uses this function as well. If this check passes without problems, then it's something else. I tried to fix it in the last commit. Can you test it?

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

@nasirmgcc, If you want to get report automatically, you should add a cronjob for that. I gave you an example in #25. You can learn more about this functionality here: https://en.wikipedia.org/wiki/Cron

from dmarc-srg.

 avatar commented on May 28, 2024

Hello. The mailbox availability check in the administration panel uses this function as well. If this check passes without problems, then it's something else. I tried to fix it in the last commit. Can you test it?

The check passes. But I am still getting the error after your last commit.

from dmarc-srg.

nasirmgcc avatar nasirmgcc commented on May 28, 2024

for me it's working fine, but the " CRONJOB " is not working to fetch the reports, i followd #25 but i have no idea what's wrong

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

@xervers, I have no idea why it happens. Temporarily you can try to replace all imap_utf8_to_mutf7 function calls with imap_utf7_encode in classes/Mail/MailBox.php file. The both functions have one parameter.

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

@nasirmgcc I will write you there.

from dmarc-srg.

webiix avatar webiix commented on May 28, 2024

Hello.
Still not working:
/php utils/fetch_reports.php PHP Fatal error: Uncaught Error: Call to undefined function imap_utf7_encode() in /public_html/dmarc/classes/Mail/MailBox.php:230 Stack trace: #0 /public_html/dmarc/classes/Mail/MailBox.php(171): Liuch\DmarcSrg\Mail\MailBox->ensureConnection() #1 /public_html/dmarc/classes/Sources/MailboxSource.php(88): Liuch\DmarcSrg\Mail\MailBox->sort('SORTDATE', 'UNSEEN', false) #2 /public_html/dmarc/classes/Report/ReportFetcher.php(68): Liuch\DmarcSrg\Sources\MailboxSource->rewind() #3 /public_html/dmarc/utils/fetch_reports.php(117): Liuch\DmarcSrg\Report\ReportFetcher->fetch() #4 {main} thrown in /public_html/dmarc/classes/Mail/MailBox.php on line 230

It seems to me that something is preventing the access to general functions.

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

It seems to me that you have different versions of the php interpreter for cli and web. And the cli version doesn't have IMAP support. Is it possible?

from dmarc-srg.

 avatar commented on May 28, 2024

Hello.
I tried with all 7 php versions I have, and all have the same issue.

from dmarc-srg.

nasirmgcc avatar nasirmgcc commented on May 28, 2024

Call to undefined function imap_utf7_encode()

Where is the IMAP support for PHP?
try to use with PHP 7.3 and whose Hosting service provider you are using ?
I am using JUSTHOST and it fixed not immediately, after 24 hour's

You have to put phpinfo(); get the all the information and then share here, then hopefully @liuch can advise you proplery with the solution.

from dmarc-srg.

 avatar commented on May 28, 2024

Call to undefined function imap_utf7_encode()

Where is the IMAP support for PHP?

try to use with PHP 7.3 and whose Hosting service provider you are using ?
I am using JUSTHOST and it fixed not immediately, after 24 hour's
You have to put phpinfo(); get the all the information and then share here, then hopefully @liuch can advise you proplery with the solution.

Please stop hijacking the thread. I am my own provider. Don't you think it wasn't the 1st thing I checked? Also, the test connection on the control panel works well so IMAP support is not the issue.

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

It may be that you are using different versions of php for the web server and for the console. One version may have support for imap functions, and another may not. I have Debian/GNU linux on my desktop and it currently has two separate versions of php packages and each version has its own imap package: php7.3-imap and php7.4-imap. The second one is installed but the first on is not. So if command php is linked to php7.3 some functions may not work in the console even though they work on the web-version. That's why I am asking you to compare the versions. I have no more ideas, sorry.

p.s. I am going to add the display of the php version in the About dialog.

from dmarc-srg.

 avatar commented on May 28, 2024

Ok, today I recompiled the libcclient with the exports utf8_to_mutf7.
Checked that the PHP modules didn't changed.
Tried to re-run the cron and now I get the error:
SQLSTATE[HY000] [2002] No such file or directory
A brief google search showed that I need to change the "localhost" to "127.0.0.1" for my database connection.
After correction, I could get the reports to be parsed and inserted on the database correctly.

Looking back, libcclient needs to be compiled with utf8_to_mutf7 in order to export utf8_to_mutf7.
I found it strange that it wasn't compiled with it by default...

Anyway, I got it working. It wasn't a module missing on php-cli.

Why not use the default php imap functions (https://www.php.net/manual/en/book.imap.php) and write a whole set of functions to connect and manage imap? I don't see the point...

from dmarc-srg.

liuch avatar liuch commented on May 28, 2024

A brief google search showed that I need to change the "localhost" to "127.0.0.1" for my database connection.
After correction, I could get the reports to be parsed and inserted on the database correctly.

All my configs work fine with localhost. I guess it depends on the database and dns settings.

Why not use the default php imap functions (https://www.php.net/manual/en/book.imap.php) and write a whole set of functions to connect and manage imap? I don't see the point...

Please note that the functions mentioned here, are in this list. I always try to use only standard functions without external dependencies.

Anyway, I got it working. It wasn't a module missing on php-cli.

I'm glad the script worked. Thanks for the info.

from dmarc-srg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.