Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 21st, 2004, 07:46 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
Sendmail

I've been having a heck of a time trying to install and configure Sendmail on my computer to do what I want. I've been working on this on and off since November and I've read tons of documentation... and while I've learned a lot, there's still a lot that confuses me. Hopefully someone here can help.

I would like a Sendmail installation that sends, receives and relays mail for certain users. For example: I'm at work and want to send mail through my mail server. I have an account and so Sendmail would relay for me. John Q. Public wanted to use my server for sending mail. He has no account, so Sendmail will refuse to relay for him.

I'm running Slackware 9.1 with kernel 2.4.22. I've downloaded the source for Sendmail 8.12.11 and BerkleyDB 4.2. I have access to the O'Reilly Sendmail book (3rd edition).

Here's what I've done so far:
# tar zxvf db-4.2.52
# cd db-4.2.52/build_unix
# ../dist/configure && make && make install
# echo "/usr/local/BerkleyDB.4.2/lib" >> /etc/ld.so.conf; ldconfig
# cd ../../; tar zxvf sendmail.8.12.11.tar.gz
# cd sendmail-8.12.11/sendmail
# ./Build && ./Build install
# cd ../cf/cf

I started with generic-linux.mc but added features. Here's the relavant lines:

divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(`access_db', `dbm -T<TMPF> /etc/mail/access')dnl
FEATURE(`relay_mail_from')dnl
MAILER(local)dnl
MAILER(smtp)dnl

# m4 ../m4/cf.m4 generic-linux.mc > sendmail.cf
# mkdir /etc/mail
# cp sendmail.cf /etc/mail/sendmail.cf
# cat dev/null > /etc/mail/local-host-names
# cat dev/null > /etc/mail/access

Ready for a test...
# /usr/sbin/sendmail -db -q30m
554 5.0.0 /etc/mail/sendmail.cf: line 141: readcf: map access: class dbm not available

Help anyone?

-Tim

Reply With Quote
  #2  
Old February 21st, 2004, 10:25 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Sendmail

Have you tried using hash instead?

Reply With Quote
  #3  
Old February 22nd, 2004, 12:47 AM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

Thank you, Brut.

I followed the link you supplied and it says:
hash/btree requires the compile flag -DNEWDB. This is the new Berkeley DB package.

I think you're right in that hash is what I want since I have the latest version of the DB installed.

So, here's what I've done next:

# cd sendmail-8.12.11/sendmail
# CFLAGS=-DNEWDB ./Build -c
# ./Build install
# cd ../cf/cf

I changed the access_db in generic-linux.mc to read:
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl

# m4 ../m4/cf.m4 generic-linux.mc > sendmail.cf
# cp sendmail.cf /etc/mail/sendmail.cf

I'm ready for a second test:
# /usr/sbin/sendmail -db -q30m
/etc/mail/sendmail.cf: line 141: readcf: map access: class hash not available

I guess then my question is, am I passing -DNEWDB correctly? I can't do ./Build -DNEWDB because Build doesn't recognize it.

-Tim

Reply With Quote
  #4  
Old February 22nd, 2004, 12:53 AM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: Sendmail

This looks like the pertinent section.

Reply With Quote
  #5  
Old February 22nd, 2004, 01:07 AM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

Okay, I again followed the link and read the relevant section. But I'm still uncertain as to how to add the -DNEWDB flag.

Do I create a ifndef entry in conf.h, or do I append -DNEWDB in the Makefile, such as OPTIONS= $(CONFIG) $(FLAGS) -DNEWDB ?

-Tim

Reply With Quote
  #6  
Old February 22nd, 2004, 03:45 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Sendmail

Backup a minute. I am confused? You want to simply dictate who can relay and who can't right?

Reply With Quote
  #7  
Old February 22nd, 2004, 05:46 AM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

Yes, Sendmail should be able to send and receive mail on the local network, but also act as a relay for mail coming from the internet if the mail is sent by a designated user.

-Tim

Reply With Quote
  #8  
Old February 22nd, 2004, 02:26 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Sendmail

I am guessing that this is what you want? Maybe?

in the file "access" (no extention) under your mail directory maybe like /etc/mail/access you can add who you want to allow relay, like this

111.199.17 RELAY
somespammer@yahoo.co.uk REJECT
somedomain.com REJECT

after you made your changes to that file do a

makemap hash /etc/mail/access < /etc/mail/access

this will rebuild your access.db file

If this is not your problem let me know. I can make most of your sendmail problems go away

Reply With Quote
  #9  
Old February 22nd, 2004, 05:54 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: RE: Sendmail

Quote:
I can make most of your sendmail problems go away


Yippie! PostalCow to the rescue!

Here's how things stand now:

I decided to bypass the ldconf bit and reinstall db.

# rm -Rf /usr/lib/BerkeleyDB.4.2
# cd db-4.2.52/build_unix
# make clean; ../dist/configure --prefix=/usr/lib && make && make install

# vi /etc/ld.so.conf
I removed the line I had appended earlier.
# ldconf

Once that order of house keeping was done I went back to Sendmail. The good thing here is that I figured out how to specify -DNEWDB.

# cd ../../sendmail-8.12.11/devtools/M4/
# vi switch.m4

I added: define(`confMAPDEF', `-DNEWDB')dnl

But... here's a new problem:

# cd ../../sendmail
# ./Build -c
conf.o(.text+0x4f3): In function `setupmaps':
: undefined reference to `db_version'
map.o(.text+0x18b6): In function `db_map_open':
: undefined reference to `db_create'
udb.o(.text+0x12b3): In function `_udbx_init':
: undefined reference to `db_create'
collect2: ld returned 1 exit status
make: *** [sendmail] Error 1

What's not linking correctly now?

-Tim

Reply With Quote
  #10  
Old February 22nd, 2004, 07:06 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Sendmail

Another question.

With this line define(`confMAPDEF', `-DNEWDB')dnl You are trying to ad DBM support, correct? Like that from http://www.sleepycat.com/

That DBM support is really designed for HIGH LOAD servers. sendmail already has some dbm support as I mentioned in the above example.


Reply With Quote
  #11  
Old February 22nd, 2004, 07:15 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

The server will certainly not be a high volume mail server. I've gone back to switch.m4 and removed the -DNEWDB define.

# ./Build -c
# ./Build install
# cd /etc/mail
# makemap hash access < access
makemap: Need to recompile with -DNEWDB for hash support

Once again I'm at square-one.

-Tim

Reply With Quote
  #12  
Old February 22nd, 2004, 08:28 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Sendmail

Ok, I am stuck in binarys, My mind is now back to compiling.

Download the berkley DB from sleepycat.com

Do a
../dist/configure
make
make install

Then add the following to site.config.m4
APPENDDEF(`confLIBDIRS', `-L/usr/local/BerkeleyDB.4.1/lib')
APPENDDEF(`confINCDIRS', `-I/usr/local/BerkeleyDB.4.1/include')
APPENDDEF(`confENVDEF', `-DNEWDB')

Now compile Sendmail, switch to the sendmail_source_treedirectory and do a
./Build -c
(the -c tells it there is a change a in site.config.m4)
Then do a
./Build install
(this will install sendmail)

My fingers are crossed

Reply With Quote
  #13  
Old February 22nd, 2004, 09:04 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

I reinstalled the db so the libs go in their default location.

# cd db-4.2.52/build_unix
# ../dist/configure; make; make install

There was no site.config.m4 file so I created it with the APPENDDEF's:

# cd ../../sendmail-8.12.11/devtools/Site
# cat > site.config.m4
APPENDDEF(`confLIBDIRS', `-L/usr/local/BerkeleyDB.4.2/lib')
APPENDDEF(`confINCDIRS', `-I/usr/local/BerkeleyDB.4.2/include')
APPENDDEF(`confENVDEF', `-DNEWDB')
^D

I think we're almost there... Sendmail compiles and installs without errors.

# cd ../../sendmail/
# ./Build -c
# ./Build install

It even starts without errors!

# cat /dev/null > /var/log/maillog
# /usr/sbin/sendmail -db -q30m
# cat /var/log/maillog

Feb 22 16:52:04 gravril sendmail[19575]: starting daemon (8.12.11): queueing@00:30:00

But I still get the -DNEWDB error when I try to use make map:

# makemap hash /etc/mail/access < /etc/mail/access
makemap: Need to recompile with -DNEWDB for hash support

-Tim

Reply With Quote
  #14  
Old February 22nd, 2004, 09:28 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Sendmail

Ok, Do you have these two lines in your sendmail.mc file?


FEATURE(`access_db',`hash -T -o /etc/mail/access.db')
FEATURE(delay_checks)

Oh, and by the way, I said "Most" not all I had to leave myself an out, just in case.

Reply With Quote
  #15  
Old February 22nd, 2004, 10:00 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: Sendmail

My generic-linux.mc contains:

OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`relay_mail_from')dnl
MAILER(local)dnl
MAILER(smtp)dnl

I then process it with m4.
# m4 ../m4/cf.m4 generic-linux.mc > /etc/mail/sendmail.cf

I don't see how that affects the makemap binary, though.

Should I add FEATURE(`delay_checks')?

And should there be a .db after /etc/mail/access in FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl?

-Tim

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Sendmail


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search