How do I find out what mail program is installed/sending emails?
You could try
$ dpkg -S `which sendmail`
I believe postfix is the default MTA for Ubuntu. Its main configuration file is /etc/postfix/main.cf
Other commands that might help:
# netstat -tanpl|grep :25
# lsof -i :25