POP or IMAP connector to non standard ports

Hello,

I am new to NETHSERVER and was using the last few days to get familiar with it. I was using ZENTYAL for quite a while, but I changed to NETSERVER due to the RPi support. I am quite satisfied and almost all what I wanted is running excellent.
However, I was running into one problem I was unable to solve:
I use DAVMAIL on another RPi what connects through a CISCO tunnel to our university systems where ONLY EXCHANGE is running. That is NOT reachable from the public Internet. DAVMAIL is offering POP3, IMAP and related protocols from ports, which are 1000 higher then standard, e.g. 1110, 1143, etc …
With the usual email MUAs and also with the ZENTYAL connector reaching those ports is no problem. I tried the same in NethServer and failed due to the lack of a seperate port field in the dialog …

So, l how to do that without digging too deep into the system :slight_smile: … ?

Tnx for your help,
Jürgen

–… …–

Probably I should add, that I of course have tested to write the IP address and port e.g. like this

aaa.bbb.ccc.ddd:1110

but then GETMAIL does not send anything at all (I check with WIRESHARK).
Also, the internal used adresses of DAVMAIL should not be changed …

Hi and welcome to NethServer Community,

NethServer uses templates to write the config files.
To change the port getmail uses, you need a custom template.

Create custom template dir:

mkdir -p /etc/e-smith/templates-custom/getmailrc/

Create a file /etc/e-smith/templates-custom/getmailrc/11port with following content:

{
    my $port = $account->prop('Port') || '';
    if ($port) {$OUT .= "port = $port\n";}
}

Now it’s possible to use a port property in the getmail database to set a custom port.

To get the already configured getmail entries:

db getmail show

Set port 1110 for a forwarder:

db getmail setprop testname@testmail.at@testserver.at Port 1110

Apply the configuration:

signal-event nethserver-getmail-save

5 Likes

Hi there,

thanks for your answer ( Danke !).

Well, all that works ok on an account, what is already in the database - excellent. However, to make a new entry for such a non-standard connector from the GUI, I am not getting beyond the credentials check, which must be successful as a precondition to be able to save the profile :slight_smile:

So, you need first to generate first a successful connector entry, before it can be modified from the shell :wink:

Anyway, good to have such a brief insight into the template structure with your example … Changing the GUI for this purpose in the PHP-scripts is also template based? Maybe it would be worth to add a PORT field there, as most MUAs etc. are using that as well.

Thanks/Danke,
Jürgen

I think so but here is some documentation about the server manager:

https://nethserver.github.io/nethserver-cockpit/

I think this is the right case for a custom template as you just need to setup the forwarders once.
NethServer aims to provide a simple configuration and In most cases the default ports are working.

1 Like

Well, I understand the point here … anyway, Danke !

1 Like