Can't enable SendMail when using SMTP port other than 25

1 post / 0 new
#1 Wed, 08/29/2018 - 07:03
softins

Can't enable SendMail when using SMTP port other than 25

Using Virtualmin 4.18.gpl on CentOS 6.

This is similar to the old thread at https://www.virtualmin.com/node/14328

On my system I am running the ASSP SMTP proxy, which is responsible for listening on ports 25 and 587, and is not controlled by Virtualmin. ASSP then connects to the local Sendmail using port 225 on 127.0.0.1. This all works absolutely fine, and has done for years.

However, I am now trying to update "Features and Plugins" to enable SSL sites (mail for domain is already enabled, since before I installed ASSP). When I try to Save the Features and Plugins, I get the message "Failed to save enabled features : Sendmail is only accepting SMTP connections on the following ports : 127.0.0.1 port 225. Email from other systems on the Internet will not be accepted. This can be changed in the Sendmail Mail Server module."

How can I tell Virtualmin "Yes, it's fine, I DO know what I'm doing. Please just let me do it!"?

OK, so looking at the code in virtual-server/virtual-server-lib-funcs.pl around line 13298:

                if (@addrs) {
                        # Need at least one non-localhost port 25
                        local @adescs;
                        foreach my $a (@addrs) {
                                if ($a->[0] eq '*') {
                                        push(@adescs, "port $a->[1]");
                                        }
                                else {
                                        push(@adescs, "$a->[0] port $a->[1]");
                                        }
                                }
                        @addrs = grep { $_->[0] ne 'localhost' &&
                                        $_->[0] ne '127.0.0.1' &&
                                        $_->[0] !~ /:/ &&
                                        ($_->[1] eq '25' || $_->[1] eq 'smtp') }
                                      @addrs;
                        @addrs || return &text('check_esendmailaddrs',
                                        join(", ", @adescs), '/sendmail/');
                        }

It would appear that this check is hard-coded and not configurable. :( I could of course comment it out, but it would return on the next update. But since I seldom edit Features and Plugins, maybe that's what I need to do for now.

Cheers, Tony