Enhancement #2767

Customizable SMTP HELO value

Added by Davide Principi about 7 years ago. Updated almost 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-mail-common
Target version:v6.5
Resolution: NEEDINFO:No

Description

There are some cases where the server hostname does not fit the SMTP HELO value, e.g. hostname is not in public DNS.

Add a HeloHost prop to override the Postifx default.

[ rif Nethesis 2014061110000101 ]

Associated revisions

Revision 807ee755
Added by Davide Principi almost 7 years ago

main.cf: Customizable SMTP HELO value. Refs #2767

Set to empty string to get Postfix default.

History

#1 Updated by Davide Principi about 7 years ago

The commands below set up a custom-template based implementation:

    # config setprop postfix HeloHost mail.cliente.it
    # mkdir -p /etc/e-smith/templates-custom/etc/postfix/main.cf
    # cat - > /etc/e-smith/templates-custom/etc/postfix/main.cf/90custom_helo <<EOF
#
# 90custom_helo (custom template)
# rif 2014061110000101 #2767
#
{ \$postfix{'HeloHost'} ? "" : "# " }smtp_helo_name = { \$postfix{'HeloHost'} }

EOF
     # signal-event nethserver-mail-common-save

#2 Updated by Davide Principi about 7 years ago

  • Description updated (diff)

#3 Updated by Davide Principi almost 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

In branch b2750

#4 Updated by Davide Principi almost 7 years ago

Test case

Here we check the EHLO SMTP command sent by Postfix smtp client process when it talks to other mail servers.

  • Create a transport to the test smtp server:
    mkdir -p /etc/e-smith/templates-custom/etc/postfix/transport
    echo "qa2727.tld smtp:[127.0.0.1]:11025" > /etc/e-smith/templates-custom/etc/postfix/transport/20QA2727
    signal-event nethserver-mail-common-save
    
  • Start smtp-sink SMTP server:
    smtp-sink -q EHLO,HELO -v -u postfix 127.0.0.1:11025 3 &
    
  • Send a message:
    echo "helloworld" | mail -s test someaddress@qa2727.tld
    
    You should see smtp-sink: output on your console:
    smtp-sink: connect (AF_INET 127.0.0.1)
    smtp-sink: vstream_tweak_tcp: TCP_MAXSEG 16384
    smtp-sink: fd=5: stream buffer size old=0 new=32768
    smtp-sink: smtp_stream_setup: maxtime=100 enable_deadline=0
    smtp-sink: EHLO davidep2.vboxnet0.tld
    smtp-sink: disconnect
    
    The message is still on your queue (see mailq output). To send it again flush the queue typing:
    postqueue -f
    
  • Change HeloHost prop value, signal-event nethserver-mail-common-save
  • Check EHLO line changes accordingly when message is sent, repeating the step above

#5 Updated by Davide Principi almost 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Test case

see previous comment

#6 Updated by Davide Principi almost 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-mail-common-1.3.3-1.19git5aeec2c.ns6.noarch.rpm
nethserver-mail-server-1.7.0-1.9git836d38e.ns6.noarch.rpm
nethserver-mail-filter-1.1.6-5.0git2ea5d3e8.ns6.noarch.rpm

#7 Updated by Giacomo Sanchietti almost 7 years ago

  • Assignee set to Giacomo Sanchietti

#8 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Before setting custom HELO:

smtp-sink: connect (AF_INET 127.0.0.1)
smtp-sink: vstream_tweak_tcp: TCP_MAXSEG 16384
smtp-sink: fd=5: stream buffer size old=0 new=32768
smtp-sink: smtp_stream_setup: maxtime=100 enable_deadline=0
smtp-sink: EHLO testserver.mydomain.loc
smtp-sink: disconnect

Setting the new HELO and try again:

[root@testserver ~]# config setprop postfix HeloHost qa2727.tld
[root@testserver ~]# signal-event nethserver-mail-common-save

smtp-sink: connect (AF_INET 127.0.0.1)
smtp-sink: vstream_tweak_tcp: TCP_MAXSEG 16384
smtp-sink: fd=5: stream buffer size old=0 new=32768
smtp-sink: smtp_stream_setup: maxtime=100 enable_deadline=0
smtp-sink: EHLO qa2727.tld
smtp-sink: disconnect

Note: remember to update manual when releasing.

#9 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-mail-server-1.8.0-1.ns6.noarch.rpm
  • nethserver-mail-common-1.4.0-1.ns6.noarch.rpm
  • nethserver-mail-filter-1.2.0-1.ns6.noarch.rpm
New documentation:

Also available in: Atom PDF