ClearFoundation Tracker - ClearOS
View Issue Details
0000241ClearOSapp-smtp - SMTP Serverpublic2011-02-26 22:362019-03-12 10:24
maeztro 
 
normalminoralways
closedsuspended 
5.2-SP1 
 
0000241: Wrong validation of relay host when adding a host with port
When adding a relay host with port (in the format host:port), the SMTP Server page doesn't validate the presence of the por, thus adding an invalid value to the relayhost Postfix configuration parameter. According to Postfix documentation:

"In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port. The form [hostname] turns off MX lookups."

Because the SMTP Server page doesn't validate the presence of a port on the host string it adds the relay host as [relayhost:port], which is incorrect and breaks the relay host configuration. When a port is present it must be added as [relayhost]:port or relayhost:port.

Attached to this report is a patch that fixes this issue, looking if the relay host being added contains a string in the form "host:port" and if it does then it sets relayhost = [host]:port.
I'm not sure which is the best format to use for the relay host, as the format [host]:port doesn't work for me, just host:port. I don't know if this is related to the port setting or to the fact that I'm connecting to a TLS enabled relay host that listens on port 587 and requires SMTP auth. As documentation says, the use of [ ] turns off MX lookups, is there any reason to do this ? I would think that they should be left turned on.
No tags attached.
zip fix_postfix_relayhost_with_port.zip (560) 2011-02-26 22:36
https://tracker.clearos.com/file_download.php?file_id=13&type=bug
zip fix_postfix_relayhost_with_port_v2.zip (1,467) 2011-03-01 21:44
https://tracker.clearos.com/file_download.php?file_id=14&type=bug
Issue History
2011-02-26 22:36maeztroNew Issue
2011-02-26 22:36maeztroFile Added: fix_postfix_relayhost_with_port.zip
2011-02-27 18:56maeztroNote Added: 0000335
2011-02-27 18:57maeztroNote Edited: 0000335
2011-02-28 20:43user2Statusnew => confirmed
2011-02-28 20:53user2Severitymajor => minor
2011-03-01 21:44maeztroFile Added: fix_postfix_relayhost_with_port_v2.zip
2011-03-01 21:44maeztroNote Added: 0000336
2013-02-02 10:32user2Target Version => 6.4.0 Updates
2013-07-29 13:58user2Target Version6.4.0 Updates => 6 Future
2014-04-22 13:28user2Target Version6 Future => Future
2015-05-25 05:10user2Target VersionFuture =>
2019-03-12 10:24NickHNote Added: 0010941
2019-03-12 10:24NickHStatusconfirmed => closed
2019-03-12 10:24NickHResolutionopen => suspended

Notes
(0000335)
maeztro   
2011-02-27 18:56   
(edited on: 2011-02-27 18:57)
Take a look to this forum post about the use of MX lookups with the relayhost parameter:

http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,14/func,view/id,24765/#24826 [^]

IMO, they should be turned on so the notation that should be used is without the [].

(0000336)
maeztro   
2011-03-01 21:44   
Attached a new patch version, which additional to hte port validation adds a text field for the relay host port in mail-smtp.php, as discussed here:

http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,39/func,view/id,13476/#25004 [^]
(0010941)
NickH   
2019-03-12 10:24   
Migrated to: https://gitlab.com/clearos/clearfoundation/app-smtp/issues/3 [^]