0
votes

I am trying to connect to imap.gmail.com on port 993 on googles app engine. I have created an egress (outgoing) firewall rule (VPC) to allow all ip address (0.0.0.0/0) and all ports to all instances yet still my application is blocked.

I receive this error

Type = System.Net.Internals.SocketExceptionFactory+ExtendedSocketException
Message = Network is unreachable [2404:6800:4003:c02::6c]:993
Source = System.Net.Sockets
SocketErrorCode = NetworkUnreachable
ErrorCode = 101
NativeErrorCode = 101
TargetSite = Void DoConnect(System.Net.EndPoint, System.Net.Internals.SocketAddress)
StackTrace =    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
   at MailKit.Net.Imap.ImapClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
   at Parser.Core.Authentication.GetMailClient(Account account) in /home/admin_/emailparser/Parser.Core/Authentication.cs:line 25
HResult = -2147467259

Any idea why this isn't working?

1
Can you add more details on your use case providing the connection flow? Are you using IPv4 or IPv6 for GCE connection? In case of the connection from GAE to GCE will require ingress firewall rule to allow the connection traffic. Default egress firewall rule on GCE allow all egress traffic and default ingress rule deny all ingress connection.N Singh

1 Answers

0
votes

You should not need a firewall rule for App Engine app. According to the following doc - App Engine Go Sockets - imap.gmail.com port 993 should be available.

However, under "Limitations and restrictions" section, it says "Sockets are available only for paid apps". Could it be the case that your app does not have billing enabled?