Modify to support inquery mail (Preliminary version)