hestiacp / hestiacp

Hestia Control Panel | A lightweight and powerful control panel for the modern web.
https://hestiacp.com
GNU General Public License v3.0
3.39k stars 680 forks source link

[BUG] Exim problem (failed to expand “interface” option for remote_smtp transport) #2087

Closed ghost closed 3 years ago

ghost commented 3 years ago

The emails get stuck in mail queue.

Exim log:

xxxxxxxxxxx@icloud.com R = dnslookup T = remote_smtp defer (-1): failed to expand “interface” option for remote_smtp transport: failed to open /etc/exim4/domains/xxxxxxxxx.com/ip: Permission denied (euid = 109 egid = 116)

Expected behavior

Sending emails without getting stuck in the queue due to errors.

Operating system:

Debian 11

Hestia Control Panel version:

HestiaCP 1.4.11

Additional context

Fresh install.

jaapmarcus commented 3 years ago

2021-08-25 20:26:49 1mIxbt-0001eM-09 <= ik@xxxx H=localhost (webmail.xxx) [127.0.0.1] P=esmtpa A=dovecot_login:ik@xxxx S=566 id=9a79db9f848af97738722b64f1845ba4@xxxx

2021-08-25 20:26:49 1mIxbt-0001eM-09 Tainted filename ‘/etc/exim4/domains/xxxx/ip’

2021-08-25 20:26:49 1mIxbt-0001eM-09 == me@xxxx R=dnslookup T=remote_smtp defer (-1): failed to expand “interface” option for remote_smtp transport: failed to open /etc/exim4/domains/xxxx/ip: Permission denied (euid=108 egid=115)

https://github.com/hestiacp/hestiacp/blob/b6afefc0b1ff7992dfd22abc82be44aad1a47ab0/install/deb/exim/exim4.conf.4.94.template#L346-L354

https://forum.hestiacp.com/t/exim-problem-failed-to-expand-interface-option-for-remote-smtp-transport/4360

jaapmarcus commented 3 years ago

@mikesmith500 If you have time please test the following command:

sed -i 's|OUTGOING_IP = /etc/exim4/domains/$sender_address_domain/ip|OUTGOING_IP = /etc/exim4/domains/${lookup{${lc:${domain:$h_from:}}}dsearch{/etc/exim4/domains/}}/ip|g' /etc/exim4/exim4.conf.template
systemctl restart exim4
tail -f -s0.1 /var/log/exim4/mainlog

Then send a email via webmail / domain.

ghost commented 3 years ago

2021-08-25 21:48:26 1mIysr-0005a8-Tn <= admin@xxx.com H=(smtpclient.apple) [31.4.247.xxx] P=esmtpsa X=TLS1.2:ECDHE_SECP256R1RSA_SHA256__AES_256_GCM:256 CV=no SNI=osiris.xxx.net A=dovecot_plain:admin@xxx.com S=676 id=7DC02FEE-DA5A-49F0-B4C6-DF3E3E9B85F1@xxx.com 2021-08-25 21:48:27 1mIysr-0005a8-Tn => check-auth@verifier.port25.com R=dnslookup T=remote_smtp H=verifier.port25.com [34.209.113.130] X=TLS1.3:ECDHE_SECP256R1RSA_PSS_RSAE_SHA256AES_256_GCM:256 CV=yes K C="250 2.6.0 message received" 2021-08-25 21:48:27 1mIysr-0005a8-Tn Completed 2021-08-25 21:48:29 1mIysv-0005aE-Aa <= auth-results@verifier.port25.com H=verifier.port25.com [34.209.113.130] P=esmtps X=TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256AES_256_GCM:256 CV=no S=10508 DKIM=port25.com id=1629920907-917098@verifier.port25.com 2021-08-25 21:48:29 1mIysv-0005aE-Aa => admin admin@xxx.com R=localuser T=local_delivery 2021-08-25 21:48:29 1mIysv-0005aE-Aa Completed

jaapmarcus commented 3 years ago

Package will follow soon include a second bug fix regarding smtp relays