Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Dynamic settings for mail server connection from velocity instead of server.properties

    Hi Isomorphic,

    for our SaaS application we are generating a war-file per customer, that differs in very few settings. Building and deploying these wars is a tedious and most likely unnecessary task, if we could serve the application as one war under different subdomains. I don't see a problem with DB credentials here as SQLDataSource can generate correct WHEREs as needed. All other things that differ are application details that can be solved in code or by moving stuff to the database.

    I might have a problem with email-sending, though. Per the docs, the mail server settings come from the server.properties file. This means only one mail server per war-file / application.
    This does not make it possible to use customer-specific mail accounts.
    Can you make the mail.system.mail.smtp settings host / port / user / auth / password / starttls Velocity variables like from / to / cc /... in the docs?

    Thank you & Best regards
    Blama

    #2
    This is a bit strange. An application would normally use just one smtp server to send mail to all of its different customers. That’s because all mail coming from the application should be coming from a single sender. For example, if your app was something like MailChimp, all the notifications, reports, password resets etc would be coming from some mailchimp.com account, and you would need to send them all as the same authenticated sender.

    This is still the case even for hosted email as such (eg gmail) except that credentials would be different, although one server address would still be used.

    Can you clarify what you’re looking for here? At the moment, at most a means of dynamic credentials may make sense.

    Comment


      #3
      Hi Isomorphic,

      of course:
      We offer a SaaS application where each of our customers tries to let our system look as much as their own system as possible and not as a bought solution.

      Right now, we send mails from noreply.[customername]@ourserver.net, but also also say "If you want to, you can use our own SMTP, just hand us over the credentials". We also say (nobody requested it yet, but we prepare for it) "If you want to, create a subdomain under your own domain, e.g. distribution.[customername].com, link the DNS to us and send us the SSL certificate", so that it looks like their own service even more.

      So yes, right now we'd only need dynamic credentials, but eventually we'd also need a dynamic server name.

      All this worked fine so far, as we deployed our application once per customer and had the correct settings copied to the server.properties during build. But this means/meant one WAR per customer, which makes it hard to run the server (memory wise) and update the system (copy over a 60MB WAR per customer).

      In order to solve both issues I try to change the system to use only one WAR. The necessary restrictions w.r.t. the DB queries from SQLDataSource are possible to create via HttpServletRequest, available with every request.

      The only remaining issue I see so far is to use a different mail account per customer from the same WAR file. The server.properties can only include one entry - in order for this to work, all the server connection data must be dynamic.

      (I also see an issue w.r.t. Tomcat login, and the logo and color on the login page, but this is not related to your framework).

      Best regards
      Blama

      Comment


        #4
        Ok, that’s an interesting and unusual option for your customers. It’s not completely trivial on or end because there are a few codepaths to adjust that just assume a single, non-dynamic set of SMTP settings. So this could be a small sponsorship that you may want to roll into the other sponsorships you’ve requested recently - let us know if you’d like an estimate for this one too.

        Comment


          #5
          Hi Isomorphic,

          yes, that would be great. Of course, I'd prefer if this could go into 12.0p and not 12.1p.
          I'm still on 6.1p, but we are already preparing the move to 12.0p since a long time now.

          Thank you & Best regards
          Blama

          Comment


            #6
            Hi Isomorphic , Hi all

            it seems that this feature sponsorship was also ported to 12.0p.

            Best regards
            Blama

            Comment


              #7
              Sorry, please disregard this. It was meant to be in 6.1p already, which it is. We just did not use it so far...

              Comment

              Working...
              X