This post is meant for those users who meet these requirements:
- You have obtained a static IP address from Airtel India.
- You have set up your host correctly - see my previous post.
- You plan to host a mailserver on your host with the ip address from step 1.
- You plan to use sendmail as the MTA (mail transport agent).
In order for sendmail to successfully relay messages to your ISP, and then onto the recipients, there are a number of steps to configure sendmail correctly. Some of these are required to eliminate spam (a very honorable goal).
First, you need to ask Airtel to enable your sendmail daemon to connect to their sendmail daemon on port 25. This is accomplished by sending a email to their customer service care.karnataka@airtel.in with cc: to d.blr@airtel.in. (Note these e-mail addresses will be different if you are in a different region in India). This step is mainly to get written confirmation from you that you will not send spam and have anti-virus measures properly done on your host.
Second, once port 25 is enabled, go to
relay.airtelbroadband.in and register the e-mail address for which you need the relay. Let's say the webserver on your host will send mails from email address foo@blah.com, then you do the following:
- use the DSL userid and DSL password that Airtel gave you.
- In the relay addresses form, add "foo@blah.com". In the password field, enter the auth password of your choice for this email address, let's say it is "mypwd". Only emails from this address will be relayed. Everything else will be rejected by Airtel. Note that you should choose this email address to be the login account of your mailserver on your mailserver machine. In case you want to change this address later, you can login to relay.airtelbroadband.in with "foo@blah.com" and "mypwd" and then update the email address and/or passwd.
You should see that the email has been successfully registered. This completes the setup at Airtel ISP.
Now the important part on your side.
- cd to /etc/mail
- edit authinfo file and add this line: AuthInfo:relay.airtelbroadband.in "U:foo@blah.com" "I:foo@blah.com" "P:mypwd" "M:DIGEST-MD5 LOGIN PLAIN"
- edit sendmail.mc and add these lines. For more info about this, see this sendmail chapter at Mashedge:
define(`SMART_HOST', `esmtp:relay.airtelbroadband.in')dnl
FEATURE(authinfo)dnl
define(`confAUTH_OPTIONS', `A')dnl
TRUST_AUTH_MECH(`EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_REALM',`blah.com')dnl
define(`confCACERT_PATH', `/')dnl
define(`confCACERT', `ca-bundle.crt')dnl
define(`confSERVER_CERT', `sendmail.pem')dnl
define(`confSERVER_KEY', `sendmail.pem')dnl
define(`confCLIENT_CERT', `sendmail.pem')dnlAfter you do these, do the following:
- make -C /etc/mail (This will regenerate all the files required for sendmail)
- /usr/sbin/service sendmail restart
This completes the setup.
You can test if sendmail is actually sending email by sending one test email as foo@blah.com from your host. Check the /var/log/maillog for any errors.