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 TransportDirect transport #153

Merged
merged 1 commit into from
Apr 13, 2024
Merged

add TransportDirect transport #153

merged 1 commit into from
Apr 13, 2024

Conversation

lmeunier
Copy link
Contributor

@lmeunier lmeunier commented Apr 11, 2024

The TransportDirect transport allows to tweak outgoing SMTP connections to remote servers. Currently, it only allows to select network IP family (ipv4, ipv6 or both).

For example, to disable ipv6 for all outgoing SMTP connections:

  • add these lines in mox.conf to create a new transport named "disableipv6":
Transports:
  disableipv6:
    Direct:
      DisableIPv6: true
  • then add these lines in domains.conf to use this transport:
Routes:
  -
    Transport: disableipv6

fix #149

@lmeunier
Copy link
Contributor Author

lmeunier commented Apr 11, 2024

@mjl- this is my second attempt to fix #149. This time by adding a new transport for direct connections as we talked in https://github.com/mjl-/mox/issues/149#issuecomment-2041007381

@mjl-
Copy link
Owner

mjl- commented Apr 11, 2024

nice, this looks like a good solution. i think the other PR is also still useful, right? will have another look there too. i've got a few small comments on this pr, will show up in a moment.

Copy link
Owner

@mjl- mjl- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a nice way to solve the issue. i also saw that using GatherIPs to filter the IPs returns the expected value of dualstack (for the retries around issues with ipv4/ipv6). and gatherips is relatively easy to test. no open/known issues with this, right?

The `TransportDirect` transport allows to tweak outgoing SMTP
connections to remote servers. Currently, it only allows to select
network IP family (ipv4, ipv6 or both).

For example, to disable ipv6 for all outgoing SMTP connections:
- add these lines in mox.conf to create a new transport named
"disableipv6":
```
Transports:
  disableipv6:
    Direct:
      DisableIpv6: true
```
- then add these lines in domains.conf to use this transport:
```
Routes:
  -
    Transport: disableipv6
```

fix #149
@lmeunier
Copy link
Contributor Author

i think the other PR is also still useful, right?

The other PR might still be useful as it works without any configuration, but if both PR are merge I would still prefer to use the transportDirect configuration (for the reasons mentioned on the other PR).

@mjl- mjl- merged commit 73381d2 into mjl-:main Apr 13, 2024
2 checks passed
@mjl-
Copy link
Owner

mjl- commented Apr 13, 2024

merged, thanks! fyi, i ran "make genapidiff" afterwards. the smtpclient.GatherIPs changes the api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remote SMTP server rejects messages because of mismatch between outgoing ipv6 address and reverse hostname
2 participants