With my MAIL_TRANSPORT set to mail in config.php, I see this in the server’s system logs:
Feb 27 19:57:18 alice php: mail() on [/home/kanboard/libs/swiftmailer/classes/Swift/Transport/SimpleMailInvoker.php:34]: To: Kaoru <xxxx@xxxx.co.uk> -- Headers: Message-ID: <9aa858b82b7cfcb14f517e1600bf9b5f@board.xxx.co.uk> Date: Thu, 27 Feb 2025 19:57:18 +0000 From: Jon via Kanboard <kanband-no-reply@xxxx.co.uk> Reply-To: jonathan@xxx.com MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Auto-Submitted: auto-generated -- Subject: [Campaign] New comment on task #10
But there is nothing in the server’s mail logs, and nothing arrives. I’m running postfix on Ubuntu using PHP 8.1. Other PHP applications are able to send out mail.
I’ve also tried setting it to sendmail, but can’t see anything either. If I try turning on the debug logs I get loads of stuff but no apparent errors or even any indication that it’s sending any email at all.
Does anyone have any clues about what I might be doing wrong?
Yes, which is also why I’m puzzled about the problem. When I set the kanboard config to use sendmail (with the same command that php.ini is using) then mail still doesn’t send. I thought at first it was something to do with with way kanboard was set up to use the php mail function, but that doesn’t seem to be the case if the sendmail option also doesn’t work.
I can try sending directly via smtp auth, but I’d prefer to use the more standard method if I can.
One more idea: Are you sure that the sender address is accepted by the MTA for delivery? (Relaying)
Unfortunately, there won’t be any (visible) errors.
I’m pretty sure the relay will accept anything from the server’s IP (which is in the postfix $mynetworks list), regardless of the “From:” header, if that’s what you mean. But to test that, I put the sending address that appears in the logs into a php script using the mail() function and all was well with that.
Do you think it might be some issue with SimpleMailInvoker.php that I see kanboard using? Other php systems on the server use PHPMailer.php.
BTW I set the sending address in the kanboard config to “no-reply@” but the log above shows it coming from “kanband-no-reply@”. Not sure that’s a problem though but it’s a bit odd.
Ah! I’ve made that change now, but so far no difference. All other PHP apps show up in our mail server’s log as (for example) header X-PHP-Originating-Script: 33:PHPMailer.php ... but Kanboard’s action doesn’t turn up and no mail comes through.
So if I use smtp it works, but as far as I can tell neither mail nor sendmail do. It’s OK using smtp though, it just means I had to set up an account for it.
Apologies for not mentioning the version I’m using:
Thanks! Yes, that works (it’s essentially a better version of the one I tried on the command line earlier). mail() is definitely working on the server.
It may have been me not understanding Kanboard somehow. For example, when I was first testing it I may not have realised it doesn’t send when I comment on a ticket that’s assigned to me (which would be logical). I later found a “send by email” function in the UI which worked after I had set it to smtp. I then contacted somebody else who has an account on the board to ask if they had been getting mail and they said they had, but it was only after the change to smtp. Hm.
I’ll try changing it back to mail() and doing some more reliable tests with them.