Saturday, September 20, 2008

Send Mail option in RHEL ES 4.7

  1. Download send mail rpm from rpmfind.net
  2. Install the rpm
  3. Go to /etc/mail, here u will find sendmail related files
  4. Now send the configuration file sendmail.mc to sendmail.cf using m4 (macro processor) after backing up sendmail.mc and sendmail.cf
  5. Mail ] # m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
  6. Mail ] # m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  7. Go to /etc/init.d for newaliases and restart send mail (service sendmail restart)
  8. Change permissions for sendmail.cf (chmod –R 700 sendmail.cf)
  9. Go to tmp (directory) to check if sendmail is running using following command
  10. tmp ] # pgrep sendmail
  11. It should return pid if it is running and return blank if it is not running
  12. To check the interface on which sendmail is listening using the following command
  13. tmp ] # netstat –an grep :25 grep tcp
  14. It should show a list of tcp listeners
  15. Go to /etc/mail/sendmail.mc and modify/edit the file as follows:
    Comment DAEMON_OPTIONS to make sendmail listen to NIC
    Comment “accept_unresolvable_domains” to avoid SPAM
    Comment “relay_based_on_MTI” to avoid mails from other PC’s which are not configured on the domain.
  16. Regenerate the sendmail.cf file as in step 4
  17. Configure the sendmail in /etc/hosts file
    Ipaddress hostname.domainname
    Example: 10.0.0.143 localhost.domainname.com localhost mail www
  18. Now try sending mail as follows
    Tmp ] # sendmail –v ****@domain.com
    Test text
    Test text
    . (dot)
  19. Now we can check the status or errors mail sent in /var/log/maillog
  20. If mail is sent status will be shown as stat=sent if not stat=deffered

No comments: