My initial thought was to consider the contour integration of $$\frac{e^{imz}}{z(z^2-a^2)}=\frac{e^{imz}}{z(z+ai)(z-ai)}$$ Over the 'D-shaped' arc of a semicircle in the upper half plane. The reason for this is that in similar problems taking this approach worked applying residue theorem, however there is now a pole at $z=0$ which would lie on the contour.
I was wondering whether it is possible to form a small arc around $0$ to not include it in the contour, and whether this would have an effect on the calculation or would I obtain something along the lines of $$2 \pi i \left[ \lim \limits_{z \to ia} \frac{e^{imz}}{z(z+ia)} \right].$$
Contour integration that avoids the pole is possible, but not how I would evaluate the integral. I would proceed using Parseval's Theorem, which I outline below.
Throughout this answer, I have assumed that $a,m>0$. If they are not in your example, then a couple of minus signs or absolute values might pop up throughout the computation, but it should not substantially change.
The Fourier transform of
$$f(x) = \frac{\sin mx}{x}$$
is given by
\begin{align} \hat{f}(k) &= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \frac{\sin mx}{x}e^{-ikx}dx\\ &=\frac{1}{2i\sqrt{2\pi}}\left[\int_{-\infty}^\infty\frac{e^{i(m-k)x}}{x}dx - \int_{-\infty}^\infty\frac{e^{-i(m+k)x}}{x}dx\right] \end{align}
Differentiating with respect to $k$, we obtain
\begin{align} \frac{d\hat{f}}{dk} &= \frac{1}{2\sqrt{2\pi}}\left[\int_{-\infty}^{\infty}e^{-i(m+k)x}\,dx - \int_{-\infty}^\infty e^{i(m-k)x}\,dx\right]\\ &=\sqrt{\frac{\pi}{2}}\left[\delta(k+m) - \delta(k-m)\right] \end{align}
Integrating once, we have
$$\hat{f}(k) = \sqrt{\frac{\pi}{2}}\left[H(k+m) - H(k-m)\right]$$
The Fourier Transform of
$$g(x) = \frac{1}{x^2+a^2}$$
is given by
\begin{align} \hat{g}(k) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty\frac{e^{-ikx}}{x^2+a^2}\,dx \end{align}
Consider assume that $k$ is positive. We evaluate the integral by considering a semi-circle contour $\Gamma$ along the real axis that runs from $-R$ to $R$ and is then closed in the lower half plane, where the negative imaginary part of $z$ makes the contribution along the arc of the semi-circle vanish as $R\rightarrow \infty$.
Thus, we have:
\begin{align} \hat{g}(k) &= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty\frac{e^{-ikx}}{x^2+a^2}\,dx\\ &=\frac{1}{\sqrt{2\pi}}\oint_\Gamma \frac{e^{-ikz}}{z^2+a^2}\,dz\\ &=\sqrt{2\pi}i\operatorname{Res}\left(\frac{e^{ikz}}{z^2+a^2},-ia\right)\\ &=\sqrt{2\pi}i\lim\limits_{z\rightarrow -ia}\frac{e^{-ikz}}{z-ia}\\ &=\sqrt{\frac{\pi}{2}}\frac{e^{-ak}}{a} \end{align}
Analogously, we close the contour in the upper half-plane for negative values of $k$ and left with the following expression:
$$\hat{g}(k) =\sqrt{\frac{\pi}{2}}\frac{e^{-a|k|}}{a}$$
Now, by Parseval's theorem, we have:
$$\int_{-\infty}^\infty f(x)g(x)\,dx = \int_{\infty}^\infty \hat{f}(k)\hat{g}(k)\,dk$$
Thus, we have
\begin{align} \int_{-\infty}^\infty \frac{\sin mx}{x(x^2+a^2)}\,dx &= \frac{\pi}{2a}\int_{-\infty}^\infty e^{-a|k|}\left[H(k+m) - H(k-m)\right]\\ &=\frac{\pi}{2a}\int_{-m}^m e^{-a|k|}\,dk\\ &=\frac{\pi}{2a}\left[\int_{-m}^0 e^{ak}\,dk + \int_0^m e^{-ak}\,dk\right]\\ &=\frac{\pi}{2a}\left[\frac{1}{a}\left(1-e^{-am}\right) + \frac{1}{a}\left(1-e^{-am}\right)\right]\\ \end{align}
Grouping terms together, we have