Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging for Source IP #40

Open
tommairs opened this issue Apr 27, 2023 · 7 comments
Open

Add logging for Source IP #40

tommairs opened this issue Apr 27, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@tommairs
Copy link
Collaborator

We should report on the IP address of the egress source. Currently can report on the name only.

Logging currently includes egress_source. We should be able to report egress_source.name and egress_source.ip

@wez
Copy link
Collaborator

wez commented May 8, 2023

The source address is an optional parameter, and when we add HAProxy support the actual address is controlled by the external proxy and may even map to several addresses.

Does it make sense to log something that may not be there?

@MHillyer
Copy link
Collaborator

MHillyer commented May 8, 2023

Even when the source address is optional, an address will still be used. And can our HAProxy support theoretically query the proxy to find out what IP was used?

This is also potentially something we can look at again when we have external IP detection support. Reporting the actual external IP used.

@wez
Copy link
Collaborator

wez commented May 8, 2023

We know which IP we want to connect to; that is already logged as the peer_address. For the source address: that information is optional and may not be knowable. I'm not sure if HAProxy returns the source address; the protocol looked a bit like SOCKS5 and I don't recall that being able to return configuration information from the proxy to the client.

@wez
Copy link
Collaborator

wez commented May 8, 2023

My opinion on this is: the operator should name the source something meaningful to the log processing pipeline. The name could include the IP address if desired.

@MHillyer
Copy link
Collaborator

MHillyer commented May 8, 2023

So in commercial MTAs that can be an issue because of the challenge in semantic naming, since many admins named their binding/vmta after a client and then had no idea which actual IP address was the problem when viewing logs.

Given that we can assign tenants separate from egress sources it may be fine. I say let's wait to see if there's user-side demand for this instead of anticipating the request.

@edgarsendernet
Copy link

We know which IP we want to connect to; that is already logged as the peer_address. For the source address: that information is optional and may not be knowable. I'm not sure if HAProxy returns the source address; the protocol looked a bit like SOCKS5 and I don't recall that being able to return configuration information from the proxy to the client.

If HAProxy is being used, we can assume that ha_proxy_source_address is the egress IP. HAProxy will return an error if you try to use an egress IP it can't bind to.

@edgarsendernet
Copy link

The source address is an optional parameter, and when we add HAProxy support the actual address is controlled by the external proxy and may even map to several addresses.

Does it make sense to log something that may not be there?

The system already logs stuff that's not there, for example bounce_classification fields in Delivery records :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

4 participants