|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
|||
|
|||
|
RE: Sendmail
Backup a minute. I am confused? You want to simply dictate who can relay and who can't right?
|
|
#7
|
||||
|
||||
|
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 |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
RE: RE: Sendmail
Quote:
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 |
|
#10
|
|||
|
|||
|
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. |
|
#11
|
||||
|
||||
|
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 |
|
#12
|
|||
|
|||
|
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 |
|
#13
|
||||
|
||||
|
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 |
|
#14
|
|||
|
|||
|
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 |
|
#15
|
||||
|
||||
|
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 |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Sendmail |
| Thread Tools | Search this Thread |