vmime icon indicating copy to clipboard operation
vmime copied to clipboard

Build problems with sendmail

Open Aeonos opened this issue 8 years ago • 4 comments

I tried to build vmime from source 0.92 on Arch with all the depedencies installed and up to date. When trying to build using: $ cmake -G "Unix Makefiles" /path/to/vmime-source the building process crashes with the error:

Enabling Sendmail protocol requires that you specify path to 'sendmail' binary.

Looking into CMakeLists.txt I found that this error occures, when the variable VMIME_SENDMAIL_PATH is not set or equal to "". Following the build log there were 3 locations where the binary was found /usr/bin/sendmail, /usr/sbin/sendmail, /bin/sendmail

I found that in lines below in CMakeLists.txt VMIME_DEFAULT_SENDMAIL_PATH is set, when a location is found. After checking that, it really was set correctly. BUT ...

FOREACH (SENDMAIL_PATH /usr/sbin/sendmail /usr/lib/sendmail /usr/bin/sendmail /bin/sendmail /var/qmail/bin/qmail-inject /bin/cgimail)
	IF(EXISTS ${SENDMAIL_PATH})
		MESSAGE(STATUS "Sendmail binary found at ${SENDMAIL_PATH}")
		SET(VMIME_DEFAULT_SENDMAIL_PATH ${SENDMAIL_PATH})
	ENDIF()
ENDFOREACH(SENDMAIL_PATH)

a few lines later VMIME_SENDMAIL_PATH is set to VMIME_DEFAULT_SENDMAIL_PATH

SET(
	VMIME_SENDMAIL_PATH
	${VMIME_DEFAULT_SENDMAIL_PATH}
	CACHE STRING
	"Specifies the path to sendmail binary"
)

which does not work out. The variable VMIME_SENDMAIL_PATH never got set! The solution to my problem was to add the FORCE option to set:

SET(
	VMIME_SENDMAIL_PATH
	${VMIME_DEFAULT_SENDMAIL_PATH}
	CACHE STRING
	"Specifies the path to sendmail binary"
        FORCE
)

After that i could build and install vmime 0.92 . I hope that is going to help someone ;-)

Aeonos avatar Dec 14 '16 01:12 Aeonos

Hello!

I don't think there is an issue here, just tested it again this very minute: if you set the -DVMIME_SENDMAIL_PATH=... option on the cmake command line, the value is correctly used.

The value you set on the command line is always used, whether it is empty or not. If it is empty, the error occurs. If you don't set it (ie. undefined, not just empty), the value VMIME_DEFAULT_SENDMAIL_PATH is used by default.

Please give more explanations about the issue, or I will close it as "wontfix". I doubt it, but might it be an issue with your specific platform? Posting the full CMake output could also help.

vincent-richard avatar Jan 03 '17 20:01 vincent-richard

$ ls -l /usr/bin/sendmail
-rwxr-xr-x 1 root root 34760 Apr  5 15:20 /usr/bin/sendmail
CMake Error at third_party/vmime/CMakeLists.txt:1004 (MESSAGE):
  Enabling Sendmail protocol requires that you specify path to 'sendmail'
  binary.

is this repo dead?

luntik2012 avatar Jun 22 '19 09:06 luntik2012

What command line did you use for CMake? What is the output of this command?

vincent-richard avatar Jun 22 '19 11:06 vincent-richard

$ cd /tmp/
$ git clone https://github.com/kisli/vmime
$ cd vmime/
$ mkdir build
$ cd build/
$ cmake ..
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at /usr/share/cmake-3.14/Modules/GenerateExportHeader.cmake:415 (message):
  The add_compiler_export_flags function is obsolete.  Use the
  CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties
  instead.
Call Stack (most recent call first):
  CMakeLists.txt:99 (ADD_COMPILER_EXPORT_FLAGS)


-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Build type: Debug
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for C++ include cstdint
-- Looking for C++ include cstdint - found
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of int64_t
-- Check size of int64_t - failed
-- Check size of size_t
-- Check size of size_t - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.6.1") 
-- Checking for module 'libgsasl'
--   Found libgsasl, version 1.8.0
-- Found GSASL: /usr/lib/libgsasl.so  
-- Found GnuTLS: /usr/lib/libgnutls.so (found version "3.6.8") 
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "1.1.1c")  
-- Looking for gnutls_priority_set_direct
-- Looking for gnutls_priority_set_direct - found
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST - Failed
-- Found Iconv: /usr/lib/libc.so
-- Found ICU: /usr/lib/libicuuc.so  
-- Looking for gmtime_s
-- Looking for gmtime_s - not found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for localtime_s
-- Looking for localtime_s - not found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for strcpy_s
-- Looking for strcpy_s - not found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for gettid
-- Looking for gettid - not found
-- Looking for syscall
-- Looking for syscall - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - found
-- Looking for getthrid
-- Looking for getthrid - not found
-- Looking for SO_KEEPALIVE
-- Looking for SO_KEEPALIVE - found
-- Looking for SO_NOSIGPIPE
-- Looking for SO_NOSIGPIPE - not found
-- Looking for MSG_NOSIGNAL
-- Looking for MSG_NOSIGNAL - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for getaddrinfo_a
-- Looking for getaddrinfo_a - found
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.15") found components:  doxygen dot 
CMake Error at CMakeLists.txt:1004 (MESSAGE):
  Enabling Sendmail protocol requires that you specify path to 'sendmail'
  binary.


-- Configuring incomplete, errors occurred!
See also "/tmp/vmime/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/vmime/build/CMakeFiles/CMakeError.log".

I will not use -DVMIME_SENDMAIL_PATH= because your CMakeLists.txt should detect sendmail in /usr/bin/sendmail:

FOREACH (SENDMAIL_PATH /usr/sbin/sendmail /usr/lib/sendmail /usr/bin/sendmail /bin/sendmail /var/qmail/bin/qmail-inject /bin/cgimail)
	IF(EXISTS ${SENDMAIL_PATH})
		MESSAGE(STATUS "Sendmail binary found at ${SENDMAIL_PATH}")
		SET(VMIME_DEFAULT_SENDMAIL_PATH ${SENDMAIL_PATH})
	ENDIF()
ENDFOREACH(SENDMAIL_PATH)

luntik2012 avatar Jun 25 '19 08:06 luntik2012