webmail server error

i am getting the following errors when i try to log in the webmail system on any email account.

Deprecated: Function eregi() is deprecated in /var/www/vhosts/ehcp/webmail/functions/imap_general.php on line 660

Deprecated: Function eregi() is deprecated in /var/www/vhosts/ehcp/webmail/functions/imap_general.php on line 661

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/ehcp/webmail/functions/imap_general.php:660) in /var/www/vhosts/ehcp/webmail/functions/global.php on line 514

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/ehcp/webmail/functions/imap_general.php:660) in /var/www/vhosts/ehcp/webmail/src/redirect.php on line 186