Pages

Friday, 6 July 2012

set up sendmail server in AIX

Here is how I have set up sendmail to a notes server - it takes you step by step:

Ensure that ‘sendmail’ is running on the system:

    Run both commands:

    lssrc –s sendmail

    ps –ef |grep sendmail

- If ‘sendmail’ is not running start via:

startsrc -s sendmail -a "-bd -q30m"

- Ensure that ‘sendmail’ is running:

ps –ef |grep sendmail

This should echo:

root  5704     1   0 11:08:42      -  0:00 sendmail: accepting connections on port 25

- Ensure that the ‘sendmail’ daemon is started on reboot, comment in the ‘sendmail’ startup line in ‘/etc/rc.tcpip’

vi /etc/rc.tcpip

Comment in the following line:

start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"

- Create an ‘/etc/netsvc.conf’ file, this is to tell sendmail to use ‘/etc/hosts’ for name resolution not DNS (default):

vi /etc/netsvc.conf

Add the following:

hosts=local,bind4

- Change the permissions on the ‘/etc/netsvc.conf’ file to lock down root only access:

chmod 600 /etc/netsvc.conf

- Add into the ‘/etc/hosts’ file the IP address and hostname of the Lotus Notes server. If you wish to check the hostname of the server use telnet to connect to port 25 of the server:

telnet <IP address of Lotus Notes server> 25

N.B. Type: quit to close the session

Add the IP and hostname into ‘/etc/hosts’:

vi /etc/hosts

-    Copy away the original ‘/etc/sendmail.cf’ file

cp /etc/sendmail.cf /etc/sendmail.cf.orig

- Edit the ‘/etc/sendmail.cf’ and make the following changes:

Vi /etc/sendmail.cf

Change:

#DwYourHostName

To:

Dw<hostname of local server>

Change:

# "Smart" relay host (may be null)
# Relay host to forward outgoing mail not in the local domain to.
# To forward ALL mail to this relay host, uncomment the appropriate
# rule in ruleset 0, as indicated by the ruleset's comments.
#DSmailer:relayhostname
DS

To:

# "Smart" relay host (may be null)
# Relay host to forward outgoing mail not in the local domain to.
# To forward ALL mail to this relay host, uncomment the appropriate
# rule in ruleset 0, as indicated by the ruleset's comments.
#DSmailer:relayhostname
DS<hostname of Lotus Notes Server>
    
Save the file.
 
- Refresh the ‘sendmail’ daemon to pick up the new changes to the ‘/etc/sendmail.cf’ file

refresh –s sendmail

It will take a few minutes for the ‘ps’ process to return:

root  5704     1   0 11:08:42      -  0:00 sendmail: accepting connections on port 25

    In the interim period the following will be displayed via ‘ps’:
    
root  5704     1   0 11:08:42      -  0:00 /usr/lib/sendmail –bd –q30

-    If there is only one recipient per mail the configuration is complete, test via:

echo “test” |sendmail –v <email address of recipient>

i.e.

echo “test” |sendmail –v paulsharpe-deacon@hsbc.com

N.B. Any non local mail is sent to the relayhost i.e. the notes server for processing.

- If there is more than one recipient per mail, configure a ‘sendmail’ alias:

-    Configure the ‘/etc/aliases’ file with the e-mail addresses of all recipients of the e-mail:

vi /etc/aliases

TEST:paul@hsbc.com,steve@hsbc.com

- Get the ‘sendmail’ daemon to re-read the ‘/etc/aliases’ file:

sendmail –bi  

- Now test the handshaking between the server and the Lotus Notes server:

echo “test” |sendmail –v <alias name>@<hostname of local machine>

i.e.

echo “test” |sendmail –v TEST@notesserver

No comments:

Post a Comment

Twitter Bird Gadget