\documentclass[twoside]{book}

% Packages required by doxygen
\usepackage{fixltx2e}
\usepackage{calc}
\usepackage{doxygen}
\usepackage[export]{adjustbox} % also loads graphicx
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage{multicol}
\usepackage{multirow}
\PassOptionsToPackage{warn}{textcomp}
\usepackage{textcomp}
\usepackage[nointegrals]{wasysym}
\usepackage[table]{xcolor}

% Font selection
\usepackage[T1]{fontenc}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{amssymb}
\usepackage{sectsty}
\renewcommand{\familydefault}{\sfdefault}
\allsectionsfont{%
  \fontseries{bc}\selectfont%
  \color{darkgray}%
}
\renewcommand{\DoxyLabelFont}{%
  \fontseries{bc}\selectfont%
  \color{darkgray}%
}
\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}

% Page & text layout
\usepackage{geometry}
\geometry{%
  a4paper,%
  top=2.5cm,%
  bottom=2.5cm,%
  left=2.5cm,%
  right=2.5cm%
}
\tolerance=750
\hfuzz=15pt
\hbadness=750
\setlength{\emergencystretch}{15pt}
\setlength{\parindent}{0cm}
\setlength{\parskip}{3ex plus 2ex minus 2ex}
\makeatletter
\renewcommand{\paragraph}{%
  \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
    \normalfont\normalsize\bfseries\SS@parafont%
  }%
}
\renewcommand{\subparagraph}{%
  \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
    \normalfont\normalsize\bfseries\SS@subparafont%
  }%
}
\makeatother

% Headers & footers
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}}
\fancyhead[CE]{\fancyplain{}{}}
\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}}
\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}}
\fancyhead[CO]{\fancyplain{}{}}
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
\fancyfoot[LE]{\fancyplain{}{}}
\fancyfoot[CE]{\fancyplain{}{}}
\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }}
\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }}
\fancyfoot[CO]{\fancyplain{}{}}
\fancyfoot[RO]{\fancyplain{}{}}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{%
  \markboth{#1}{}%
}
\renewcommand{\sectionmark}[1]{%
  \markright{\thesection\ #1}%
}

% Indices & bibliography
\usepackage{natbib}
\usepackage[titles]{tocloft}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{5}
\makeindex

% Hyperlinks (required, but should be loaded last)
\usepackage{ifpdf}
\ifpdf
  \usepackage[pdftex,pagebackref=true]{hyperref}
\else
  \usepackage[ps2pdf,pagebackref=true]{hyperref}
\fi
\hypersetup{%
  colorlinks=true,%
  linkcolor=blue,%
  citecolor=blue,%
  unicode%
}

% Custom commands
\newcommand{\clearemptydoublepage}{%
  \newpage{\pagestyle{empty}\cleardoublepage}%
}

\usepackage{caption}
\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}

%===== C O N T E N T S =====

\begin{document}

% Titlepage & ToC
\hypersetup{pageanchor=false,
             bookmarksnumbered=true,
             pdfencoding=unicode
            }
\pagenumbering{alph}
\begin{titlepage}
\vspace*{7cm}
\begin{center}%
{\Large B\+M\+A\+Mail \\[1ex]\large 1.\+0.\+0 }\\
\vspace*{1cm}
{\large Generated by Doxygen 1.8.13}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
\pagenumbering{roman}
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
\hypersetup{pageanchor=true}

%--- Begin generated contents ---
\chapter{Namespace Index}
\input{namespaces}
\chapter{Hierarchical Index}
\input{hierarchy}
\chapter{Class Index}
\input{annotated}
\chapter{File Index}
\input{files}
\chapter{Namespace Documentation}
\input{namespacemail}
\chapter{Class Documentation}
\input{classmail_1_1_____i_m_a_p___a_p_p_e_n_d}
\input{classmail_1_1_____i_m_a_p___a_u_t_h_e_n_t_i_c_a_t_e}
\input{classmail_1_1_____i_m_a_p___c_h_e_c_k}
\input{classmail_1_1_____i_m_a_p___c_l_o_s_e}
\input{classmail_1_1_____i_m_a_p___c_o_p_y}
\input{classmail_1_1_____i_m_a_p___c_r_e_a_t_e}
\input{classmail_1_1_____i_m_a_p___d_e_l_e_t_e}
\input{classmail_1_1_____i_m_a_p___e_x_a_m_i_n_e}
\input{classmail_1_1_____i_m_a_p___e_x_p_u_n_g_e}
\input{classmail_1_1_____i_m_a_p___f_e_t_c_h}
\input{classmail_1_1_____i_m_a_p___l_i_s_t}
\input{classmail_1_1_____i_m_a_p___l_o_g_i_n}
\input{classmail_1_1_____i_m_a_p___l_s_u_b}
\input{classmail_1_1_____i_m_a_p___r_e_n_a_m_e}
\input{classmail_1_1_____i_m_a_p___s_e_a_r_c_h}
\input{classmail_1_1_____i_m_a_p___s_e_l_e_c_t}
\input{classmail_1_1_____i_m_a_p___s_t_a_r_t_t_l_s}
\input{classmail_1_1_____i_m_a_p___s_t_a_t_u_s}
\input{classmail_1_1_____i_m_a_p___s_t_o_r_e}
\input{classmail_1_1_____i_m_a_p___s_u_b_s_c_r_i_b_e}
\input{classmail_1_1_____i_m_a_p___u_i_d}
\input{classmail_1_1_____i_m_a_p___u_n_s_u_b_s_c_r_i_b_e}
\input{classmail_1_1_____p_o_p3___d_e_l_e}
\input{classmail_1_1_____p_o_p3___l_a_s_t}
\input{classmail_1_1_____p_o_p3___l_i_s_t}
\input{classmail_1_1_____p_o_p3___n_o_o_p}
\input{classmail_1_1_____p_o_p3___p_a_s_s}
\input{classmail_1_1_____p_o_p3___q_u_i_t}
\input{classmail_1_1_____p_o_p3___r_e_t_r}
\input{classmail_1_1_____p_o_p3___r_p_o_p}
\input{classmail_1_1_____p_o_p3___r_s_e_t}
\input{classmail_1_1_____p_o_p3___s_t_a_t}
\input{classmail_1_1_____p_o_p3___t_o_p}
\input{classmail_1_1_____p_o_p3___u_s_e_r}
\input{classmail_1_1_____s_m_t_p___a_u_t_h}
\input{classmail_1_1_____s_m_t_p___d_a_t_a}
\input{classmail_1_1_____s_m_t_p___e_h_l_o}
\input{classmail_1_1_____s_m_t_p___h_e_l_o}
\input{classmail_1_1_____s_m_t_p___m_a_i_l}
\input{classmail_1_1_____s_m_t_p___n_o_o_p}
\input{classmail_1_1_____s_m_t_p___q_u_i_t}
\input{classmail_1_1_____s_m_t_p___r_c_p_t}
\input{classmail_1_1_____s_m_t_p___r_s_e_t}
\input{classmail_1_1_____s_m_t_p___v_r_f_y}
\input{classmail_1_1_i_m_a_p_command}
\input{classmail_1_1_i_m_a_p_service}
\input{classmail_1_1_i_m_a_p_session}
\input{classmail_1_1_mail_delivery}
\input{classmail_1_1_mail_file_system}
\input{classmail_1_1_p_o_p3_command}
\input{classmail_1_1_p_o_p3_service}
\input{classmail_1_1_p_o_p3_session}
\input{classmail_1_1_s_m_t_p_command}
\input{classmail_1_1_s_m_t_p_service}
\input{classmail_1_1_s_m_t_p_session}
\chapter{File Documentation}
\input{_____i_m_a_p___a_p_p_e_n_d_8h}
\input{_____i_m_a_p___a_u_t_h_e_n_t_i_c_a_t_e_8h}
\input{_____i_m_a_p___c_h_e_c_k_8h}
\input{_____i_m_a_p___c_l_o_s_e_8h}
\input{_____i_m_a_p___c_o_p_y_8h}
\input{_____i_m_a_p___c_r_e_a_t_e_8h}
\input{_____i_m_a_p___d_e_l_e_t_e_8h}
\input{_____i_m_a_p___e_x_a_m_i_n_e_8h}
\input{_____i_m_a_p___e_x_p_u_n_g_e_8h}
\input{_____i_m_a_p___f_e_t_c_h_8h}
\input{_____i_m_a_p___l_i_s_t_8h}
\input{_____i_m_a_p___l_o_g_i_n_8h}
\input{_____i_m_a_p___l_s_u_b_8h}
\input{_____i_m_a_p___r_e_n_a_m_e_8h}
\input{_____i_m_a_p___s_e_a_r_c_h_8h}
\input{_____i_m_a_p___s_e_l_e_c_t_8h}
\input{_____i_m_a_p___s_t_a_r_t_t_l_s_8h}
\input{_____i_m_a_p___s_t_a_t_u_s_8h}
\input{_____i_m_a_p___s_t_o_r_e_8h}
\input{_____i_m_a_p___s_u_b_s_c_r_i_b_e_8h}
\input{_____i_m_a_p___u_i_d_8h}
\input{_____i_m_a_p___u_n_s_u_b_s_c_r_i_b_e_8h}
\input{_____p_o_p3___d_e_l_e_8h}
\input{_____p_o_p3___l_a_s_t_8h}
\input{_____p_o_p3___l_i_s_t_8h}
\input{_____p_o_p3___n_o_o_p_8h}
\input{_____p_o_p3___p_a_s_s_8h}
\input{_____p_o_p3___q_u_i_t_8h}
\input{_____p_o_p3___r_e_t_r_8h}
\input{_____p_o_p3___r_p_o_p_8h}
\input{_____p_o_p3___r_s_e_t_8h}
\input{_____p_o_p3___s_t_a_t_8h}
\input{_____p_o_p3___t_o_p_8h}
\input{_____p_o_p3___u_s_e_r_8h}
\input{_____s_m_t_p___a_u_t_h_8h}
\input{_____s_m_t_p___d_a_t_a_8h}
\input{_____s_m_t_p___e_h_l_o_8h}
\input{_____s_m_t_p___e_x_p_n_8h}
\input{_____s_m_t_p___h_e_l_o_8h}
\input{_____s_m_t_p___h_e_l_p_8h}
\input{_____s_m_t_p___m_a_i_l_8h}
\input{_____s_m_t_p___n_o_o_p_8h}
\input{_____s_m_t_p___q_u_i_t_8h}
\input{_____s_m_t_p___r_c_p_t_8h}
\input{_____s_m_t_p___r_s_e_t_8h}
\input{_____s_m_t_p___v_r_f_y_8h}
\input{_i_m_a_p_command_8h}
\input{_i_m_a_p_service_8h}
\input{_i_m_a_p_session_8h}
\input{_mail_delivery_8cpp}
\input{_mail_delivery_8h}
\input{_mail_file_system_8h}
\input{main_8cpp}
\input{_p_o_p3_command_8h}
\input{_p_o_p3_service_8h}
\input{_p_o_p3_session_8h}
\input{_s_m_t_p_command_8h}
\input{_s_m_t_p_service_8h}
\input{_s_m_t_p_session_8h}
%--- End generated contents ---

% Index
\backmatter
\newpage
\phantomsection
\clearemptydoublepage
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}
