magicdude4eva / port25-bouncehandler

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

Port25 PowerMTA MailWizz bounce handler #12

Closed masharif46 closed 6 years ago

masharif46 commented 6 years ago

i am install and test PowerMTA with bounce handler it's successfully communicate. I am send Campaign with Invalid Email & invalid Email Automatically Unsubscribed from MailWizz subscriber List . My Problem Bounce not showing in MailWizz DASHBORAD``Check both Screenshot bounce and fbl unsubscribed

magicdude4eva commented 6 years ago

The Port25 bouncehandler does an unsubscribe of the email from all lists and the MailWizz API does unfortunately not provide as bounce code or mark an unsubscribe as bounced. This will unfortunately only be reflected in the Unsubscribe rate.

I will reach out to Twisted again and see if there is a way to mark an unsubscribe as "bounced".

Asked @twisted1919 here: https://github.com/twisted1919/mailwizz-php-sdk/issues/13

masharif46 commented 6 years ago

Bro, Thanks for Reply . Bro Please let me know , if you have any solution,

Thanks

magicdude4eva commented 6 years ago

@masharif46: A pre-release is available here. Please read notes carefully and ensure that you make the correct changes - https://github.com/magicdude4eva/port25-bouncehandler/releases/tag/1.2

masharif46 commented 6 years ago

Thanks ! I will Try. @magicdude4eva

masharif46 commented 6 years ago

Hello Bro @magicdude4eva i am complete all Process But Nothing Changed . Bounce not showing in MailWizz DASHBORAD

bounce and fbl

magicdude4eva commented 6 years ago

Check your log files. It is working if you followed instructions. I have it running like this for the last 10 hours without a problem.

masharif46 commented 6 years ago

OK , Thanks @magicdude4eva ,

masharif46 commented 6 years ago

Hello bro , @magicdude4eva There is no error . unsubhandler.log pmta-bounce-handler.log fbl-processor.log

magicdude4eva commented 6 years ago

@masharif46: I don't do Skype support. I also don't believe that there is no error unless the setup was not done properly (i.e. Port25 config for acct-file / feedback-loop-processor.

I suggest that you attach all log-files to this issue (just redact any private/sensitive info) and then I can have a look at. AFAIK there are now 3 installations (excluding mine) using this release without issue.

masharif46 commented 6 years ago

Thanks bro , @magicdude4eva

magicdude4eva commented 6 years ago

This looks fine. Check /var/log/pmta/pmta.log for errors. Provide me with a private Gist of your log files:

/var/log/pmta/pmta-bounce-handler.log
/var/log/pmta/fbl-processor.log
/var/log/pmta/unsubhandler.log

Also do a tail -f /var/log/pmta/pmta.log and then a pmta reload and private Gist the output of the tail.

masharif46 commented 6 years ago

Hello Bro, @magicdude4eva This is is correct ? i am confused , I think PMTA config Problem , Please check my PMTA config file. Bounce server : return@example2.com relay-domain fbl.bidorbuy.co.za

magicdude4eva commented 6 years ago

There are errors - in pmta.log:

2017-08-24 12:09:20 Error waiting for "/usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --logfile=/var/log/pmta/fbl-processor.log": to exit: Timed out

Run this and post output echo "test@test.com" | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug

masharif46 commented 6 years ago

@magicdude4eva

[root@server ~]# echo "test@test.com" | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug PHP Notice: Constant MAILWIZZ_API_PUBLIC_KEY already defined in /opt/pmta/bouncehandler/setup.php on line 61 PHP Notice: Constant MAILWIZZ_API_PRIVATE_KEY already defined in /opt/pmta/bouncehandler/setup.php on line 62 PHP Notice: Constant MAILWIZZ_ENDPOINT_URL already defined in /opt/pmta/bouncehandler/setup.php on line 63 [24/Aug/2017 06:51:23] ------------------------------------------------------------------ [24/Aug/2017 06:51:23] Port25 PowerMTA bounce-handler [24/Aug/2017 06:51:23] (C) 2016 Gerd Naschenweng http://github.com/magicdude4eva [24/Aug/2017 06:51:23] ------------------------------------------------------------------ [24/Aug/2017 06:51:23] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related [24/Aug/2017 06:51:23] Bounce-provider: Interspire, initialising [24/Aug/2017 06:51:23] Skipped - not configured! [24/Aug/2017 06:51:23] Bounce-provider: MailWizz, initialising [24/Aug/2017 06:51:23] Endpoint-URL=https://xxxxxxxxxxx/api/index.php [24/Aug/2017 06:51:23] MailWizz enabled! [24/Aug/2017 06:51:23] Bounce-provider: MailWizz, complete [24/Aug/2017 06:51:23] Feedback-provider: initialising [24/Aug/2017 06:51:23] Feedback-provider: complete [24/Aug/2017 06:51:23] Initialising RRD reporting via /var/log/pmta/pmta.rrd [24/Aug/2017 06:51:23] Starting bounce processing [24/Aug/2017 06:51:23] MailWizz: Skipping test@test.com, already unsubscribed! [24/Aug/2017 06:51:23] Completed bounce processing! Total records=1, processed=1, skipped=0

magicdude4eva commented 6 years ago

Two things: 1) From the output it does not look like you have the 1.2 code - the banner should say (C) 2016-2017.... - please have a look at the ZIP file and verify that code is from August 2017: image

2) There seems to be duplicate constant definitions in your /opt/pmta/bouncehandler/setup.php - clean it up.

masharif46 commented 6 years ago

Hey bro , @magicdude4eva

for Testing I am Delete all log file from /var/log/pmta/ Then run -- service pmta stop
pmtad --debug service pmta start auto generate only this log file .

/var/log/pmta/fbl-processor.log /var/log/pmta/log /var/log/pmta/pmta-bounce-handler.log /var/log/pmta/pmta-startuperr.log /var/log/pmta/pmta.rrd /var/log/pmta/pmtahttp.log

This file not create & previous this file create manually /var/log/pmta/unsubhandler.log

then run this file.

[root@server ~]# echo "test@test.com" | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug [24/Aug/2017 08:07:51] ------------------------------------------------------------------ [24/Aug/2017 08:07:51] Port25 PowerMTA bounce-handler [24/Aug/2017 08:07:51] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [24/Aug/2017 08:07:51] ------------------------------------------------------------------ [24/Aug/2017 08:07:51] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [24/Aug/2017 08:07:51] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [24/Aug/2017 08:07:51] Bounce-provider: Interspire, initialising [24/Aug/2017 08:07:51] Skipped - not configured! [24/Aug/2017 08:07:51] Bounce-provider: MailWizz, initialising [24/Aug/2017 08:07:51] Endpoint-URL=https://xxxxxxxxxxxxx/api/index.php [24/Aug/2017 08:07:51] MailWizz enabled! [24/Aug/2017 08:07:51] Bounce-provider: MailWizz, complete [24/Aug/2017 08:07:51] Feedback-provider: initialising [24/Aug/2017 08:07:51] Feedback-provider: complete [24/Aug/2017 08:07:51] Initialising RRD reporting via /var/log/pmta/pmta.rrd [24/Aug/2017 08:07:51] Starting bounce processing [24/Aug/2017 08:07:51] MailWizz: Skipping test@test.com, already unsubscribed! [24/Aug/2017 08:07:51] Completed bounce processing! Total records=1, processed=1, skipped=0

also getting sam e error in /var/log/pmta/log

2017-08-24 14:02:38 SMTP Listener at 0.0.0.0:587 starting 2017-08-24 14:02:38 Error waiting for "/usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php": to exit: Timed out 2017-08-24 14:02:38 Error waiting for "/usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --logfile=/var/log/pmta/fbl-processor.log": to exit: Timed out

magicdude4eva commented 6 years ago

It could be a Port25 version issue (I know that it works on PowerMTA v4.5rXX. PHP should be on 5.6.x.

The "Timed out" hints that the PHP script does not complete. I have unfortunately not seen this before and suggest to review your PMTA configs, versions and PHP installation.

To rule out that the time out is related to the bounce-scripts, just create a dummy "test.php" which outputs something to systemout and then change your Port25 config to see if this also fails (then you know it is a setup issue elsewhere).

masharif46 commented 6 years ago

hi bro, @magicdude4eva

[root@server ~]# php -v PHP 5.6.31 (cli) (built: Jul 6 2017 08:16:47) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

can you tell me about php configuration ?

magicdude4eva commented 6 years ago

I think you need to upgrade to PMTA 4.5rXX. I will not be able to support 4.0.

masharif46 commented 6 years ago

OK Bro , I will upgrade @magicdude4eva

magicdude4eva commented 6 years ago

I am closing this, as the bounce-processing feature has been added and verified working by 3 different MailWizz/Port25 users (all on latest version of MailWizz and Port25 R4.5r8-10).

I am unfortunately not able to help with Port25 configurations / upgrades etc as those are typically very specific. I urge to read through the documentation as well as the setup.php comments.

Mail is difficult and these scripts do require some basic technical skill / Linux knowledge.

masharif46 commented 6 years ago

Hello Bro ! @magicdude4eva Port25 PowerMTA MailWizz bounce handler working on PowerMTA 4.5r8 ? or work only PowerMTA 4.5r10 > Please let me know. Thank You !

magicdude4eva commented 6 years ago

I had it working on all versions from 4.5 onwards. Not sure why you can't go with r10 as it is the latest (I hope the software is properly licensed)

masharif46 commented 6 years ago

Wow ! I am so happy now . I am Upgraded PowerMTA 4.5r10 And Now Working Port25 PowerMTA MailWizz bounce handler, Many Many Thanks Both big bro @magicdude4eva @twisted1919 ,

pmta

jacinto-joao commented 6 years ago

Hi @magicdude4eva ,

I just find your script, now and is kind of what I'm looking for. So before I go through the setups, just wanted some clarifications about how does it work, and if it can work according to my needs.

The questions I got is, is this script check for bounces on uploading email list, or before sending the campaign to the user?

Can this script check for bounces, with Amazon SES, before it reaches the Amazon servers?

The reason why I'm asking the above questions is just that of Amazon suspend accounts after reaching 5% bounces rates, and I wanted to find a way to avoid suspension with Amazon SES.

Regards, and hope to get any response as soon you can, because I'm right now suspended my account, and looking to get back as soon I can.

twisted1919 commented 6 years ago

@jjoao07 - i can answer for this, it will process the bounces after the campaign has been sent. What you are after is a list cleaning service, to clean your email list before sending it to amazon.

jacinto-joao commented 6 years ago

Hi bro @twisted1919 , thanks for clarifying, I was checking on backend => store, and i find out that, there some extensions, which looks like does the job. this one MailWizz EMA integration with TheChecker.co and MailWizz EMA integration with EmailListVerify.com

So my worries about those extensions, for now, is not knowing if it is possible to integrate the extension, to check any list from default while uploading, and to be available for all customers, without them having to signup account with the third party.

I just wanted something straightforward,

So not sure if is it possible or not!

shabsshab commented 5 years ago

Iam unable to get bounce in mailwizz when I send email to ss1232d@gmail.com which does not exist Find the server details in below and please help

[root@server bouncehandler]# php -v PHP 5.6.38 (cli) (built: Sep 12 2018 09:02:11) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

[root@server bouncehandler]# echo "ss1232d@gmail.com" | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug [20/Oct/2018 13:46:09] ------------------------------------------------------------------ [20/Oct/2018 13:46:09] Port25 PowerMTA bounce-handler [20/Oct/2018 13:46:09] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [20/Oct/2018 13:46:09] ------------------------------------------------------------------ [20/Oct/2018 13:46:09] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [20/Oct/2018 13:46:09] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [20/Oct/2018 13:46:09] Bounce-provider: MailWizz, initialising [20/Oct/2018 13:46:09] Endpoint-URL=http://sendboxpro.win/mw/api/ [20/Oct/2018 13:46:09] MailWizz enabled! [20/Oct/2018 13:46:09] Bounce-provider: MailWizz, complete [20/Oct/2018 13:46:09] Starting bounce processing [20/Oct/2018 13:46:09] MailWizz: Failed looking up record ss1232d@gmail.com with status=error [20/Oct/2018 13:46:09] Completed bounce processing! Total records=1, processed=1, skipped=0 [root@server bouncehandler]#

[root@server bouncehandler]# cat /var/log/pmta/acct-2018-10-20-0000.csv type,timeLogged,timeQueued,orig,rcpt,orcpt,dsnAction,dsnStatus,dsnDiag,dsnMta,bounceCat,srcType,srcMta,dlvType,dlvSourceIp,dlvDestinationIp,dlvEsmtpAvailable,dlvSize,vmta,jobId,envId,queue,vmtaPool b,2018-10-20 04:14:05-0500,2018-10-20 04:14:05-0500,return@server.box01.pw,ss1232d@gmail.com,,failed,5.1.1 (bad destination mailbox address),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/?p=NoSuchUser p79-v6si26073660pfj.244 - gsmtp,gmail-smtp-in.l.google.com (74.125.142.27),bad-mailbox,smtp,sendboxpro.win (107.175.127.143),smtp,198.46.144.28,74.125.142.27,"ENHANCEDSTATUSCODES,PIPELINING,CHUNKING,8BITMIME,SIZE,STARTTLS",,pmta-vmta0,,,gmail.com/pmta-vmta0,pmta-pool

[root@server bouncehandler]# cat /var/log/pmta/acct-2018-10-20-0000.csv | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug [20/Oct/2018 13:51:02] ------------------------------------------------------------------ [20/Oct/2018 13:51:02] Port25 PowerMTA bounce-handler [20/Oct/2018 13:51:02] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [20/Oct/2018 13:51:02] ------------------------------------------------------------------ [20/Oct/2018 13:51:02] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [20/Oct/2018 13:51:02] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [20/Oct/2018 13:51:02] Bounce-provider: MailWizz, initialising [20/Oct/2018 13:51:02] Endpoint-URL=http://sendboxpro.win/mw/api/ [20/Oct/2018 13:51:02] MailWizz enabled! [20/Oct/2018 13:51:02] Bounce-provider: MailWizz, complete [20/Oct/2018 13:51:02] Starting bounce processing [20/Oct/2018 13:51:02] Completed bounce processing! Total records=5, processed=0, skipped=5 [root@server bouncehandler]#

shabsshab commented 5 years ago

once I process manually i can see that its processed in output but its not reflecting in mailwizz ( more than 4 hrs waited) Still the bounce is zero and email id is in confirmed status only (not blacklisted/bounced)

Please advice

[root@server pmta]# cat bounce-2018-10-20-0000.csv | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug [21/Oct/2018 05:15:21] ------------------------------------------------------------------ [21/Oct/2018 05:15:21] Port25 PowerMTA bounce-handler [21/Oct/2018 05:15:21] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [21/Oct/2018 05:15:21] ------------------------------------------------------------------ [21/Oct/2018 05:15:21] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [21/Oct/2018 05:15:21] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [21/Oct/2018 05:15:21] Bounce-provider: MailWizz, initialising [21/Oct/2018 05:15:21] Endpoint-URL=http://sendboxpro.win/mw/api/index.php [21/Oct/2018 05:15:21] MailWizz enabled! [21/Oct/2018 05:15:21] Bounce-provider: MailWizz, complete [21/Oct/2018 05:15:21] Starting bounce processing [21/Oct/2018 05:15:21] Bounce: bad-mailbox from=return@server.box01.pw via pmta-vmta0/ss1232d@gmail.com jobId=, dsnStatus=5.1.1 (bad destination mailbox address) [21/Oct/2018 05:15:21] MailWizz: unsubscribe for ss1232d@gmail.com: [21/Oct/2018 05:15:21] - skipped: Test list [21/Oct/2018 05:15:21] Completed bounce processing! Total records=2, processed=1, skipped=1

eyalschiffer commented 5 years ago

I have the same problem. All configured and seems fine but no change is shown in MailWizz.

I see no bounces nor unsubscribes.

informdev commented 5 years ago

^^ Same problem as above. Everything seems right and manually processing them seems to work but no changes reflected in MailWizz.

Mohit1946 commented 3 years ago

I am also facing same kind of issue,

Please see

[root@mail pmta]# echo "test@test.com" | /usr/bin/php /opt/pmta/bouncehandler/bouncehandler.php --debug [25/Sep/2020 12:18:26] ------------------------------------------------------------------ [25/Sep/2020 12:18:26] Port25 PowerMTA bounce-handler [25/Sep/2020 12:18:26] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [25/Sep/2020 12:18:26] ------------------------------------------------------------------ [25/Sep/2020 12:18:26] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [25/Sep/2020 12:18:26] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [25/Sep/2020 12:18:26] Bounce-provider: Interspire, initialising [25/Sep/2020 12:18:26] Skipped - not configured! [25/Sep/2020 12:18:26] Bounce-provider: MailWizz, initialising [25/Sep/2020 12:18:26] Endpoint-URL=http://mail.welcomefriend.co/wiz/api/index.php PHP Fatal error: Uncaught Error: Class 'MailWizzApi_Config' not found in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php:53 Stack trace:

0 /opt/pmta/bouncehandler/bouncehandler.php(109): require_once()

1 {main}

thrown in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php on line 53

I was also test with an CSV file

[root@mail pmta]# cat /root/eufr-subscribers-rg746b35rkf98.csv | /usr/bin/php ./bouncehandler/bouncehandler.php [25/Sep/2020 06:19:01] ------------------------------------------------------------------ [25/Sep/2020 06:19:01] Port25 PowerMTA bounce-handler [25/Sep/2020 06:19:01] (C) 2016-2017 Gerd Naschenweng https://github.com/magicdude4eva [25/Sep/2020 06:19:01] ------------------------------------------------------------------ [25/Sep/2020 06:19:01] Handling bounce categories=bad-mailbox,bad-domain,routing-errors,inactive-mailbox,spam-related,policy-related [25/Sep/2020 06:19:01] Soft-bounce categories=bad-configuration,bad-connection,content-related,invalid-sender,other,policy-related,quota-issues,spam-related,virus-related [25/Sep/2020 06:19:01] Bounce-provider: Interspire, initialising [25/Sep/2020 06:19:01] Skipped - not configured! [25/Sep/2020 06:19:01] Bounce-provider: MailWizz, initialising [25/Sep/2020 06:19:01] Endpoint-URL=http://mail.welcomefriend.co/wiz/api/index.php PHP Fatal error: Uncaught Error: Class 'MailWizzApi_Config' not found in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php:53 Stack trace:

0 /opt/pmta/bouncehandler/bouncehandler.php(109): require_once()

1 {main}

thrown in /opt/pmta/bouncehandler/providers/bounce-provider-mailwizz.php on line 53

I am using Php 7.4 and pmta version 4.5r11

Please help me to solve it,