Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d150b302 authored by Jan Hilberath's avatar Jan Hilberath
Browse files

fix(smtp): use "ehlo.thunderbird.net" as EHLO hostname

parent 7e0de746
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import java.io.BufferedInputStream
import java.io.BufferedOutputStream
import java.io.IOException
import java.io.OutputStream
import java.net.Inet6Address
import java.net.InetAddress
import java.net.InetSocketAddress
import java.net.Socket
@@ -100,7 +99,10 @@ class SmtpTransport(

            readGreeting()

            val helloName = buildHostnameToReport()
            // We use "ehlo.thunderbird.net" for privacy reasons,
            // see https://ehlo.thunderbird.net/
            val helloName = "ehlo.thunderbird.net"

            var extensions = sendHello(helloName)

            is8bitEncodingAllowed = extensions.containsKey("8BITMIME")
@@ -259,18 +261,6 @@ class SmtpTransport(
        }
    }

    private fun buildHostnameToReport(): String {
        val localAddress = socket!!.localAddress

        // We use local IP statically for privacy reasons,
        // see https://github.com/thunderbird/thunderbird-android/pull/3798
        return if (localAddress is Inet6Address) {
            "[IPv6:::1]"
        } else {
            "[127.0.0.1]"
        }
    }

    private fun parseOptionalSizeValue(sizeParameters: List<String>?) {
        if (sizeParameters != null && sizeParameters.isNotEmpty()) {
            val sizeParameter = sizeParameters.first()