Koozali.org: home of the SME Server

Getting outbound mail to work when external SMTP server uses port 587

Offline holck

  • *
  • 322
  • +1/-0
My new Internet Service Provider requires authentication with username and password on port 587 for using the provider's SMTP server. I have spent several hours to get this working - here is my solution, so hopefully others can use their time better :-)

The username and password for SMTP is set up in the server manager, put here you cannot change the port number. So this requires a little coding:

Add this key to the configuration database:
Code: [Select]
# /sbin/e-smith/config setprop smtp-auth-proxy Port 587

Add the lines marked with ++ to /usr/local/sbin/smtp-auth-proxy.pl
Code: [Select]
$prop->{Passwd} = $smtp_proxy_rec->prop('Passwd');
++ $prop->{Port} = $smtp_proxy_rec->prop('Port');
$prop->{Debug} = $smtp_proxy_rec->prop('Debug');
and
Code: [Select]
my $system_name = $self->get_property('SystemName');
++ my $port = $self->get_property('Port');
my $name = $self->get_property('Userid');

And in the file also change
Code: [Select]
my $smtp = Net::SMTP->new($smarthost,
  Hello => "${system_name}.${domain_name}",
  Debug => $debug
);
to
Code: [Select]
my $smtp = Net::SMTP->new($smarthost,
  Hello => "${system_name}.${domain_name}",
  Debug => $debug,
  Port => $port
);
Finally restart smtp-auth-proxy and qmail:
Code: [Select]
#svc -t /var/service/smtp-auth-proxy
#svc -t /var/service/qmail
......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Getting outbound mail to work when external SMTP server uses port 587
« Reply #1 on: December 24, 2007, 06:26:44 PM »
So this requires a little coding: ...

Please post all this information in a New Feature Request in the Bug Tracker. Thanks.

Offline thomasch

  • *
  • 232
  • +0/-0
Re: Getting outbound mail to work when external SMTP server uses port 587
« Reply #2 on: December 26, 2007, 06:21:59 AM »
Please post all this information in a New Feature Request in the Bug Tracker. Thanks.

Similar NFR raised some time ago by RV  http://bugs.contribs.org/show_bug.cgi?id=546
RV want a new 'port' field for 'pop before send' email authentication in server-manager

Please follow up the proposed solution there

thomas
« Last Edit: December 26, 2007, 06:26:39 AM by thomasch »