Setting up Yunohost without the possibility to use Ports 25 and 587 / Disable Mail

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.6
How are you able to access your server: The webadmin
SSH
Other(?)
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: Tried to use a smtp relay

Describe your issue

Hi all,

I’m trying to setup a Yunohost instance in a environment were Port 25 and 587 are blocked.
The only possibility to send mails is using a provided smtp (smtp.example.com).
I can either authenticate with the smtp or use it without authentication.
I’m not allowed to use any “sending” mailadress. So I need to use a specified sending adress for everything (f.ex. outgoing@example.com).

After some research I tried the following:

sudo yunohost settings set email.smtp.smtp_relay_enabled -v yes Works

sudo yunohost settings set email.smtp.smtp_relay_host -v smtp.example.com Fails

Any advise on how to proceed?

Share relevant logs or error messages

========================================

Email
========================================

SMTP

Traceback (most recent call last):
File “/usr/bin/yunohost”, line 77, in
yunohost.cli(
File “/usr/lib/python3/dist-packages/yunohost/init.py”, line 41, in cli
ret = moulinette.cli(
^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/moulinette/init.py”, line 115, in cli
).run(args, output_as=output_as, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py”, line 498, in run
ret = self.actionsmap.process(args, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/moulinette/actionsmap.py”, line 561, in process
return func(**arguments)
^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/log.py”, line 480, in func_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/settings.py”, line 102, in settings_set
return settings.set(key, value, args, args_file, operation_logger=operation_logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/configpanel.py”, line 577, in set
self.form = self._ask(
^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/configpanel.py”, line 868, in _ask
form = prompt_or_validate_form(
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/form.py”, line 2059, in prompt_or_validate_form
if not option.is_visible(context):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/form.py”, line 427, in is_visible
return evaluate_simple_js_expression(self.visible, context=context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/form.py”, line 216, in evaluate_simple_js_expression
return evaluate_simple_ast(node, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/yunohost/utils/form.py”, line 104, in evaluate_simple_ast
return context[node.id]
~~~~~~~^^^^^^^^^
KeyError: ‘smtp_relay_enabled’

Welcome!

It looks like that setting got renamed in YunoHost 12.

Please try to either:

  • Use the configuration menu of the webadmin, in Tools > YunoHost settings > Email
  • Try the interactive settings configuration from the CLI: sudo yunohost settings set email.smtp (then answer the questions)
1 Like

I’m unable to set the “sending adress” using the webadmin.

root@xxx:/home/xxx# yunohost settings set email.smtp.smtp_relay_from -v “your-email@example.de
Error: The filter key ‘(‘email’, ‘smtp’, ‘smtp_relay_from’)’ is incorre

fails.
Error: The filter key ‘(‘email’, ‘smtp’, ‘smtp_relay_from’)’ is incorrect.

Where can I find the documention on how to set the necessary settings via shell?

I think there’s a mistake…

to see the settings:

yunohost settings list
....
email.smtp.smtp_relay_enabled: 
  ask: Activer le relais SMTP
  value: no
email.smtp.smtp_relay_host: 
  ask: Adresse du relais SMTP
  value: 
email.smtp.smtp_relay_password: 
  ask: Mot de passe du relais SMTP
  value: **************
email.smtp.smtp_relay_port: 
  ask: Port du relais SMTP
  value: 587
email.smtp.smtp_relay_user: 
  ask: Compte du relais SMTP
  value:

tituspijean suggested right before to use sudo yunohost settings set email.smtp and then answer the question interactively …

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.