aoberegg / ep_user_pad_frontend

User Interface for Etherpad Lite
Apache License 2.0
5 stars 8 forks source link

Etherpad crashes when inviting someone in my group #4

Open quenenni opened 10 years ago

quenenni commented 10 years ago

Really really nice plugin.

My problem: If I add a new user or re-invite someone in one of my group, my etherpad crashes:

[2014-04-08 02:18:46.493] [ERROR] console - Error: write EPIPE
    at errnoException (net.js:769:11)
    at Object.afterWrite (net.js:593:19)

When adding the user to my group, I can find it in the NotRegisteredUsersGroups table in the DB, but no mail is send.

My server send mails all the times and the plugin ep_mail_notification I use in my etherpad send the emails without problems. In the config file email.json, I let "smtp": "false", No attempt to send a mail is logged in my mail.log file

npm -v  ->  1.1.62
node -v  -> v0.8.11

Any idea where the problem can come from?

Thanks

quenenni commented 10 years ago

I found the problem.

I use a smtp server, but locally. And with your code, it's compulsory to have a user / password / port to connect to the smtp server.

In my case, I only need to give the option:

host: "localhost"

My smtp server only accepts to send mail from the localhost, so no problem with security (I think a lot of other users will be in the same situation)

To make it works, I modified the code in hooks.js in both ep_user_pad & ep_user_pad_frontend to:

var emailconfig = {host: eMailAuth.host};
if (eMailAuth.user) emailconfig["user"] = eMailAuth.user;
if (eMailAuth.password) emailconfig["password"] = eMailAuth.password;
if (eMailAuth.port) emailconfig["port"] = eMailAuth.port;
if (eMailAuth.ssl) emailconfig["ssl"] = eMailAuth.ssl;
var emailserver = email.server.connect(emailconfig);

And now, if I put this in the email.json file:

    "smtp": "true",
    "user": "",
    "password": "",
    "host": "localhost",
    "port": "",
    "tls": "",
    "ssl": "",

It works great for me.