Extension talk:BounceHandler

About this board

BounceHandler alongside $wgSMTP?

3
Grovebose (talkcontribs)

Hi,


Is BounceHandler able to be used alongside an external SMTP server configured using $wgSMTP? In terms of receiving the POST upon bounced emails, we can configure the SMTP server to POST using events, but I'm unsure if BounceHandler is able to set the Return-Path header on outbound emails when an external SMTP server is used? Thanks

Ciencia Al Poder (talkcontribs)

BounceHandler requires a modification in the mail server, to route bounced emails to a special queue that triggers an HTTP POST request to the MediaWiki api.

You can't do that on an external mail server.

01tonythomas (talkcontribs)

Technically, you should be able to use it with a 3rd party SMTP server. I remember setting this up with Mailgun, back during development. Extension:Mailgun


Now, the trick is in the hook implementation of UserMailerChangeReturnPath, and from the code here: https://github.com/wikimedia/mediawiki-extensions-BounceHandler/blob/master/includes/Hooks.php#L44 , I can see that you can form custom "Return-To" emails by setting variables correctly in your configs.

global $wgVERPprefix, $wgVERPalgorithm, $wgVERPsecret, $wgVERPdomainPart, $wgServerName;

Lets us know how it goes.@Grovebose

Reply to "BounceHandler alongside $wgSMTP?"

Postfix not routing emails

8
Prh47bridge (talkcontribs)

I've set up Postfix using the instructions for this extension. Sending to an invalid email doesn't route but that is not a surprise. The email address needs to match the VERP address format. When I try that I can see from mail.log that it is being relayed to curl_email@mydomain and the message is then queued. However, delivery fails with postfix/local giving the error message 'relay=local, delay=0.06, delays=0.03/0/0/0.03, dsn=5.1.1, status=bounced (unknown user: "curl_email")'. After a little bit of searching on the internet I have added allow_mail_to_commands = alias,forward,include to my main.cf but it has not made any difference. Any ideas?

Prh47bridge (talkcontribs)

Ok, I've fixed that. Not entirely sure how but it is now routing. I am now getting curl error 23.

Prh47bridge (talkcontribs)

It seems the curl error was because I hadn't set wgBounceHandlerInternalIPs. The documentation could be clearer!

Prh47bridge (talkcontribs)

Nope. Thought I'd fixed it but I'm still getting error 23 and nothing in the database. However, when I try curl manually it isn't complaining about use of a non-internal IP address any more. I'm getting "bouncehandler" "submitted":"failure" with nothing about the nature of the failure.

Seb35 (talkcontribs)
Prh47bridge (talkcontribs)

Just for clarity - that is the output I get using curl by hand. I can't see what I get when postfix uses it for an incoming email - the output is too long so the log runs out in the middle of the options in the head.

01tonythomas (talkcontribs)

> Just for clarity - that is the output I get using curl by hand. I can't see what I get when postfix uses it for an incoming email - the output is too long so the log runs out in the middle of the options in the head.

Can you grep `BounceHandler` in MediaWiki logs and see if something shows up ? Ideally, we have enough logging (I presume) which can help us in something. From what I see from https://github.com/wikimedia/mediawiki-extensions-BounceHandler/blob/e51742d05e603bc43cef0408291c15b5d8ceff14/includes/ApiBounceHandler.php#L43, this happens when I am not able to extract `wikiId` from the incoming address. Btw, this wikiId is generated from

$wikiId = str_replace( '-', '.', wfWikiID() );
Prh47bridge (talkcontribs)

Thanks for the response. I hadn't thought of turning on logging and taking a look. It seems hash validation is failing which is reasonable. So for testing, it isn't enough to send an email to an invalid email address. The email address used has to be of the form wiki-testwiki-2a-nanrfx-Tn14EQZWaotS2XNn where testwiki is replaced with the database name of your wiki and the Tn14... bit is replaced with a correct hash. Without that nothing will appear in the relevant database table. At least this suggests that everything is working properly. I'm just not going to see anything in the database table until I get a genuine bounce.

Reply to "Postfix not routing emails"
There are no older topics
Return to "BounceHandler" page.