Can I change Mailsprings class name or title on Linux?

Can I change Mailsprings class name or title? Mailspring changes the title automatically so I cannot use it for Scratchpad in xmonad WM. So is there an option to change it to something static or restrict Mailspring from changing the name after opening an email?

There’s no option to freeze the title, but you shouldn’t need one. The main window’s title is always Mailspring on its own or Mailspring · <subject of the open thread> - it’s the subject suffix that’s changing on you - while the window class (WM_CLASS, which xmonad exposes as className) is fixed and never changes with what you’re viewing. The usual approach for a scratchpad is to match on the class instead of the title, e.g. className =? "Mailspring" (run xprop and click the window to confirm the exact string on your build), or if you’d rather keep a title match, use a prefix match like fmap ("Mailspring" isPrefixOf) title.

One caveat: popped-out composer windows share the same class (they’re all windows of the same Electron app) and get the draft’s subject as their title, so if you pop drafts out a lot you may want to combine a class match with the "Mailspring" title-prefix check to make sure the scratchpad only grabs the main window.