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!

Building, Compiling, M4 Sendmail

Status
Not open for further replies.

sproosy

IS-IT--Management
Oct 31, 2002
94
AU
OK I have just downloaded the newest version of sendmail.
I performed a ./Build
Now i need to add a few m4 features to a MC file to make my sendmail.cf file.
How do i add the features, and then create the sendmail.cf file. Hwere are all of these OS Specific files kept. I have read some documentation on the web and its given me bits of info here and there but not the full idea of what to do???

Please help!? Thanks Sproosy MCP

Keep it real!
 
You should have a /etc/mail/sendmail.mc. If not look in /usr/share/sendmail-cf/cf and look for a .mc file that looks like it is for your system. If not, choose a generic one and copy it to /etc/mail/sendmail.mc. It doesn't have to be called sendmail.mc but it helps to explain things if I do it that way. Open it up in a text editor and do your thing. For some help with this, look at /usr/share/sendmail-cf/README. When you are done, you need to compile it to create sendmail.cf. Use the following command:

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

Some distros have sendmail.cf in /etc/ so your paths may be different from what I have here.
 
Nice! Ok next i want the server to be able to que mail for users so they can log in remotly with a mail client and receive their mail, also make the server relay any non internal mail to the outside world and masquerade. What m4 Features do i need to add to the mc file?

thanks dudes! Sproosy MCP

Keep it real!
 
FEATURE(`relay_local_from')dnl

Note: the mark just before the word "relay" is the back tick under the ~, not the one under ".

Open /etc/access (/etc/mail/access on some systems).

You will see something like this:

127.0.0.1 Relay
localhost Relay

Add your domain to the list:

yourdomain.com Relay

Now you need to create access.db

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

Most distros come with a pop3 server. It will be called pop3d or something. It runs as a daemon so you'll need to make sure xinet.d starts at bootup also.

I am assuming you have DNS setup for mail. If not you need to create an &quot;A&quot; record for mail.yourdomain.com and point it to your ip. Then you need to create an &quot;MX&quot; record for it showing mail.yourdomain.com handles the mail for yourdomain.com. That's it. Now your users can setup an account in OutLook or other mail client. They would use mail.yourdomain.com for both the pop3 and smtp servers. They would use the same user name and password that exists on your system.

 
Dude i understand the steps you have told me to do but there is no /etc/mail/access

if i create the directorys/files will it work??

Cheers! Sproosy MCP

Keep it real!
 
Take a peek inside sendmail.mc and look for a line that starts with FEATURE(`access_db'... This will tell you the path where sendmail looks for access.db. If it's there, then create access in that directory. Some distros have it in /etc/.
 
the mc file that i made doesnt have that line in it. If i just add it to the .mc file, recompile and create the files will it be ok?

Thanks heaps! Sproosy MCP

Keep it real!
 
Here is a copy of my sendmail.mc. All my users can send and receive mail remotely through my server. You can copy and paste the whole thing or just use the lines that are missing on yours. Good luck.


divert(-1)
dnl This is the sendmail macro config file. If you make changes to this file,
dnl you need the sendmail-cf rpm installed and then have to generate a
dnl new /etc/mail/sendmail.cf by running the following command:
dnl
dnl m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
OSTYPE(`linux')
dnl Uncomment and edit the following line if your mail needs to be sent out
dnl through an external mail server:
dnl define(`SMART_HOST',`smtp.your.provider')
define(`confDEF_USER_ID',``8:12'')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl The '-t' option will retry delivery if e.g. the user runs over his quota.
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`relay_local_from')dnl
EXPOSED_USER(`root')dnl
dnl This changes sendmail to only listen on the loopback device 127.0.0.1
dnl and not on any other network devices. Comment this out if you want
dnl to accept email over the network.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=192.168.0.100, Name=MTA')
dnl NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl a kernel patch
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not have 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
Cwlocalhost.localdomain


 
thanks dude ill let you know how i go!!! Sproosy MCP

Keep it real!
 
Ok one last question do you also use this server to relay any non-local mail onto the www? Sproosy MCP

Keep it real!
 
Yes - that's what relaying is. It allows mail to pass through your server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top