PDA

View Full Version : Recompile qmail How-To?


DeanW
26th June 2006, 06:43 AM
I need help recompiling qmail...

Plesk 8 qmail patches (http://kb.swsoft.com/attachments/1161/qmail_patches.tar.gz)
Plesk v7.5.4 qmail patches (http://kb.swsoft.com/attachments/1088/qmail_patches.tgz)
qmail 1.03 source (http://cr.yp.to/software/qmail-1.03.tar.gz)

Downloaded all to /usr/src

tar xzf qmail-1.03.tar.gz
tar xzf qmail_patches.tar.gz

As per this article (http://tomclegg.net/qmail-linux) I attempted to add the patches...

cd qmail-1.03
for d in ../qmail-patches/patch*; do patch <"$d"; done

Then compile qmail...

make setup check

I get an error
./chkspawn
Oops. Your system's FD_SET() has a hidden limit of 1024 descriptors.
This means that the qmail daemons could crash if you set the run-time
concurrency higher than 509. So I'm going to insist that the concurrency
limit in conf-spawn be at most 509. Right now it's 1000.
make: *** [spawn.o] Error 1
So I modify conf-spawn to 509 instead of 1000...

make setup check

I get an error
./compile qmail-remote.c
In file included from qmail-remote.c:53:
tls.h:4:25: openssl/ssl.h: No such file or directory
In file included from qmail-remote.c:53:
tls.h:7: error: syntax error before '*' token
tls.h:7: warning: data definition has no type or storage class
tls.h:9: error: syntax error before '*' token
In file included from qmail-remote.c:54:
ssl_timeoutio.h:4:25: openssl/ssl.h: No such file or directory
ssl_timeoutio.h:8:3: #error "Need OpenSSL version at least 0.9.6"
Checked for openssl
rpm -qa | grep openssl
openssl-0.9.7a-35
Of course I have openssl, but apparently need libs from somewhere...

Downloaded openssl source corresponding to my RPM version from here (http://www.openssl.org/source/openssl-0.9.7a.tar.gz).

Created the apparent folder

mkdir openssl

Copied the 'include' files...

cd openssl
cp -L /usr/src/openssl-0.9.7a/include/openssl/* .

And still the same error about not being able to find include files in the openssl dir... I checked the conf-* files and there are no config options for this dir... also it concerns me that the users in conf-users are not the same plesk uses - won't this break things?

Thanks for any direction.

rev606
26th June 2006, 05:49 PM
Try installing the openssl-devel RPM.

DeanW
26th June 2006, 06:32 PM
Thanks for the tip. I did that:

yum install openssl-devel

rpm -qa | grep openssl
openssl-0.9.7a-35
openssl-devel-0.9.7a-35
cd /usr/src/qmail-1.03
make clean

removed my old openssl botched attempt..

rm -rf openssl

make setup check

Still getting an error :(

./load qmail-remote control.o constmap.o timeoutread.o \
timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \
tls.o ssl_timeoutio.o `cat ssl.lib` \
ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \
lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \
str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib`
cat: ssl.lib: No such file or directory
qmail-remote.o(.text+0xac9): In function `tls_init':
...errors continue


find /* -name ssl.lib

...Nothing.. :(

jean-david
10th July 2006, 08:30 AM
I had to add in the qmail-1.0.3 folder a file named
ssl.lib wich contains the following line:
-lssl -lcrypto

Effektor
26th September 2006, 06:30 AM
Still getting errors like above.

./compile idedit.c
idedit.c: In Funktion »main«:
idedit.c:126: Warnung: Rückgabetyp von »main« ist nicht »int«
./load idedit strerr.a substdio.a error.a str.a fs.a \
wait.a open.a seek.a
./compile install-big.c
./compile install.c
install.c: In Funktion »main«:
install.c:277: Warnung: Rückgabetyp von »main« ist nicht »int«
./load install-big fifo.o install.o auto_qmail.o \
auto_split.o auto_uids.o strerr.a substdio.a open.a error.a \
str.a fs.a
./compile hier.c
./load install fifo.o hier.o auto_qmail.o auto_split.o \
auto_uids.o strerr.a substdio.a open.a error.a str.a fs.a
./compile instcheck.c
instcheck.c: In Funktion »main«:
instcheck.c:105: Warnung: Rückgabetyp von »main« ist nicht »int«
./load instcheck fifo.o hier.o auto_qmail.o auto_split.o \
auto_uids.o strerr.a substdio.a error.a str.a fs.a
cat home.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> home
chmod 755 home
cat home+df.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> home+df
chmod 755 home+df
cat proc.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> proc
chmod 755 proc
cat proc+df.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> proc+df
chmod 755 proc+df
cat binm1.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm1
chmod 755 binm1
cat binm1+df.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm1+df
chmod 755 binm1+df
cat binm2.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm2
chmod 755 binm2
cat binm2+df.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm2+df
chmod 755 binm2+df
cat binm3.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm3
chmod 755 binm3
cat binm3+df.sh \
| sed s}QMAIL}"`head -1 conf-qmail`"}g \
> binm3+df
chmod 755 binm3+df
./compile spfquery.c
spfquery.c: In Funktion »main«:
spfquery.c:24: Warnung: Rückgabetyp von »main« ist nicht »int«
./load spfquery spf.o ip.o ipme.o ipalloc.o strsalloc.o \
now.o dns.o datetime.a stralloc.a alloc.a str.a substdio.a \
case.a error.a fs.a `cat dns.lib` `cat socket.lib`

dw604
20th October 2006, 10:51 PM
Finally got it thanks to all of these helpful replies! This is on a PSA7.5.4 FC4 system

- Install openssl-devel

yum install openssl-devel

- Download qmail 1.03 and plesk patches for 8.0 or 7.5.4 (see first post)

- tar xzf from the same folder creating 2 subdirs

- Download additional patch, such as http://qmail.org/outgoingip.patch and put it in the patches folder

- chdir to qmail-1.03

- Do the Plesk patches:

for d in ../qmail-patches/patch*; do patch <"$d"; done

- Do the outgoingip.patch (lazy way)

for d in ../qmail-patches/outgoingip.patch; do patch <"$d"; done

- Edit conf-spawn (I had to make mine 509 or less so I made it 500)

vi conf-spawn

- Create the required SSL file as recommended in post above

echo "-lssl -lcrypto" > ssl.lib

- Compile qmail

make setup check (yes, it will give lots of scary warnings while compiling)

- Config/setup qmail

./config

- At this point I like to modify /var/qmail/control/me to remove the subdomain.

- Echo desired IP to /var/qmail/control/outgoingip

- Reboot or do the following:

kill -HUP `ps auxw | grep xinetd | grep -v grep | awk {'print $2'}`

service qmail restart

That should do it!

---
Hey, check out my email list management script at www.listmailpro.com :)

Yitz
6th June 2007, 01:16 AM
I followed the directions and now my server doesn't accept email altogother it seems that the qmail-smtpd isn't starting. If someone can be of assistance it would be very much appreciated.


Thank You in advance
Yitz

dw604
6th June 2007, 01:30 AM
Try removing Dr.Web and SpamAssassin

for r in `rpm -qa | grep drweb`; do rpm -e $r; done;
for r in `rpm -qa | grep spamas`; do rpm -e $r; done;

Run both twice if there are dependency problems. :)

Yitz
6th June 2007, 01:39 PM
It didn't help. The qmail-smtpd server isn't started but when invoked via the command line it does responed.

dw604
6th June 2007, 05:30 PM
Try recompiling without any additional patches, just the ones expected by Plesk. You did download and apply those, right? :D

Regards

dw604
6th November 2007, 06:09 PM
I've seen some servers with improper file permissions on important /var/qmail/bin files such as qmail-queue. Google should get you the right ones to use.

madcat
2nd April 2008, 09:04 PM
This is a great idea and I'd like to apply it to our servers to stop outgoing spam ... Is there any way to do this using rpmbuild ? Can I even get a copy of the psa-qmail source RPM? I've had troubles in the past caused by installing software that was not RPM built and later yum updating (even if qmail is on the exclude= line).