Saturday, March 7, 2009

Setting up sendmail relay with Airtel India as the ISP

This post is meant for those users who meet these requirements:

  1. You have obtained a static IP address from Airtel India.
  2. You have set up your host correctly - see my previous post.
  3. You plan to host a mailserver on your host with the ip address from step 1.
  4. 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:
  1. use the DSL userid and DSL password that Airtel gave you.
  2. 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.

  1. cd to /etc/mail
  2. 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"
  3. 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')dnl


After 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.

1 comment:

  1. Hi,

    My Airtel fixed landline broadband no is 04442607195.
    from past 20 days it is not working and i have complaint on this 12 days back.still not yet resolved. everytime without fixing the issue they are closing the issue.even I got the full month bill as 1212.
    Per day it will be 40 rupees am paying.
    So I want to disconnect the Broadband and also AIRTEL Digital TV.

    My complaint Reference No:
    47220800
    47282356
    --------

    am sorry to say this.
    Airtel Service is tooooo worst.

    Please tell me the better solution.


    Thanks,
    Samba

    ReplyDelete