SMTP Forwards Not Working [Solved]

,

My YunoHost server

Hardware: 64bit pc
YunoHost version: 11.1.0.2
I have access to my server : SSH, Webadmin, Direct access
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

When I send an email instead of sending through my SMTP relay provider they send through my ISP, which always bounces because it’s marked as spam.

Error when trying to send an email
This is the mail system at host http://myserver.

I’m sorry to have to inform you that your message could not
be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<incoming@email>: host http://email[http:/x.x.x.x] said: 553 5.7.2
[TSS09] All messages from http://my-isp-ip will be permanently deferred;
Retrying will NOT succeed. See https://postmaster.yahooinc.com/error-codes
(in reply to MAIL FROM command)

I’d like to post an update on this: I still have no idea what the issue is. I had an unrelated solid state drive failure that I’ve since replaced. However even on a fresh install of yunohost, SMTP forwarding does not work. I’m currently on testing 11.1.2. Any help at all is appreciated as I have emails as far back as the 28th of last month I still need to get back to.

Hmmmokay I would obviously check first that the relay settings are correct :confused:

And also doublecheck that grep relayhost /etc/postfix/main.cf displays the name of the relay

Hi Aleks, thanks for the response.
I’ve verified all my information is correct through both the webadmin, and through the terminal (ssh). I’ve posted the output of the command you asked for, as well as the current displayed settings (which I’ve edited for privacy)
Any clue on what steps to take from this point?

me@myserver:~$ sudo grep relayhost /etc/postfix/main.cf
relayhost =

me@myserver:~$ sudo yunohost settings list
email.pop3.pop3_enabled: 
  ask: Enable POP3
  value: no
email.smtp.smtp_allow_ipv6: 
  ask: Allow IPv6
  value: no
email.smtp.smtp_relay_enabled: 
  ask: Enable SMTP relay
  value: yes
email.smtp.smtp_relay_host: 
  ask: SMTP relay host
  value: my-smtp-forwarding-provider.com
email.smtp.smtp_relay_password: 
  ask: SMTP relay password
  value: 
email.smtp.smtp_relay_port: 
  ask: SMTP relay port
  value: 2525
email.smtp.smtp_relay_user: 
  ask: SMTP relay user
  value: me@myemail.com

Hmokay so grep relayhost /etc/postfix/main.cf shows that the relay config definitely isnt propagated to postfix’s conf …

What does yunohost tools regen-conf postfix tells ?

Running that command didn’t output anything in the terminal directly. Not sure if I should be looking for a log somewhere to check and see if it did do anything or not. I reran the first command afterwards and it’s still got the same output.

me@myserver:~$ sudo yunohost tools regen-conf postfix
me@myserver:~$ grep relayhost /etc/postfix/main.cf
relayhost =

Hmmokay so let’s check the debug log:

yunohost tools regen-conf postfix --debug

This is the output:

me@meserver:~$ sudo yunohost tools regen-conf postfix --debug
[sudo] password for me: 
134  DEBUG initializing base actions map parser for cli
135  DEBUG loading actions map
137  DEBUG building parser...
144  DEBUG building parser took 0.007s
145  DEBUG acquiring lock...
157  DEBUG lock has been acquired
170  DEBUG loading python module yunohost.tools took 0.014s
170  DEBUG processing action [70857.1]: yunohost.tools.regen-conf with args={'names': ['postfix'], 'with_diff': False, 'force': False, 'dry_run': False, 'list_pending': False}
230  DEBUG initializing ldap interface
238  DEBUG Executing command '['sh', '-c', '/bin/bash -x "./19-postfix" pre \'\' \'\' /var/cache/yunohost/regenconf/pending/postfix 7>&1']'
244  DEBUG + set -e
244  DEBUG + . /usr/share/yunohost/helpers
244  DEBUG +++ set +o
244  DEBUG +++ grep xtrace
245  DEBUG ++ readonly 'XTRACE_ENABLE=set -o xtrace'
246  DEBUG ++ XTRACE_ENABLE='set -o xtrace'
246  DEBUG ++ set +x
262  DEBUG + do_pre_regen /var/cache/yunohost/regenconf/pending/postfix
263  DEBUG + pending_dir=/var/cache/yunohost/regenconf/pending/postfix
263  DEBUG + cd /usr/share/yunohost/conf/postfix
263  DEBUG + postfix_dir=/var/cache/yunohost/regenconf/pending/postfix/etc/postfix
263  DEBUG + mkdir -p /var/cache/yunohost/regenconf/pending/postfix/etc/postfix
263  DEBUG + default_dir=/var/cache/yunohost/regenconf/pending/postfix/etc/default/
264  DEBUG + mkdir -p /var/cache/yunohost/regenconf/pending/postfix/etc/default/
265  DEBUG + cp plain/header_checks plain/ldap-accounts.cf plain/ldap-aliases.cf plain/ldap-domains.cf plain/ldap-groups.cf plain/master.cf plain/sender_canonical plain/smtp_reply_filter /var/cache/yunohost/regenconf/pending/postfix/etc/postfix
273  DEBUG ++ cat /etc/yunohost/current_host
274  DEBUG + main_domain=meserver.com
274  DEBUG ++ yunohost settings get security.postfix.postfix_compatibility
461  DEBUG + export compatibility=modern
461  DEBUG + compatibility=modern
461  DEBUG + export relay_port=
461  DEBUG + relay_port=
461  DEBUG + export relay_user=
462  DEBUG + relay_user=
462  DEBUG + export relay_host=
462  DEBUG + relay_host=
462  DEBUG ++ yunohost settings get email.smtp.smtp_relay_enabled
646  DEBUG + export relay_enabled=1
647  DEBUG + relay_enabled=1
647  DEBUG + '[' 1 == 1 ']'
647  DEBUG ++ yunohost settings get email.smtp.smtp_relay_host
833  DEBUG + relay_host=SMTP PROVIDER
833  DEBUG ++ yunohost settings get email.smtp.smtp_relay_port
1019 DEBUG + relay_port=2525
1020 DEBUG ++ yunohost settings get email.smtp.smtp_relay_user
1205 DEBUG + relay_user=CHANGED
1206 DEBUG ++ yunohost settings get email.smtp.smtp_relay_password
1392 DEBUG + relay_password=CHANGED
1392 DEBUG + touch /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sasl_passwd
1394 DEBUG + chmod 750 /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sasl_passwd
1396 DEBUG + chown postfix /var/cache/yunohost/regenconf/pending/postfix/etc/postfix
1400 DEBUG + chown postfix /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sasl_passwd
1401 DEBUG + cat
1402 DEBUG + export main_domain
1403 DEBUG + export 'domain_list=meserver.com cl.meserver.com fb.meserver.com gc.meserver.com ha.meserver.com ig.meserver.com jf.meserver.com ma.meserver.com md.meserver.com mr.meserver.com pf.meserver.com pt.meserver.com ra.meserver.com rd.meserver.com rt.meserver.com sx.meserver.com test.meserver.com tt.meserver.com tw.meserver.com vw.meserver.com www.meserver.com yt.meserver.com'
1403 DEBUG + domain_list='meserver.com cl.meserver.com fb.meserver.com gc.meserver.com ha.meserver.com ig.meserver.com jf.meserver.com ma.meserver.com md.meserver.com mr.meserver.com pf.meserver.com pt.meserver.com ra.meserver.com rd.meserver.com rt.meserver.com sx.meserver.com test.meserver.com tt.meserver.com tw.meserver.com vw.meserver.com www.meserver.com yt.meserver.com'
1403 DEBUG + ynh_render_template main.cf /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/main.cf
1404 DEBUG + local template_path=main.cf
1404 DEBUG + local output_path=/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/main.cf
1404 DEBUG ++ dirname /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/main.cf
1404 DEBUG + mkdir -p /var/cache/yunohost/regenconf/pending/postfix/etc/postfix
1405 DEBUG + python3 -c 'import os, sys, jinja2; sys.stdout.write(
1406 DEBUG                     jinja2.Template(sys.stdin.read()
1406 DEBUG                     ).render(os.environ));'
1489 DEBUG + ynh_render_template sni /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sni
1489 DEBUG + local template_path=sni
1489 DEBUG + local output_path=/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sni
1489 DEBUG ++ dirname /var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sni
1490 DEBUG + mkdir -p /var/cache/yunohost/regenconf/pending/postfix/etc/postfix
1492 DEBUG + python3 -c 'import os, sys, jinja2; sys.stdout.write(
1492 DEBUG                     jinja2.Template(sys.stdin.read()
1492 DEBUG                     ).render(os.environ));'
1557 DEBUG + cat postsrsd
1557 DEBUG + sed 's/{{ main_domain }}/meserver.com/g'
1558 DEBUG + sed 's/{{ domain_list }}/meserver.com cl.meserver.com fb.meserver.com gc.meserver.com ha.meserver.com ig.meserver.com jf.meserver.com ma.meserver.com md.meserver.com mr.meserver.com pf.meserver.com pt.meserver.com ra.meserver.com rd.meserver.com rt.meserver.com sx.meserver.com test.meserver.com tt.meserver.com tw.meserver.com vw.meserver.com www.meserver.com yt.meserver.com/g'
1560 DEBUG ++ yunohost settings get email.smtp.smtp_allow_ipv6
1745 DEBUG + ipv6=0
1746 DEBUG + '[' 0 == False ']'
1746 DEBUG + '[' '!' -f /proc/net/if_inet6 ']'
2749 DEBUG Checking pending configuration which would have been applied for category 'postfix'...
2818 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/default/postsrsd' to system conf '/etc/default/postsrsd'
2819 DEBUG > system conf is already up-to-date
2819 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/main.cf' to system conf '/etc/postfix/main.cf'
2819 DEBUG > system conf is already up-to-date
2820 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/ldap-groups.cf' to system conf '/etc/postfix/ldap-groups.cf'
2820 DEBUG > system conf is already up-to-date
2820 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/master.cf' to system conf '/etc/postfix/master.cf'
2821 DEBUG > system conf is already up-to-date
2821 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/header_checks' to system conf '/etc/postfix/header_checks'
2821 DEBUG > system conf is already up-to-date
2822 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sender_canonical' to system conf '/etc/postfix/sender_canonical'
2822 DEBUG > system conf is already up-to-date
2822 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/ldap-aliases.cf' to system conf '/etc/postfix/ldap-aliases.cf'
2822 DEBUG > system conf is already up-to-date
2823 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/ldap-domains.cf' to system conf '/etc/postfix/ldap-domains.cf'
2823 DEBUG > system conf is already up-to-date
2823 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/smtp_reply_filter' to system conf '/etc/postfix/smtp_reply_filter'
2824 DEBUG > system conf is already up-to-date
2824 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/ldap-accounts.cf' to system conf '/etc/postfix/ldap-accounts.cf'
2824 DEBUG > system conf is already up-to-date
2824 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sni' to system conf '/etc/postfix/sni'
2825 DEBUG > system conf is already up-to-date
2825 DEBUG processing pending conf '/var/cache/yunohost/regenconf/pending/postfix/etc/postfix/sasl_passwd' to system conf '/etc/postfix/sasl_passwd'
2825 DEBUG > system conf is already up-to-date
2826 DEBUG The configuration is already up-to-date for category 'postfix'
2827 DEBUG Executing command '['sh', '-c', '/bin/bash -x "./19-postfix" post \'\' \'\' \'\' 7>&1']'
2833 DEBUG + set -e
2833 DEBUG + . /usr/share/yunohost/helpers
2834 DEBUG +++ set +o
2834 DEBUG +++ grep xtrace
2835 DEBUG ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2835 DEBUG ++ XTRACE_ENABLE='set -o xtrace'
2835 DEBUG ++ set +x
2851 DEBUG + do_post_regen
2852 DEBUG + regen_conf_files=
2852 DEBUG + chown postfix /etc/postfix
2852 DEBUG + '[' -e /etc/postfix/sasl_passwd ']'
2853 DEBUG + chmod 750 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
2854 DEBUG + chown postfix:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
2857 DEBUG + postmap /etc/postfix/sasl_passwd
2873 DEBUG + postmap -F hash:/etc/postfix/sni
2885 DEBUG + [[ -z '' ]]
3892 DEBUG To view the log of the operation 'Regenerate system configurations 'postfix'', use the command 'yunohost log show 20221218-040941-regen_conf-postfix'
3902 DEBUG action [70857.1] executed in 3.732s
3903 DEBUG lock has been released

Ugh yeah I found the culprit … this is a typo in version 11.1

and

I’ll fix it in the code but this should be "1" instead of "True" on both line. You can fix it manually on your server by editing

sudo nano /usr/share/yunohost/conf/postfix/main.cf

and tweaking both lines

Then re-run yunohost tools regen-conf postfix

(Edit: fix in this commit, to be released in next 11.1 iteration : postfix: fix typo breaking relays · YunoHost/yunohost@80a060d · GitHub )

1 Like

Aleks you are fantastic. Everything is working correctly now. Thank you so much! <3

1 Like

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