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?
Topic on Extension talk:BounceHandler
Ok, I've fixed that. Not entirely sure how but it is now routing. I am now getting curl error 23.
It seems the curl error was because I hadn't set wgBounceHandlerInternalIPs. The documentation could be clearer!
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.
I had issues about non-internal IPs because curl http://mywiki.example.org/api.php
uses the public IP and not 127.0.0.1. I’ve just added in the documentation curl --interface 127.0.0.1 http://mywiki.example.org/api.php
to force routing through the local interface and being whitelisted by wgBounceHandlerInternalIPs.
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.
> 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() ); |
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.