Socket parameter is not properly passed.

Bug #1773252 reported by Joseph Tignor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mimedefang (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installed MIMEDefang and modified /etc/init.d/mimedefang to allow sender filter operations by uncommenting the MX_SENDER_CHECK line and changing it to yes. When the service was started however the socket /var/spool/MIMEDefang/mimedefang.sock was not created. I sought help on ServerFault but got no clues from there. Eventually I noticed the issue, /etc/init.d/mimedefang started the service with the command "/usr/bin/mimedefang -P /var/spool/MIMEDefang/mimedefang.pid -R -1 -m /var/spool/MIMEDefang/mimedefang-multiplexor.sock -z /var/spool/MIMEDefang -U defang -s -p /var/spool/MIMEDefang/mimedefang.sock" with two spaced between -s and -p. If I ran the command by hand with only one space the socket was created successfully. I dove deeper into the /etc/init.d/mimedefang file and noticed the following lines:

`[ "$MD_SKIP_BAD_RCPTS" = "yes" ] && echo "-N"` \
"`[ -n "$X_SCANNED_BY" ] && \
        ( [ "$X_SCANNED_BY" = "-" ] && \
            echo "-X" || echo "-x$X_SCANNED_BY" )`" \
`[ "$ALLOW_NEW_CONNECTIONS_TO_QUEUE" = "yes" ] && echo "-q"` \

I did not define $X_SCANNED_BY. I am not a bash expert but I suspected the outer quotes around the handling of that value to be responsible. I removed them and the extra space in the command went away resulting in the service working as expected:

`[ "$MD_SKIP_BAD_RCPTS" = "yes" ] && echo "-N"` \
`[ -n "$X_SCANNED_BY" ] && \
        ( [ "$X_SCANNED_BY" = "-" ] && \
            echo "-X" || echo "-x$X_SCANNED_BY" )` \
`[ "$ALLOW_NEW_CONNECTIONS_TO_QUEUE" = "yes" ] && echo "-q"` \

The folks at ServerFault mentioned this qualified as a bug and I think I agree so I figured I would report it here. Since I don't know what the purpose of those where I don't know if that solution would work for anyone who is using $X_SCANNED_BY. This was all in Ubuntu 16.04.4 LTS and mimedefang 2.78-1ubuntu1.1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.