mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Build the mail proxies and FTP only when they are asked for
pop3p, imapp and smtpp are built with MAILPROXY=true, and ftppr and the ftp:// scheme of the HTTP proxy with FTP=true; with CMake the switches are 3PROXY_USE_MAILPROXY and 3PROXY_USE_FTP. Neither is in a default build, and the standalone binaries follow what was built. A configuration naming one of them is still read either way. The three mail protocols amount to a STARTTLS negotiation now that mail is carried over TLS, so without a proxy of their own those names are tlspr speaking the protocol: the file holds a stand-in which sets the protocol for the connection and returns tlspr for the caller to run, which serves the service name and a parent chain alike and leaves conf.c and the redirect table untouched. FTP has no such fallback, so the service is known, answers nothing and logs the refusal. The Linux workflow builds both, so all of it is still compiled and run.
This commit is contained in:
1 parent
83139bc2e8
commit
6c4663a045
17 files changed
+171
-11
No files matched your search
+26
-4
@@ -70,6 +70,8 @@ option(3PROXY_USE_NETFILTER "Enable Linux netfilter support (Linux only)" ON)
|
||||
option(3PROXY_USE_TRANSPARENT "Build transparent proxying support (Linux and BSD only)" ON)
|
||||
option(3PROXY_USE_UNIX_SOCKETS "Enable Unix domain socket support (Unix only)" ON)
|
||||
option(3PROXY_USE_HTTPSRV "Build the HTTP server and the admin interface on top of it" ON)
|
||||
option(3PROXY_USE_MAILPROXY "Build the pop3p, imapp and smtpp proxies" OFF)
|
||||
option(3PROXY_USE_FTP "Build FTP support: the ftppr service and ftp:// in the HTTP proxy" OFF)
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
option(3PROXY_STATIC_LINK "Statically link libraries using -Wl,-Bstatic (Linux/Unix only)" OFF)
|
||||
@@ -83,10 +85,13 @@ set(3PROXY_BINARY_PREFIX "3proxy_" CACHE STRING "Prefix for standalone module an
|
||||
option(3PROXY_BUILD_NONE "Do not build standalone binaries" OFF)
|
||||
option(3PROXY_BUILD_PROXY "Build standalone proxy binary" ON)
|
||||
option(3PROXY_BUILD_SOCKS "Build standalone socks binary" ON)
|
||||
option(3PROXY_BUILD_POP3P "Build standalone pop3p binary" ON)
|
||||
option(3PROXY_BUILD_IMAPP "Build standalone imapp binary" ON)
|
||||
option(3PROXY_BUILD_SMTPP "Build standalone smtpp binary" ON)
|
||||
option(3PROXY_BUILD_FTPPR "Build standalone ftppr binary" ON)
|
||||
# The mail proxies and FTP are asked for rather than assumed: without them
|
||||
# pop3p, imapp and smtpp are the STARTTLS proxy under those names, and ftp
|
||||
# is not spoken at all. A standalone binary needs the support it is made of.
|
||||
option(3PROXY_BUILD_POP3P "Build standalone pop3p binary" OFF)
|
||||
option(3PROXY_BUILD_IMAPP "Build standalone imapp binary" OFF)
|
||||
option(3PROXY_BUILD_SMTPP "Build standalone smtpp binary" OFF)
|
||||
option(3PROXY_BUILD_FTPPR "Build standalone ftppr binary" OFF)
|
||||
option(3PROXY_BUILD_TCPPM "Build standalone tcppm binary" ON)
|
||||
option(3PROXY_BUILD_UDPPM "Build standalone udppm binary" ON)
|
||||
option(3PROXY_BUILD_TLSPR "Build standalone tlspr binary" ON)
|
||||
@@ -250,6 +255,14 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(3PROXY_USE_MAILPROXY)
|
||||
add_compile_definitions(WITH_POP3P WITH_IMAPP WITH_SMTPP)
|
||||
endif()
|
||||
|
||||
if(3PROXY_USE_FTP)
|
||||
add_compile_definitions(WITH_FTP)
|
||||
endif()
|
||||
|
||||
if(3PROXY_USE_HTTPSRV)
|
||||
add_compile_definitions(WITH_HTTPSRV)
|
||||
endif()
|
||||
@@ -684,6 +697,15 @@ foreach(PROXY_NAME proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# A binary of nothing: without the support built, these files hold the
|
||||
# stand-in the main binary uses and no service of their own.
|
||||
if(NOT 3PROXY_USE_MAILPROXY AND PROXY_NAME MATCHES "^(pop3p|imapp|smtpp)$")
|
||||
continue()
|
||||
endif()
|
||||
if(NOT 3PROXY_USE_FTP AND PROXY_NAME STREQUAL "ftppr")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
if(PROXY_NAME STREQUAL "ftppr" OR PROXY_NAME STREQUAL "proxy")
|
||||
# ftppr and proxy use ftp_obj
|
||||
add_executable(${PROXY_NAME}
|
||||
|
||||
Reference in new issue
Block a user