magicdude4eva / port25-bouncehandler

Port25 PowerMTA bounce handler for Interspire and MailWizz
MIT License
73 stars 42 forks source link

PHP Warning: require_once #24

Closed davidusany closed 6 years ago

davidusany commented 6 years ago

@magicdude4eva I tried running the script but it says:

PHP Warning: require_once(/opt/pmta/bouncehandler/providers/MailWizzApi/Autoloader.php): failed to open stream: No such file or directory in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php on line 48 PHP Fatal error: require_once(): Failed opening required '/opt/pmta/bouncehandler/providers/MailWizzApi/Autoloader.php' (include_path='.:/usr/local/lib/php') in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php on line 48

What to do? Thanks

davidusany commented 6 years ago

@magicdude4eva looking for your help! Thanks

rritz66 commented 6 years ago

Hi @davidusany ... I had the same issue once.

bouncehandler is looking for this file here: /opt/pmta/bouncehandler/providers/MailWizzApi/Autoloader.php) You get this by uploading the MailWizzApi folder found here: https://github.com/twisted1919/mailwizz-php-sdk to your providers folder to this path: /opt/pmta/bouncehandler/providers/

I forgot to do this also at first, got the same error as you get. Even after uploading, the error persisted. So I removed the complete bouncehandler folder and started from scratch. This time, MailWizzApi folder was in place before I actually tested the bouncenahdler, and now it was working.

So maybe try this too

davidusany commented 6 years ago

Hi @rritz66,

Thanks for your help 👍

Now I'm getting the following error:

PHP Warning: require_once(PHPMailer/PHPMailerAutoload.php): failed to open stream: No such file or directory in /opt/pmta/bouncehandler/providers/feedback-loop-processor.php on line 37 PHP Fatal error: require_once(): Failed opening required 'PHPMailer/PHPMailerAutoload.php' (include_path='.:/usr/local/lib/php') in /opt/pmta/bouncehandler/providers/feedback-loop-processor.php on line 37

Any tricks, will be helpful!

davidusany commented 6 years ago

@rritz66 I solved that!

Removed require_once('PHPMailer/PHPMailerAutoload.php'); from feedback-loop-processor.php

How to solve PHPMailer issue? Because its already installed by running yum install php-PHPMailer

Thanks

davidusany commented 6 years ago

It says "Completed bounce processing! Total records=11, processed=0, skipped=1"

Not getting processed...

davidusany commented 6 years ago

LOL Resolved! Its actually funny as soon as I write here problems gets solved... 😀

@magicdude4eva @rritz66 How can I use this script as following:

  1. Multiple MailWizz on 1 PMTA
  2. Is there any way I can Blacklist subscribers rather than unsubscribing them?
  3. Decide on which response code the email will be marked as Soft/Hard or No Bounce.
  4. How to allow all Emails to be FROM? Without specifying in setup.php

Looking for reply! Thanks

magicdude4eva commented 6 years ago

Sorry for late response/lack of attention to this project. My focus is consumed with other projects at the moment. In most cases the scripts are running out of the box, but there are environmental differences (running different versions of Linux, PHP or even an older version of PMTA).

Regarding @davidusany questions: 1) Easiest would probably be to run as many instances (in separate folders) of the Port25-bouncehandler script. A better option would be perhaps to adjust the bouncehandler.php script to allow MailWizz API arguments passed in to initialise different instances.

2) You could implement this in bounce-provider-mailwizz.php. We are still running MailWizz 1.4.x and I know that there are changes in 1.5.x (we intend to upgrade in the next 2-3 months). I might revisit some of the aspects then as well.

3) I am using the PMTA bounce-category. If it is listed in https://github.com/magicdude4eva/port25-bouncehandler/blob/master/setup.php#L48 then it is treated as a soft-bounce. If it is not listed it is a hard-bounce. I would not overcomplicate it at introduce a "No Bounce" and would rather treat those as soft-bounces with the idea to eventually full reject the recipient.

4) You could simple comment out the condition https://github.com/magicdude4eva/port25-bouncehandler/blob/2cc2fe7e9dc1197a5d590c2728e3300610313711/bouncehandler.php#L239 to check for the from-address.

davidusany commented 6 years ago

@magicdude4eva Thanks so much for all information & script you've developed! All the best for your other projects 😊

  1. I'm using 1.5.x and its working amazingly!
  2. I can make new directories for Port25-bouncehandler script, but got confused that how I'll pipe that in PMTA config. Because right now we've bounce for one Port25-bouncehandler script.
  3. Is there any way to create API for complete MailWizz all customer accounts?

I would suggest to sell this script at same basic amount, its very helpful and was going through code its so well commented though I'm not a programmer, only a server admin.

Thanks for your suggestions!

magicdude4eva commented 6 years ago

Thanks for the kind words @davidusany. I never wanted to make the scripts commercial as people using Port25 already pay quite a heavy license fee. I was hoping that I would get some contributions (as a Java guy, my PHP "skills" are truly dangerous) - but so far nothing.

Most people seem to really struggle with the Linux setup and the PHP dependencies - it's really tough to support this, as everyone's environment is different.

Regarding your questions: 1) I hope 1.5.x works out great. Whenever I upgraded to latest MW version I was the first to stumble into issues or was at least able to make suggestions (such as the List-Unsubscribe). Hopefully this upgrade (will be a new install on PHP 7.x) will be troublefree. I do know that the API has received some improvements.

2) The piping in PMTA will be tricky. Port25 has something called a queue-filter under the acct-file but I think that will cause issues if you mess up the filter (my understanding is that the queue-filter will discard any accounting messages not filtered, so this will probably affect other logging.

I am unsure about your setup, but I would guess that you have VMTAs pinned to a MailWizz or you know from the from-address which MailWizz instance to talk to. In this case you would then need to do the following:

If the above is too complex, a "hacky" version would be to pipe the accounting-record to your own script which would then invoke the bounce-handler instance you need.

3) You mean "Is it possible to have MailWizz API manage all customer accounts?" - if so, I don't think this is possible (at least not under 1.4.x where the API is configured on customer account level).

davidusany commented 6 years ago

@magicdude4eva I'm surprised nobody contributed to such an amazing project & even making money. Please tell me your PayPal Email ID to transfer 😊

Can you please add a way in files so that I can just add 2 more MailWizz instances API? I'm very confused because I'm not a programmer 😀

davidusany commented 6 years ago

@magicdude4eva looking for your reply 😊

magicdude4eva commented 6 years ago

@davidusany I don't see that I will have time to focus on this over the next 4-6 weeks at least. We are currently upgrading all our servers to CentOS7 and afterwards migrating MailWizz to 1.5.x. I do think any competent PHP dev/freelancer can fork this project and make the changes for you. it is really not that difficult.

davidusany commented 6 years ago

You're an expert with this because you're the creator and most of the PHP developers are not aware of PMTA workflow, etc. I know you're very busy and I'm being difficult for you 😀 but it will be a great help if you can put some time and create some sort of way that in your script any person can mention as many as API keys they want something like a block of code that check all API mentioned in setup.php. For you, as per your skills it won't take much time!

I'm also needing your PayPal ID. Looking for your help 😊

davidusany commented 6 years ago

@magicdude4eva I've made it work with multiple APIs by using separate script solder as per your suggestion!

I have noticed that in MailWizz status of bounces are Undefined. I think Bounce Handler is passing the dsnStatus and though it should be passing the dsnDiag.

Looking for your help 😊

davidusany commented 6 years ago

@magicdude4eva as you get time, please look into this. Thanks 😊

magicdude4eva commented 6 years ago

Hi there,

I just upgraded to 1.5.7 over the weekend and am circling back on questions issues. I think I have answered everything else, except your initial 2nd question:

  1. Is there any way I can Blacklist subscribers rather than unsubscribing them?

My initial response was:

You could implement this in bounce-provider-mailwizz.php. We are still running MailWizz 1.4.x and I know that there are changes in 1.5.x (we intend to upgrade in the next 2-3 months). I might revisit some of the aspects then as well.

Unfortunately no endpoint exists in the MailWizz API to unsubscribe a user with a "blacklist" status. Perhaps reach out to twisted and I could then revisit.