Mailing List Archive

Compiling Exim 4.94 with SPF on Ubuntu
I am attempting to add SPF to an Ubuntu 18.04 Exim installation (compiled from source, not the Ubuntu package), but Exim compilation fails:

cc -DMACRO_PREDEF macro_predef.c
In file included from exim.h:494:0,
from macro_predef.c:12:
spf.h:17:10: fatal error: spf2/spf.h: No such file or directory
#include <spf2/spf.h>
^~~~~~~~~~~~
compilation terminated.

I have this in Local/Makefile:

SUPPORT_SPF=yes
CFLAGS += -I/usr/include
LDFLAGS += -l/usr/lib/spf2

Ubuntu has libspf2 installed (in /usr/lib) but this does not include spf.h

I have tried compiling libspf2-1.2.10 from source but this fails with several errors, finally:

Makefile:228: recipe for target 'all' failed
make: *** [all] Error 2

(It looks like libspf2 is now quite old (2010?) and links to their support forums are dead.)

There is spf.h at exim-4.94/build-Linux-x86_64/spf.h. Can I use this and if so where should it go?

Chris
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Compiling Exim 4.94 with SPF on Ubuntu [ In reply to ]
On Fri, 9 Oct 2020, Chris Bunch via Exim-users wrote:

> I am attempting to add SPF to an Ubuntu 18.04 Exim installation (compiled from source, not the Ubuntu package), but Exim compilation fails:
>
> cc -DMACRO_PREDEF macro_predef.c
> In file included from exim.h:494:0,
> from macro_predef.c:12:
> spf.h:17:10: fatal error: spf2/spf.h: No such file or directory
> #include <spf2/spf.h>
> ^~~~~~~~~~~~
> compilation terminated.
>
> I have this in Local/Makefile:
>
> SUPPORT_SPF=yes
> CFLAGS += -I/usr/include
> LDFLAGS += -l/usr/lib/spf2
>
> Ubuntu has libspf2 installed (in /usr/lib) but this does not include spf.h

Do you have the development package
libspf2-dev
as well as
libspf2-2
?


> I have tried compiling libspf2-1.2.10 from source but this fails with several errors, finally:
>
> Makefile:228: recipe for target 'all' failed
> make: *** [all] Error 2
>
> (It looks like libspf2 is now quite old (2010?) and links to their support forums are dead.)
>
> There is spf.h at exim-4.94/build-Linux-x86_64/spf.h. Can I use this and if so where should it go?

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Compiling Exim 4.94 with SPF on Ubuntu [ In reply to ]
> On 9 Oct 2020, at 15:24, Andrew C Aitchison <andrew@aitchison.me.uk> wrote:
>
> On Fri, 9 Oct 2020, Chris Bunch wrote:
>
>>> On 9 Oct 2020, at 13:43, Andrew C Aitchison <andrew@aitchison.me.uk> wrote:
>>>
>>> On Fri, 9 Oct 2020, Chris Bunch via Exim-users wrote:
>>>
>>>> I am attempting to add SPF to an Ubuntu 18.04 Exim installation (compiled from source, not the Ubuntu package), but Exim compilation fails:
>>>>
>>>> cc -DMACRO_PREDEF macro_predef.c
>>>> In file included from exim.h:494:0,
>>>> from macro_predef.c:12:
>>>> spf.h:17:10: fatal error: spf2/spf.h: No such file or directory
>>>> #include <spf2/spf.h>
>>>> ^~~~~~~~~~~~
>>>> compilation terminated.
>>>>
>>>> I have this in Local/Makefile:
>>>>
>>>> SUPPORT_SPF=yes
>>>> CFLAGS += -I/usr/include
>>>> LDFLAGS += -l/usr/lib/spf2
>>>>
>>>> Ubuntu has libspf2 installed (in /usr/lib) but this does not include spf.h
>>>
>>> Do you have the development package
>>> libspf2-dev
>>> as well as
>>> libspf2-2
>>> ?
>
>> Thank you: no I didn’t. Installed now and that sorted the spf.h issue. However, make is now failing with:
>>
>> /usr/bin/ld: cannot find -l/usr/lib/libspf2
>>
>> In /usr/lib I had:
>>
>> -rw-r--r-- 1 root root 219100 Jul 26 2017 spf2.a
>> lrwxrwxrwx 1 root root 16 Jul 26 2017 spf2.so -> libspf2.so.2.1.0
>> lrwxrwxrwx 1 root root 16 Jul 26 2017 spf2.so.2 -> libspf2.so.2.1.0
>> -rw-r--r-- 1 root root 117488 Jul 26 2017 spf2.so.2.1.0
>>
>> but changing to LDFLAGS += -l/usr/lib/libspf2 in Makefile did not fix it.
>
> Does
> LDFLAGS += -L /usr/lib/libspf2
> (capital L) help ?
> Though you shouldn't need that line at all now,
> since the librariess are in /usr/lib
>
> --
> Andrew C. Aitchison Kendal, UK
> andrew@aitchison.me.uk

Thanks again. Yes capital L allows spf.c to go through (as does commenting that line out) but it now fails at cc exim.c:
...
cc spf.c
cc srs.c
cc utf8.c
cc version.c
cc -o exim
//usr/bin/ld: spf.o: undefined reference to symbol 'SPF_server_set_rec_dom'
//usr/lib/libspf2.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

It’s not clear to me if this is an EXIM config issue or an error in spf2.so.2 (libspf2.so.2.1.0)

Chris


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Compiling Exim 4.94 with SPF on Ubuntu [ In reply to ]
Have you tried

LDFLAGS += -lspf2

This is what the sample Makefile recommends.

--
Ian

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Compiling Exim 4.94 with SPF on Ubuntu [ In reply to ]
On Fri, 9 Oct 2020, Ian Zimmerman via Exim-users wrote:

> Have you tried
>
> LDFLAGS += -lspf2
>
> This is what the sample Makefile recommends.

... and remember to rerun
make makefile
before
make


--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Compiling Exim 4.94 with SPF on Ubuntu [ In reply to ]
> On 9 Oct 2020, at 19:35, Andrew C Aitchison via Exim-users <exim-users@exim.org> wrote:
>
> On Fri, 9 Oct 2020, Ian Zimmerman via Exim-users wrote:
>
>> Have you tried
>>
>> LDFLAGS += -lspf2
>>
>> This is what the sample Makefile recommends.
>
> ... and remember to rerun
> make makefile
> before
> make
>
>
> --
> Andrew C. Aitchison Kendal, UK
> andrew@aitchison.me.uk
>
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/

Thanks again. Still the same error but I came across this <https://lists.archive.carbon60.com/exim/users/110074> . One of the commenters suggested ‘make distclean; make’, and that fixed it.

Now to configure it - and DMARC, which was the starting point of the exercise for me.

Chris
________________________





--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/