IP used while forwarding emails?

When emails are forwarded, is the same IP that the domain is hosted on used?

When forwarding emails to Outlook I get an error:

SMTP error from remote mail server after pipelined end of data: 451 4.7.500 Server busy. Please try again later from [136.243.33.***]. (AS780082) [MA1PEPF00007262.INDPRD01.PROD.OUTLOOK.COM 2024-07

This IP is my server IP and the domains are hosted on a different IP.

Debian 12

It should be the same ip used for the web domain, if you changed the ip after creating the mail domain, maybe it is using the default server’s ip.

You can check the outgoing ip that is being used by Exim for your domain with this command (replace example.net with the actual domain):

cat /etc/exim4/domains/example.net/ip

You can edit that file and write the right ip.

1 Like

Checked and the outgoing Ip is the correct one. It’s just when forwarding the emails the Ip of the server is being used rather than the web domain IP.

In exim, remote_smtp and remote_forwarded_smtp use the same outgoing ip, the one defined in the ip file:

[...]
OUTGOING_IP = /etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains}}/ip
[...]
remote_smtp:
  driver = smtp
  helo_data = ${lookup dnsdb{>: defer_never,ptr=$sending_ip_address}{${listextract{1}{$value}}}{$primary_hostname}}
  dkim_domain = DKIM_DOMAIN
  dkim_selector = mail
  dkim_private_key = DKIM_PRIVATE_KEY
  dkim_canon = relaxed
  dkim_strict = 0
  hosts_try_fastopen = !*.l.google.com
  interface = ${if exists{OUTGOING_IP}{${readfile{OUTGOING_IP}}}}   <--- this uses the domain's ip
  .ifdef IGNORE_SMTP_LINE_LENGTH_LIMIT
    message_linelength_limit = 1G
  .endif

remote_forwarded_smtp:
  driver = smtp
  helo_data = ${lookup dnsdb{>: defer_never,ptr=$sending_ip_address}{${listextract{1}{$value}}}{$primary_hostname}}
  dkim_domain = DKIM_DOMAIN
  dkim_selector = mail
  dkim_private_key = DKIM_PRIVATE_KEY
  dkim_canon = relaxed
  dkim_strict = 0
  hosts_try_fastopen = !*.l.google.com
  interface = ${if exists{OUTGOING_IP}{${readfile{OUTGOING_IP}}}}   <--- this uses the domain's ip
  # modify the envelope from, for mails that we forward
  max_rcpt = 1
  return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}

I have the same one.

looks like something related to [Bug] TLS error on connection · Issue #3781 · hestiacp/hestiacp · GitHub