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

Enabling useXForward option causes rejections #147

Closed
qualia-karl opened this issue May 8, 2020 · 3 comments · Fixed by #217
Closed

Enabling useXForward option causes rejections #147

qualia-karl opened this issue May 8, 2020 · 3 comments · Fixed by #217

Comments

@qualia-karl
Copy link

qualia-karl commented May 8, 2020

After adding useXForward: true to server options, we started getting the following error when certain email services send to our server:

C: XFORWARD PROTO=ESMTP HELO=redacted.qualified.domain IDENT=REDACTED SOURCE=REMOTE
XFORWARD HELO name resolved as "0"
S: 250 OK
C: MAIL FROM:<REDACTED> BODY=7BIT
S: 503 Error: send HELO/EHLO first

It looks like this is caused by the following line, where it tries to interpret the HELO as a number, which then later on overrides this.hostNameAppearsAs to a falsey value:

value = Number(value) || 0;

@AgnisLV
Copy link

AgnisLV commented Sep 24, 2021

Having the same issue when trying to use smtp-server as Postfix before-queue proxy filter:

INFO  [#qsv4dn6ryseenowj] Connection from [127.0.0.1]
DEBUG [#qsv4dn6ryseenowj] S: 220 ip-172-31-45-152 ESMTP
DEBUG [#qsv4dn6ryseenowj] C: EHLO test.domain.mx
DEBUG [#qsv4dn6ryseenowj] S: 250-ip-172-31-45-152 Nice to meet you, [127.0.0.1]
DEBUG [#qsv4dn6ryseenowj] 250-8BITMIME
DEBUG [#qsv4dn6ryseenowj] 250-SMTPUTF8
DEBUG [#qsv4dn6ryseenowj] 250-DSN
DEBUG [#qsv4dn6ryseenowj] 250 XFORWARD NAME ADDR PORT PROTO HELO IDENT SOURCE
DEBUG [#qsv4dn6ryseenowj] C: XFORWARD NAME=smtp.somedomain.com ADDR=111.111.111.111 PORT=34892 HELO=smtp.somedomain.com IDENT=[UNAVAILABLE] PROTO=ESMTP SOURCE=REMOTE
INFO  [#qsv4dn6ryseenowj] XFORWARD hostname resolved as "smtp.somedomain.com"
INFO  [#qsv4dn6ryseenowj] XFORWARD from 111.111.111.111 through 127.0.0.1
INFO  [#qsv4dn6ryseenowj] XFORWARD port resolved as "34892"
INFO  [#qsv4dn6ryseenowj] XFORWARD HELO name resolved as "0"
DEBUG [#qsv4dn6ryseenowj] S: 250 OK
DEBUG [#qsv4dn6ryseenowj] C: MAIL FROM:<[email protected]> SIZE=2571
DEBUG [#qsv4dn6ryseenowj] S: 503 Error: send HELO/EHLO first
DEBUG [#qsv4dn6ryseenowj] C: QUIT
DEBUG [#qsv4dn6ryseenowj] S: 221 Bye
INFO  [#qsv4dn6ryseenowj] Connection closed to smtp.somedomain.com

Probably setting that line to this value = (value || '').toLowerCase(); would fix it.

@Liliandev
Copy link

@AgnisLV your line will fix it

@andris9 could you please merge and correct issue ? I think it's a copy/paste issue :) you did copy the line for port

@Liliandev
Copy link

Thanks !

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 a pull request may close this issue.

3 participants