  Let $\mathcal S^2$ be the Stepanov space and let $ \lambda_n\uparrow\infty$.
Let $(a_n)_{n\ge 1}$ be satisfying Wiener's condition $A:= \sum_{n\ge 1}
\big(\sum_{k\, :\, n\le \lambda_k \le n+1}|a_k|\big)^2 <\infty$. We prove that
$\big\| \sup_{N\ge 1} \big|\sum_{n=1}^Na_n{\rm e}^{i\lambda_n t}\big| \,
\big\|_{\mathcal S^2}\le C\, A^{1/2} $ where $C>0$ denotes a universal
constant. Moreover, the series $\sum_{n\ge 1} a_n{\rm e}^{it\lambda_n }$
converges for $\lambda$-a.e. $t\in \mathbb R$. This contains as a special case
Hedenmalm and Saksman result for Dirichlet series. We also obtain maximal
inequalities for corresponding series of dilates. Let $1\le p,q\le 2$ be such
that $1/p+1/q=3/2$. Then for any sequence $(\alpha_n)_{n\ge 1}$ and
$(\beta_n)_{n\ge 1}$ of complex numbers such that $K:=\sum_{n\ge 1}
\big(\sum_{k\,:\, n\le \lambda_k< n+1}|\alpha_k|\,\big)^p <\infty$ and
$L:=\sum_{n\ge 1} \big(\sum_{k\,:\, n\le \mu_k< n+1} |\beta_k|\,\big)^q
<\infty$, we have $$ \Big\|\sup_{N\ge 1} \big|\sum_{n=1}^N \alpha_n D(\lambda_n
t)\big|\, \Big\|_{\mathcal S^2} \le C\, K^{1/p}\, L^{1/q }
  $$ where $D(t)= \sum_{n\ge 1}\beta_n {\rm e}^{i\mu_n t}$ is defined in
$\mathcal S^2$. Moreover, the series $\sum_{n\ge 1} \alpha_n D(\lambda_nt)$
converges in $\mathcal S^2$ and for $\lambda$-a.e. $t\in \mathbb R$. We further
show that if $\{\lambda_k, k\ge 1\}$ satisfies the following condition $$\sum_{
k\not=\ell\,,\, k'\not=\ell'\atop
(k,\ell)\neq(k',\ell')}\big(1-|(\lambda_k-\lambda_\ell)-(\lambda_{k'}-\lambda_{\ell'})
|\big)_+^2 \, <\infty,$$ then the series $\sum_{k} a_k {\rm e}^{i\lambda_kt}$
converges on a set of positive Lebesgue measure, only if the series
$\sum_{k=1}^\infty |a_k|^2$ converges. The above condition is in particular
fulfilled when $\{\lambda_k, k\ge 1\}$ is a Sidon sequence.
