Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configuring sendmail

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can any one help me exact process how to configure sendmail on linux 7.2.
 
U have two cases here:
1. Compiling a new sendmail and installing it
2. Configuring existing sendmail.cf on ur linux machine for ur purpose..
I will explain both the scenarios:)
1. Compiling a new sendmail and installing:)

Following are the prerequisites needed for deploying Sendmail 8.x.x

 Sendmail 8.x.x Source code
 C Compiler
 M4 Preprocessor

Compiling and Installing:
Note : I am assuming that u r installing a newer version of sendmail, lets say, 8.11.6

1. Login to the Solaris Server with administrative (root) privileges.

2. Download the Sendmail 8.11.6 Source code in zipped format from ftp.//Sendmail.org


3. The downloaded file will be in .tar.gz form. Extract the source code from this file by using following commands:

# gunzip sendmail-8.11.6.tar.gz
# tar –xvf sendmail-8.11.6.tar

4. This creates a directory by name “sendmail-8.11.6” in the present working directory. This is the source code of sendmail.

5. Change the current directory to sendmail source code directory

# cd sendmail-8.11.6

6. Change to the configuration files directory in the sendmail directory by using following command:

# Cd cf/cf/

7. This directory holds the files having extention .mc. These files contain the configurations for individual platforms. Locate the file named with your specific OS platform and create its copy as config.mc file by using following command

# cp "your-machine-specific".mc config.mc.


8. Now modify the contents of the config.mc file by using vi editor to look like this.

divert(0)dnl
VERSIONID(`$Id: "Your-platform-specific-mc-file".mc,v 8.11 1999/02/07 \ 07:26:03 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(your-domain-name)dnl
MASQUERADE_AS(‘your-domain-name')
FEATURE(relay_hosts_only)
FEATURE(smrsh)
MAILER(local)dnl
MAILER(smtp)dnl

Save and close this file now.

9. Build the configuration file by using following command in the present working directory:

# sh Build config.cf

This command will create a configuration file named config.cf in your working directory. This file will be used as the sendmail configuration file in the sendmail 8.11.6 version being installed.

10. Now, make an archive of the earlier sendmail version by using following commands:

# cd /usr/lib/mail/
# tar –cvf sendmail893.tar
# cd /etc/mail/
# tar –cvf sendmail893-conf.tar
# cd /usr/sbin/
# tar –cvf sendmail893-commands.tar

Move the above archived tar files to a safe location from where they could be accessed easily. These will be used in case it is required to rollback to the existing sendmail version .

11. Stop the sendmail programe now by using following command at the prompt:

# /etc/init.d/sendmail stop

Confirm that Sendmail program has been stopped by using following command:

# ps –ef | grep sendmail

The above command should not show any sendmail instance running.

Change to the Sendmail 8.11.6 source code directory again.

12. Install the config.cf in the cf/cf/ directory to the /etc/mail/ directory

# cd cf/cf/
# cp config.cf /etc/mail/sendmail.cf
# cd ../..

13. Confirm that you are in Sendmail source code directory (sendmail-8.11.6). Now change your working directory to sendmail directory in the source code:

# cd sendmail

14. Now build and install the new Sendmail 8.11.6 by using following command:

# sh Build install

This will build and install the Sendmail 8.11.6 in your system.

15. Now change your working directory to /etc/mail/

# cd /etc/mail/

16. Create two file by the names “local-host-names” and “relay-domains”

# touch relay-domains
# touch local-host-names

Open the relay-domains file and add the FQDN’s (Fully Qualified Domain Names) of the hosts which will be allowed to relay through your server. Save this file and exit from the editor.
Leave the file local-host-names as blank.

17. Open the file sendmail.cf and change the following lines as below:
 Under the line :- #Dj$w.Foo.COM, add the line:- Dj$w.ipanet.net
 Change the line O LogLevel=9 to look like O LogLevel=1
 Uncomment the following line in the file:
#O TrustedUser=root

18. Start the Sendmail program by using following command:

# /etc/init.d/sendmail start

19. This will start the Sendmail 8.11.6 version. Sendmail will now send the messages in the mail queue located in /var/spool/mqueue to the internet mail users.

Note: The folder paths i have mentioned may differ on your OS.. U need to locate those exactly...
-------------------------------

If you want to configure existing sendmail on your linux, here is the procedure:
Open the file sendmail.cf and change the following lines as below:
 Under the line :- #Dj$w.Foo.COM, add the line:- Dj$w.YOUR_DOMAIN_NAME
 Change the line O LogLevel=9 to look like O LogLevel=1 (if reqd!!!)
 Uncomment the following line in the file:
#O TrustedUser=root

Save the sendmail.cf file and quit the editor.

Start the Sendmail program by using following command:

# /etc/init.d/sendmail start
This starts the sendmail on your machine and you should be able to send mails with sendmail..

Note: The folder paths i have mentioned may differ on your OS.. U need to locate those exactly...

All the best!!

Regds,

Hemant


- Hemant
 
hi!!!!

i ve got the following problem :

how can i do in order that sendmail doesn't take as a suffix for the local
email addresses (in the field TO) the name of the station in the domain
that means <station><location><domain>
I want to use a shorter one : <domain>

thanks
regards
tom

 
hi!!!!

i ve got the following problem :

how can i do in order that sendmail doesn't take as a suffix for the local
email addresses (in the field TO) the name of the station in the domain
that means <station><location><domain>
I want to use a shorter one : <domain>

thanks
regards
tom

 
hi!!!!

i ve got the following problem :

how can i do in order that sendmail doesn't take as a suffix for the local
email addresses (in the field TO) the name of the station in the domain
that means <station><location><domain>
I want to use a shorter one : <domain>

thanks
regards
tom

 
U need to define aliases for ur lical user names in this case..

Regds,

- Hemant
 
Sorry; Just a spelling correction in my earlier post:)

Read it as:)
&quot;U need to define aliases for ur local user names in this case..&quot;

Sorry 4 the inconvenience!

Regds, - Hemant
 
>Under the line :- #Dj$w.Foo.COM, add the
>line:- Dj$w.YOUR_DOMAIN_NAME

What shall the domain name be? Can I put localhost, since I do not have a domainname like <something>.<domain>.com

 
If u are trying to send and recieve mails with ur sendmail server, then definitely u need to have a domain name (something like mydomain.com or org or edu...) HAv this domain name registered in ur ISP's DNS.. Use domainname command to set the domain name of ur server. Also, see that the host entry in /etc/hosts file is a fully qualified machine name (like mymachine.mydomain.com)..


Hope this solves ur query..

Regds,

- Hemant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top