Hostname -f must return the correct hostname and not localhost. To fix this, edit or create the file /etc/hostname and put the hostname mail.q#####.com there. then run:
hostname -F /etc/hostname
Afterwards, change anything in the mail account inside ispconfig, e.g. the quota and save the cahnges, so that the config files get rewritten.