diff --git a/doc/README.email-sender.md b/doc/README.email-sender.md new file mode 100644 index 0000000..d7ef1a1 --- /dev/null +++ b/doc/README.email-sender.md @@ -0,0 +1,12 @@ +Email Sender +============ + +As of gitbucket 3.4, the sender of the notification emails is build like this: + +* {fromName} {fromAddress} ... in case you configured both of them +* {loginName} notifications@gitbucket.com ... in case you configured none of them +* {fromAddress} ... in case you configured only the from address + +For me, I'd like to see this: + +* {loginName} {fromAddress} ... when from name isn't configured diff --git a/src/main/scala/gitbucket/core/util/Notifier.scala b/src/main/scala/gitbucket/core/util/Notifier.scala index b7dbbe8..b88a4e1 100644 --- a/src/main/scala/gitbucket/core/util/Notifier.scala +++ b/src/main/scala/gitbucket/core/util/Notifier.scala @@ -87,7 +87,7 @@ email.setSSLOnConnect(ssl) } smtp.fromAddress - .map (_ -> smtp.fromName.orNull) + .map (_ -> smtp.fromName.getOrElse(context.loginAccount.get.userName)) .orElse (Some("notifications@gitbucket.com" -> context.loginAccount.get.userName)) .foreach { case (address, name) => email.setFrom(address, name)