I had to get sendmail working on my ubuntu / well kubuntu installation today – well i actually didn’t need to configure that, but i hade to test some programs that should use smtp to forward mail to an external mailserver. And i ran this in wmvare. And then i found out that i never had configure that. Next part was that by default, ubuntu and kubuntu is using exim as the mailer, not the real sendmail system. So I thought that I should get it to work. Kind of out of the box.
First thing to run is exim-config
1 |
sudo dkpg-reconfigure exim-config |
The options I used were:
- mail sent by smarthost; received via SMTP or fetchmail
- <your box hostname> (i had to adjust this – adding hostname and domain to it)
- 127.0.0.1 ; ::1 (this was also filled in.. I added 192.168.205.1 as i whanted it to listen to vmware internal net also)
- <your box hostname> (again, this was filled in already, I just accepted the default)
- I added 192.168.205.128 here as i whanted my vmware host to be able to forward. Normally you SHOULD leave this blank.
- ns1.smtphost.com (the smtp server provided by my ISP)
- I said no (the default)
- I said no (the default) for DNS lookups
- I chose the mbox format. (the default)
- I chose the “unsplit” config file option (the defaults)
This fixes the exim setup mostly. As our smtp is using plain text you need to enable that also. Create (or edit) the file /etc/exim4/exim4.conf.localmacros and add the following line to it, and save it:
1 |
AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = true |
Then we need to setup the outgoing mail account you’re using by editing the file /etc/exim4/passwd.client. As I’m only doing mail to one smtp server im using the wildcard:
1 2 3 4 5 6 7 8 |
# password file used when the local exim is authenticating to a remote # host as a client. # # see exim4_passwd_client(5) for more documentation # # Example: ### target.mail.server.example:login:password *:mail_user:password |
Then I need to fix outgoing mail so that root/jan/postmaster goes to me. This is fixed by changing the /etc/email-addresses file.
1 2 3 4 5 6 7 8 9 10 11 12 |
# This is /etc/email-addresses. It is part of the exim package # # This file contains email addresses to use for outgoing mail. Any local # part not in here will be qualified by the system domain as normal. # # It should contain lines of the form: # #user: someone@isp.com #otheruser: someoneelse@anotherisp.com jan: jan@irial.com root: jan@irial.com postmaster: jan@irial.com |
Finally its time to re-read the exmin4 config and restart the server.
1 2 |
sudo update-exim4.conf sudo /etc/init.d/exim4 restart |