magicdude4eva / port25-bouncehandler

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

Error : #3

Closed vibhaw1 closed 8 years ago

vibhaw1 commented 8 years ago

[01-Aug-2016 12:32:53 UTC] 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 [01-Aug-2016 12:32:53 UTC] PHP Fatal error: require_once(): Failed opening required 'PHPMailer/PHPMailerAutoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /opt/pmta/bouncehandler/providers/feedback-loop-processor.php on line 37 [01-Aug-2016 12:32:53 UTC] 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 [01-Aug-2016 12:32:53 UTC] PHP Fatal error: require_once(): Failed opening required 'PHPMailer/PHPMailerAutoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /opt/pmta/bouncehandler/providers/feedback-loop-processor.php on line 37

vibhaw1 commented 8 years ago

Hi,

I am getting above mentioned error which installing the bounce handler for mail wizz

plz help

thanks in advance

magicdude4eva commented 8 years ago

You need PHP-mailer. Install via yum install php-PHPMailer

vibhaw1 commented 8 years ago

Hi,

Could u this for me using team viewer i am stuck with this since last 2 days

On Mon, 1 Aug 2016 at 7:01 PM, Gerd Naschenweng notifications@github.com wrote:

You need PHP-mailer. Install via yum install php-PHPMailer

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicdude4eva/port25-bouncehandler/issues/3#issuecomment-236580901, or mute the thread https://github.com/notifications/unsubscribe-auth/ATz6exrjXcKecsKAqiAvzEqD7EOt4xb5ks5qbfVDgaJpZM4JZkti .

vibhaw1 commented 8 years ago

Php is already installed on the server every thing is working fine with pmta as well its just the give bounce processor is not working for us

Plz help

magicdude4eva commented 8 years ago

The error above is specific to PHPMailer not being installed. PHPMailer is required if you want to receive email notifications. Otherwise you can just delete the code requiring it as it is logged in files anyhow.

vibhaw1 commented 8 years ago

Hi request u to install this for me

Plz share ur paypal account will transfer the funds

I realy need it plz see to it

Thanks On Mon, 1 Aug 2016 at 7:21 PM, Gerd Naschenweng notifications@github.com wrote:

The error above is specific to PHPMailer not being installed. PHPMailer is required if you want to receive email notifications. Otherwise you can just delete the code requiring it as it is logged in files anyhow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magicdude4eva/port25-bouncehandler/issues/3#issuecomment-236586099, or mute the thread https://github.com/notifications/unsubscribe-auth/ATz6e_3vnuAB-18QDyjJ_P5wyDacfahbks5qbfntgaJpZM4JZkti .

vibhaw1 commented 8 years ago

Have replicated all settings which u have given :

  1. Have created a directory bouncehandler under /opt/pmta/ so that Port25 can execute it.

2.Adjusted settings in setup.php

A) LOG_CONSOLE_MODE: Seted to 1 B) LOG_FILE directory inside bouncehandler

MAILWIZZ CONFIGURATION DONE :

MAILWIZZ_API_PUBLIC_KEY: The public API key is integrated

MAILWIZZ_API_PRIVATE_KEY: The private API key is also integrated

MAILWIZZ_ENDPOINT_URL: The URL to the API is integrated

$origMailWizzZA: An array of sender email-addresses Of 250 ip added in given format.

There after have implemented following code in pmta

For the setup to work, the following is required:

Create a FBL domain fbl.example.com

Create a MX record for fbl.example.com which points to your Port25 server - i.e. fbl.example.com MX 1 mailserver.example.com

Configure the feedback-loop-processor in Port25 and list any addresses you accept for FBL reports:

deliver-unmatched-email no deliver-matched-email no # default: no forward-errors-to postmaster@example.com forward-unmatched-to postmaster@example.com ``` address /abuse@fbl.example.com/ ```

Configure for which domains / addresses you allow inbound mail: relay-domain fbl.bidorbuy.co.za Configure your accounting file to accept FBL records (note that we use --logfile to write to a different log-file: <acct-file |/usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --logfile=/var/log/pmta/fbl-processor.log>records feedback-loop map-header-to-field f header_X-HmXmrOriginalRecipient rcpt # hotmail recipient record-fields f *, header_subject, header_BatchId, header_Message-Id, header_List-Unsubscribe, header_List-Id, header_X-Mw-Subscriber-Uid, header_X-Mailer-LID, header_X-Mailer-RecptId

Then i am not sure about costimization to be done in feedback-loop-processor.php

If hv create abuse@domain.com and registered with isp's

Also there seems to be some issue with extention installations

I have uploaded the extension in mail wizz backend

And there after i am getting following error. Which i have shared it with u

Plz provide the solution for the same

vibhaw1 commented 8 years ago

Error : require_once('PHPMailer/PHPMailerAutoload.php');

Also plz suggest the directory in which we need to install the phpmailer

Plz suggest the same

Thanks

magicdude4eva commented 8 years ago

Let's sort out the bouncehandler first:

1) Place this file into as /tmp/unsub.txt onto your server - it is a sample FBL record:

unsub.txt

2) Run the bounce handler in command-line mode: cat /tmp/unsub.txt | php /opt/pmta/bouncehandler/bouncehandler.php --debug

You should get output like this:

[root@mailserver ~]# cat /tmp/unsub.txt | php /opt/pmta/bouncehandler/bouncehandler.php --debug
[01/Aug/2016:16:37:14] ------------------------------------------------------------------
[01/Aug/2016:16:37:14] Port25 PowerMTA bounce-handler
[01/Aug/2016:16:37:14] (C) 2016 Gerd Naschenweng  http://github.com/magicdude4eva
[01/Aug/2016:16:37:14] ------------------------------------------------------------------
[01/Aug/2016:16:37:14] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related
[01/Aug/2016:16:37:14] Bounce-provider: Interspire, initialising
[01/Aug/2016:16:37:14]    Endpoint-URL=http:/INTERSPIRE-SERVER/xml.php
[01/Aug/2016:16:37:14]    Interspire enabled with lists=112,3,32,95,81,108,109,115,116,117
[01/Aug/2016:16:37:14] Bounce-provider: Interspire, complete
[01/Aug/2016:16:37:14] Bounce-provider: MailWizz, initialising
[01/Aug/2016:16:37:14]    Endpoint-URL=https://MAILWIZZ-SERVER/api
[01/Aug/2016:16:37:14]    MailWizz enabled!
[01/Aug/2016:16:37:14] Bounce-provider: MailWizz, complete
[01/Aug/2016:16:37:14] Bounce-provider: Bidorbuy, initialising
[01/Aug/2016:16:37:14] Bounce-provider: Bidorbuy, complete
[01/Aug/2016:16:37:14] Feedback-provider: initialising
[01/Aug/2016:16:37:14] Feedback-provider: complete
[01/Aug/2016:16:37:14] Initialising RRD reporting via /var/log/pmta/pmta.rrd
[01/Aug/2016:16:37:14] Starting bounce processing
[01/Aug/2016:16:37:14] FBL received from: Yahoo!-Mail-Feedback/2.0 for=TEST@yahoo.com via TEST@yahoo.com
[01/Aug/2016:16:37:14]    MailWizz: unsubscribe for TEST@yahoo.com:
[01/Aug/2016:16:37:14]    - skipped: za#m#Deal of the Week
[01/Aug/2016:16:37:15]    Interspire: Skipping recipient TEST@yahoo.com - no subscribed lists returned
[01/Aug/2016:16:37:15] FBL record processed and email sent!
[01/Aug/2016:16:37:15] Completed bounce processing! Total records=3, processed=1, skipped=2

You will get some List-unsubscribe errors since those are made-up lists etc, but everything else should work.

For PHPMailer: Use standard "yum install" or whatever other package manger you use. On our CentOS installation it is as I described above yum install php-PHPMailer

The MailWizz extension is just an extension which adds the List-Unsubscribe header to your email. It does not do anything with Port25 and should not throw an error. I have tested the extension on MailWizz 1.3.6.5 (if you are running an earlier version, that might be your issue).

vibhaw1 commented 8 years ago

I am getting this error

`[root@srv ~]# cat /tmp/unsub.txt | php /opt/pmta/bouncehandler/bouncehandler.php --debug [01/Aug/2016:15:07:00] --------------------------------------------------------- --------- [01/Aug/2016:15:07:00] Port25 PowerMTA bounce-handler 01/Aug/2016:15:07:00 2016 Gerd Naschenweng http://github.com/magicdude4ev a [01/Aug/2016:15:07:00] --------------------------------------------------------- --------- [01/Aug/2016:15:07:00] Handling bounce categories=bad-mailbox,bad-domain,routing -errors,inactive-mailbox,spam-related [01/Aug/2016:15:07:00] Bounce-provider: Interspire, initialising [01/Aug/2016:15:07:00] Skipped - not configured! [01/Aug/2016:15:07:00] Bounce-provider: Interspire, complete [01/Aug/2016:15:07:00] Bounce-provider: MailWizz, initialising [01/Aug/2016:15:07:00] Endpoint-URL=http://buynbag.com/mail/api [01/Aug/2016:15:07:00] MailWizz enabled! [01/Aug/2016:15:07:00] Bounce-provider: MailWizz, complete [01/Aug/2016:15:07:00] Feedback-provider: initialising [01/Aug/2016:15:07:00] Feedback-provider: complete [01/Aug/2016:15:07:00] Initialising RRD reporting via /var/log/pmta/pmta.rrd

Warning: dl(): Unable to load dynamic library '/usr/local/lib/php/extensions/no- debug-non-zts-20131226/rrd.so' - /usr/local/lib/php/extensions/no-debug-non-zts- 20131226/rrd.so: cannot open shared object file: No such file or directory in /o pt/pmta/bouncehandler/setup.php on line 164 [01/Aug/2016:15:07:00] RRD not installed, please install php-pecl-rrd or php-r rdtool [01/Aug/2016:15:07:00] Starting bounce processing [01/Aug/2016:15:07:00] FBL received from: Yahoo!-Mail-Feedback/2.0 for=TEST@yaho o.com via TEST@yahoo.com

< HTTP/1.1 404 Not Found < Date: Mon, 01 Aug 2016 15:07:00 GMT

Warning: stream_socket_enable_crypto(): Peer certificate CN=srv.buynbag.com' di d not match expected CN=localhost' in /usr/local/lib/php/PHPMailer/class.smtp.p hp on line 355 [01/Aug/2016:15:07:00] FBL record processed! Email notification failed: SMTP con nect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting [01/Aug/2016:15:07:00] Completed bounce processing! Total records=3, processed=1 , skipped=2 `

magicdude4eva commented 8 years ago

That looks already good - a few more pointers:

1) RRD Some users use it to graph out stats. In most cases you will not need it and you can do the following:

If you do not need it, just remove the following line from setup.php:

// RRD Graphs - requires installation of php-rrdtool - if not defined, it will not be enabled
define("RRD_FILE",        "/var/log/pmta/pmta.rrd");

The installation of RRD varies depending on your distribution. In our case of CentOS 7, it was as simple as:

yum install rrdtool-devel php56w-devel php56w-pear

In some environments you will need to either additionally install php-pecl-rrd or php-rrdtool

Once done, you have to make the following change in your /etc/php.ini

; Used for Port25 RRD reporting
extension=rrd.so

2) The "404" in buynbag.com is expected as the unsub.txt contains dummy data. The point here was to ensure that connectivity works - this looks good.

3) The email issue in the end is possibly related to the setup of your outbound mail-server (I actually use our own Port25 to send mail to us). In your case this might differ.

I suggest that you experiment with the following changes in https://github.com/magicdude4eva/port25-bouncehandler/blob/master/providers/feedback-loop-processor.php#L87

$mail->SMTPAuth = false;
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;

Add the SMTPSecure=false first and see if this resolves the issue. If not, try and turn optimistic TLS off via SMTPAutoTLS.

There might also be an SSL issue and the PHPMailer has a section describing how to test it - https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#testing-ssl-outside-php (I hope that the SMTPSecure / SMTPAutoTLS settings will sort this out though).

If you do not need the email functionality, you can very well remove all code between Line-#79 to Line=#124. I personally would not do this, as it is very helpful to have those notices come into your inbox.

vibhaw1 commented 8 years ago

Now i am getting follwing error :

`[root@srv ~]# cat /tmp/unsub.txt | php /opt/pmta/bouncehandler/bouncehandler.php --debug [01/Aug/2016:15:41:06] ------------------------------------------------------------------ [01/Aug/2016:15:41:06] Port25 PowerMTA bounce-handler 01/Aug/2016:15:41:06 2016 Gerd Naschenweng http://github.com/magicdude4eva [01/Aug/2016:15:41:06] ------------------------------------------------------------------ [01/Aug/2016:15:41:06] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related [01/Aug/2016:15:41:06] Bounce-provider: Interspire, initialising [01/Aug/2016:15:41:06] Skipped - not configured! [01/Aug/2016:15:41:06] Bounce-provider: Interspire, complete [01/Aug/2016:15:41:06] Bounce-provider: MailWizz, initialising [01/Aug/2016:15:41:06] Endpoint-URL=http://buynbag.com/mail/api [01/Aug/2016:15:41:06] MailWizz enabled! [01/Aug/2016:15:41:06] Bounce-provider: MailWizz, complete [01/Aug/2016:15:41:06] Feedback-provider: initialising [01/Aug/2016:15:41:06] Feedback-provider: complete [01/Aug/2016:15:41:06] Starting bounce processing

Fatal error: Call to a member function logReportRecord() on null in /opt/pmta/bouncehandler/bouncehandler.php on line 204 `

vibhaw1 commented 8 years ago

And In Error Log File I Am Getting Following Error

[01-Aug-2016 21:35:32 Asia/Kolkata] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/rrd.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/rrd.so: cannot open shared object file: No such file or directory in Unknown on line 0 [01-Aug-2016 21:35:32 Asia/Kolkata] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/rrd.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/rrd.so: cannot open shared object file: No such file or directory in Unknown on line 0

vibhaw1 commented 8 years ago

also getting some error like :

image

magicdude4eva commented 8 years ago

I just pushed a small update to bouncehandler.php - can you replace your current version with this one: https://github.com/magicdude4eva/port25-bouncehandler/blob/master/bouncehandler.php

Did you disable RRD in setup.php? If not, you need to still make that change in php.ini.

The fgetcsv warning would only occur if there is no data being piped via STDIN - i.e. when you do the cat /tmp/bounce.txt | php ... the /tmp/bounce.txt could possibly be empty - perhaps do just a cat /tmp/bounce.txt to verify that the file exists / has the right permissions and has content.

BTW: I am not sure if it makes a big difference, but I am running and have tested all of this on PHP 5.6.24.

vibhaw1 commented 8 years ago

Hi,

Could u connect to my system as check what exactly is the issue.

it will be really helpful to me

vibhaw1 commented 8 years ago

Still Getting the same error were as there is data in bounce.txt file

type,timeQueued,bounceCat,vmta,orig,rcpt,srcMta,dlvSourceIp,jobId,dsnStatus,dsnMta,dsnDiag b,2016-08-01 14:06:01-0400,bad-mailbox,pmta-vmta47,mail@724mail50.buynbag.com,koul.vibhawxxxx1@gmail.com,buynbag.com (85.206.170.50),85.206.170.50,,5.1.1 (bad destination mailbox address),gmail-smtp-in.l.google.com (64.233.161.27),smtp;550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 s142si14934335lfe.256 - gsmtp b,2016-08-01 14:50:01-0400,bad-mailbox,pmta-vmta48,mail@724mail51.buynbag.com,koul.vibhawxxxx1@gmail.com,buynbag.com (85.206.170.51),85.206.170.51,,5.1.1 (bad destination mailbox address),gmail-smtp-in.l.google.com (209.85.233.27),smtp;550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 p64si14982858lfd.341 - gsmtp

Above is the data in the file bounce-2016-08-01-0000.csv which is in the directory "/var/log/pmta/" and when i am running following command

cat /var/log/pmta/bounce-2016-08-01-0000.csv | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug

i am getting following error running in endless loop

`
Warning: fgetcsv() expects parameter 1 to be resource, string given in /opt/pmta/bouncehandler/bouncehandler.php on line 111

Warning: fgetcsv() expects parameter 1 to be resource, string given in /opt/pmta/bouncehandler/bouncehandler.php on line 111

Warning: fgetcsv() expects parameter 1 to be resource, string given in /opt/pmta/bouncehandler/bouncehandler.php on line 111

Warning: fgetcsv() expects parameter 1 to be resource, string given in /opt/pmta/bouncehandler/bouncehandler.php on line 111

Warning: fgetcsv() expects parameter 1 to be resource, string given in /opt/pmta/bouncehandler/bouncehandler.php on line 111

please suggest something how this can be resolved `

vibhaw1 commented 8 years ago

Output :

[root@srv ~]# cat /tmp/unsub.txt | php /opt/pmta/bouncehandler/bouncehandler.php --debug
[01/Aug/2016:19:14:39] ------------------------------------------------------------------ [01/Aug/2016:19:14:39] Port25 PowerMTA bounce-handler 01/Aug/2016:19:14:39 2016 Gerd Naschenweng http://github.com/magicdude4eva [01/Aug/2016:19:14:39] ------------------------------------------------------------------ [01/Aug/2016:19:14:39] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related [01/Aug/2016:19:14:39] Bounce-provider: Interspire, initialising [01/Aug/2016:19:14:39] Endpoint-URL=http://interspire.domain.com/xml.php [01/Aug/2016:19:14:39] Failed connecting to http://interspire.domain.com/xml.php, error=404 [01/Aug/2016:19:14:39] Bounce-provider: MailWizz, initialising [01/Aug/2016:19:14:39] Endpoint-URL=http://buynbag.com/mail/api [01/Aug/2016:19:14:39] MailWizz enabled! [01/Aug/2016:19:14:39] Bounce-provider: MailWizz, complete [01/Aug/2016:19:14:39] Feedback-provider: initialising [01/Aug/2016:19:14:39] Feedback-provider: complete [01/Aug/2016:19:14:39] Starting bounce processing [01/Aug/2016:19:14:39] FBL received from: Yahoo!-Mail-Feedback/2.0 for=TEST@yahoo.com via TEST@yahoo.com

  • Hostname was found in DNS cache
  • Trying 85.206.170.4...
  • Connected to buynbag.com (85.206.170.4) port 80 (#0) GET /mail/api/lists/xxxxx/subscribers/xxxx HTTP/1.1 User-Agent: MailWizzApi Client version 1.0 Host: buynbag.com Accept: / X-MW-PUBLIC-KEY: 1fd395e376a16a58343c3d08084c1f654e38711a X-MW-TIMESTAMP: 1470078879 X-MW-SIGNATURE: 136344d9824f8d7b0696f6eb53c6dd9b6a248cc5

< HTTP/1.1 404 Not Found < Date: Mon, 01 Aug 2016 19:14:39 GMT

vibhaw1 commented 8 years ago

But Still Getting The Same Error For Bounce.csv

vibhaw1 commented 8 years ago

It seems that this issue was already raised by the other guy with same set of errors 12 days back

And he also did not got any solution for the similar kind of problem and at last he has to quit the idea of implementing the code

I am also feeling that its simply waste of time and effort as this code seems to be having some issue or needs some amendments or changes in the code

As you shud work out on its code part and upgrade to resolve these issue

Thanks

magicdude4eva commented 8 years ago

Problem solved - it was environmental and had two issues:

chown -R pmta:pmta /opt/pmta/bouncehandler

An auxiliary issue is RRD as there is a package conflict which throws warnings but do not affect the functioning of the bounce handler.

root@srv bouncehandler]# yum install php-rrdtool
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.bacloud.com
 * epel: mirror.bacloud.com
 * extras: mirror.bacloud.com
 * updates: mirror.bacloud.com
Resolving Dependencies
--> Running transaction check
---> Package rrdtool-php.x86_64 0:1.3.8-7.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: rrdtool-php-1.3.8-7.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: rrdtool-php-1.3.8-7.el6.x86_64
--> Processing Dependency: php >= 4.0 for package: rrdtool-php-1.3.8-7.el6.x86_64
--> Finished Dependency Resolution
Error: Package: rrdtool-php-1.3.8-7.el6.x86_64 (base)
           Requires: php(zend-abi) = 20090626
Error: Package: rrdtool-php-1.3.8-7.el6.x86_64 (base)
           Requires: php(api) = 20090626
Error: Package: rrdtool-php-1.3.8-7.el6.x86_64 (base)
           Requires: php >= 4.0
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest