haraka / Haraka

A fast, highly extensible, and event driven SMTP server

Home Page:https://haraka.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom tx.notes.outbound_helo not working

analogic opened this issue · comments

It took me a while to find this bug. Outbound IP works fine, but HELO/EHLO does not

There is this code:

Haraka/outbound/hmail.js

Lines 296 to 303 in f4cc2a6

if (!mx.bind_helo){
if (this.todo.notes.outbound_helo) {
mx.bind_helo = this.todo.notes.outbound_helo;
}
else {
mx.bind_helo = net_utils.get_primary_host_name();
}
}

But as bind_helo is already set here
https://github.com/haraka/haraka-net-utils/blob/577087b08c770919c2477378162f9971ab454295/lib/HarakaMx.js#L28-L32

there is no way to set up a custom EHLO.

there is no way to set up a custom EHLO.

Aren't you able to set bind_helo in get_mx? Isn't that what the docs are saying to do? What is the use case for setting it in a transaction note? See #2911 for related background.

Thinking out loud: I may not have completely fixed #2911 yet. If mx.bind is set, it's probably necessary in try_delivery to check the IP family of the mx.bind value and the IP family of mx.exchange. If they aren't the same, log a skip message and try the next MX.

  • yes, bind_helo can be set in get_mx, but if you need to set helo and/or outbound ip and do not want to duplicate the default workflow for finding mx, then notes are the way to go.
  • Setting custom outbound ip and setting helo accordingly sounds to me like the right thing to do if ip-domain is paired (actually this feature is not from my head).
  • I set these two things based on source (e.g. user account) not destination - it's been too long since I implemented it so I can't tell you the right reason, but I think it might have something to do with dedicated outbound IP per customer (domain).

(I admit it's kind of against recommendation, but hey, it works and I'm also testing it automatically, so no harm if it stops working and I have to go the "get_mx" way)

#3363 Fix this, thanks!