Problems when preparing migration from v4.5.39 to v5.2.3-C51

However, any clue on the smtp problem? I’m quite out of ideas since there’s nothing in the logs giving me a hint on possible reasons.

Not sure, I assume all of the fields are filled in?

@david any ideas?

Its not possible to transfer passwords due to the hashing algo. these always need to be reset when moving over.

@david That’s ok and noted for the real migration. But the problem in question is, if there’s any hint about debugging the email problem. No errors in the laravel log, and no log entries in the postfix log, it seems like ninja doesn’t even try to connect the smtp server but doesn’t throw an error.

@frank42

The app stores the email errors in the System Logs - in the app, under the dashboard is a System logs tab.

Ah, thanks, found it. But there’s another problem:

Screenshot_2021-09-21_14-54-19

The error message is “Error”, and nothing more. I know that there must be an error, but I don’t see an error message here (and no, when expanding the item, there’s nothing behind except 10 pages of plain grey).

You’ll also want to check your activity tab.

Also if your company is not activated, emails will not send

Of course I checked with company activated and deactivated and with my tests I activate it beforehand.
Nevertheless, neither activity log nor system log does show any error. I checked the mysql table “system_logs” for entries and found this:

"Connection could not be established with host localhost :stream_socket_client(): unable to connect to none:\/\/localhost:25 (Unable to find the socket transport \"none\" - did you forget to enable it when you configured PHP?)"

This error doesn’t show up in either system log or activity log, besides that there’s nothing in the postfix smtp log, nothing in the mysql error log and nothing in the apache error log and nothing in the laravel.log and I’m quite helpless what’s wrong here. Besides that, php artisan ninja:send-test-emails does also nothing.

So, what shall I do with the drunken sailor?

@frank42

the error indicates that it couldn’t connect to your localhost on port 25.

Well, sorry, but despite the fact I’m no software developer and just a simple sysadmin, I’m not retarded. OF COURSE I checked the availability of the smtp server connection.

root@narutest:~# nc -v localhost 25
localhost [127.0.0.1] 25 (smtp) open
220 narutest.irz42.net ESMTP Postfix (Debian/GNU)

also, my php is configured to be able to send email, because this is what phpinfo says:

root@narutest:~# php -i |grep -i smtp
SMTP => localhost => localhost
smtp_port => 25 => 25
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp

So, this error does indicate something else, and judging by the wording in the error, I assume that somewhere in the code a socket transport named “none” is configured.

Seems like I found the problem myself. The .env.example says:

MAIL_MAILER=smtp

which I of course adopted in my .env file. So, now I’ve added - just for testing purpose - this from the .env of my v4 installation:

MAIL_DRIVER=smtp

and - D’OH! - it works.

Update: Well, almost… the connection works now, but there’s still something wrong, because now I get this:

Sep 22 13:16:39 narutest postfix/smtpd[2390]: connect from localhost[::1]
Sep 22 13:16:39 narutest postfix/smtpd[2390]: Anonymous TLS connection established from localhost[::1]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep 22 13:16:39 narutest postfix/smtpd[2390]: lost connection after STARTTLS from localhost[::1]
Sep 22 13:16:39 narutest postfix/smtpd[2390]: disconnect from localhost[::1] ehlo=1 starttls=1 commands=2

As far as I see, this is a result of stream_socket_enable_crypto(): Peer certificate CN=*.irz42.net’ did not match expected CN=localhost' which makes sense, since the TLS certificate has no “localhost” in it. but when changing MAIL_ENCRYPTION=tls to none as the .env.example says, the connection fails with the same “unable connect to none://” error as mentioned earlier.

Will say: when using the machine’s FQDN instead of MAIL_HOST=localhost (as configured in .env.example) and when using MAIL_ENCRYPTION=tls instead of MAIL_ENCRYPTION=none (as configured in .env.example), sending emails works.