Following are the steps to configure sendmail on aws linux.

Razi Abuzar's picture

1.

yum install sendmail sendmail-cf m4

2.

vi /etc/mail/local-host-names

Enter:

localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY

3.

vi /etc/mail/access

It is to check if it has following entry

Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY

3. Now run

makemap hash /etc/mail/access.db < /etc/mail/access

4. Now create backups for critical files:

mkdir /etc/mail/backups
cp /etc/mail/sendmail.* /etc/mail/backups

5.

vi /etc/mail/sendmail.mc

remove dnl from beginning and end of DEAMON_OPTIONS
6. now run

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

and restart sendmail service

7.

vi /etc/sysconfig/network

add the mx recored as below

HOSTNAME=aspmx.l.google.com.

8.

service sendmail restart

9. now edit the sendmail.mc as below

vi /etc/mail/sendmail.mc

remove dnl from pre an post the line : MASQUERADE_AS(eraazi.com)

and the same MASQUERADE_DOMAIN(eraazi.com)

10. Again Run

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

11. Now restart sendmail service

service sendmail restart

12. Make sure:

service postfix stop
service iptables stop

13. To test create email.txt
Content of it is:

To:youremail@emaildomain.com
From:yourname@eraazi.com

Subject: Something
Oh its working.

Tags: 

0 points
up
down