Accessing an SMTP server when istio is enabled

9/13/2021

getting error curl: (56) response reading failed while trying to send email via smtp using curl. checked the isto-proxy logs of sidecar but don't see any error logs related to this host. Tried the solution mentioned in https://stackoverflow.com/questions/55627595/how-to-access-external-smtp-server-from-within-kubernetes-cluster-with-istio-ser as well but didn't work.

service entry

apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
  name: smtp
spec:
  addresses:
  - 192.168.8.45/32
  hosts:
  - smtp.example.com"
  location: MESH_EXTERNAL
  ports:
    - name: tcp-smtp
      number: 2255
      protocol: TCP
-- Sai Teja Pakalapati
amazon-eks
google-kubernetes-engine
istio
kubernetes

2 Answers

9/14/2021

Most probably port number is causing the error and if not, try deleting the mesh policies

Also please validate based on below points:

1.If you recently updated istio try downgrading it. 2.Look again in Sidecar logs for any conflicts or try disabling it. 3.When it comes to curl 56 error packet transmission; limit could be the problem.

-- Abhijith Chitrapu
Source: StackOverflow

9/16/2021

The curl requests from primary container are routed via sidecar when istio is enabled, the response from smtp server is being masqueraded by sidecar and returned to primary container, which was quite misleading.

upon disabling Istio and trying to do curl on smtp port curl request failed with error Failed to connect to smtp.example.com port 2255: Operation timed out. which was because firewall from cluster to smtp server port was not open.

while istio was enabled the curl response didn't give timeout error but gave curl: (56) response reading failed which mislead me to think that the response was coming from smtp server.

-- Sai Teja Pakalapati
Source: StackOverflow