how to change postfix/servername

si458

Renowned Member
Hi All,

how do i change the postfix/servername thats shown in the headers on incoming emails and outbound emails being sent out?

currently everywhere i look my EC2 internal instance hostname is being shown and i would like to use my own dns name i have setup and currently using to send emails to it in the first place

some headers from emails as examples:

Received: from ip-172-31-28-238.eu-west-2.compute.internal (ec2-xx-xx-xx-xx.eu-west-2.compute.amazonaws.com [xx-xx-xx-xx]) by xx.xx..com (Postfix) with ESMTPS id C91C6C46CB for <simon@xx.com>; Fri, 16 Jul 2021 13:02:42 +0100 (BST)
Received: from ip-172-31-28-238.eu-west-2.compute.internal (localhost [127.0.0.1]) by ip-172-31-28-238.eu-west-2.compute.internal (Proxmox) with ESMTP id 92FA720888 for <simon@xx.com>; Fri, 16 Jul 2021 13:02:42 +0100 (BST)
Received: from somerandom.server.com (somerandom.server.com [xx.xx.xx.xx]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ip-172-31-28-238.eu-west-2.compute.internal (Proxmox) with ESMTPS id 80A422087D for <simon@xx.com>; Fri, 16 Jul 2021 13:02:37 +0100 (BST)

Regards

Simon
 
how do i change the postfix/servername thats shown in the headers on incoming emails and outbound emails being sent out?
Usually this value is taken from the fqdn of your system (the output of `hostname -f`) - in PMG it defaults to the short hostname appended with the search domain from /etc/resolv.conf - see:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_configuration_files_overview

Try adapting those values if possible - else you can modify the postfix configuration and change the myhostname parameter (IIRC that's the value used by PMG for the received header lines it writes itself) by using the templateing system:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

That being said some of the occurences you won't be able to change - since the servers receiving mail from PMG will do their own DNS-lookups for the hostname you provide and for the ip PMG is connecting from (and I assume you cannot change the reverse PTR of an amazon ec2 instance)

maybe this post also explains some details regarding this:
https://serverfault.com/questions/2...in-mail-headers-sent-from-postfix-mail-server

I hope this helps!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!