I’m setting up a local Blynk Server on my Macbook Pro running Catalina 10.15.7. I’m able to successfully install with -serverProperties specified. When I try to add -mailProperties, however, I get an error message.
Here’s the command line to start the server (after a “cd” to the directory containing all files):
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:793)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:752)
at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:119)
at cc.blynk.server.notifications.mail.GMailClient.<init>(GMailClient.java:45)
at cc.blynk.server.notifications.mail.MailWrapper.<init>(MailWrapper.java:28)
at cc.blynk.server.Holder.<init>(Holder.java:136)
at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:95)
at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:73)
Works just fine; able to add a new user from the app (although I’ve had problems accessing the admin console, as I described in a separate post). No problems until I add the -mailConfig flag. Then, blooooeee!
For more flexibility you can extend server with more options by creating server.properties file in same folder as server.jar . Example could be found here. You could also specify any path to server.properties file via command line argument -serverConfig . You can do the same with mail.properties via -mailConfig and sms.properties via -smsConfig .
I’m trying to set this up, because I want the server to send me email with the auth token when a new project is created (rather than trying to transcribe it off my iPhone screen into my sketch). If there’s a better way (or any other way!!) to do this, please let me know! Thanks.
But this is t what you’re doing is it? You aren’t specifying a path to these files in your startup command.
If the files in question are in the same location as the .jar file then you don’t need to mention them in the startup command, they will be found automatically. If you want to put them somewhere else then you need to include this in the startup command and specify the path to these files
Thanks, Pete. I figured out what you were trying to tell me just before you sent that informative note; thank you. The server is starting up just fine without the extra flags. And the app tells me that an email is sent when I create a new project. However, in the server log I’m seeing:
3:03:43.113 ERROR- Error sending email auth token to user : elbyman1@gmail.com. Error: 530-5.7.0 Authentication Required. Learn more at
530 5.7.0 https://support.google.com/mail/?p=WantAuthError z14sm80344oot.5 - gsmtp
I tried following that link, but it seems to be dead. I did a bit of Googling, and found this can be due to 2-part authentication in Gmail, but I checked, and I don’t have 2-part authentication turned on. I did activate “Allow less secure apps”. Also double-checked the password that I entered in mail.properties, and it looks fine.
Any thoughts on what this problem might be?
not sure if that would help?
I think you may have to restart the server for any changes to take effect - this is certainly the case with server.properties
I’m not really a Gmail user myself, although I do have an account that I set up to be able to access some Google functionality and that I use occasionally for a few odd things. Like everything, I have two-factor authorisation configured for this account.
However, I created a new Gmail account and configured the “Allow less secure apps” option and no two-factor authorisation and this is used solely for Blynk emails.
Oh, and don’t try editing these files through the Blynk admin console - changes aren’t saved!
SOLVED. After a lot of poking around, I found someone with a similar problem describe dealing with markup in their mail.properties file. I had the same problem! The TextEditor program I was using on the Mac was hiding a bunch of markup. When I did a “cat” in the terminal, I could see it. The fix was to delete the file, then re-create it by typing “cat > mail.properties” in the terminal, type in all the correct lines, then to complete the file. I did the same for server.properties, and everything is working great now Thanks very much for your help with this, Pete.