I don't want postfix to ask for its mailname i just want it to use its fqdn name.
This is my preseed file
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Setting the mailname to a fixed value is easy, by adding this to your preseed file:
postfix postfix/mailname string your-preferred-mailname
However, that isn't quite what you asked: you asked for it just to use your FQDN (which is the default value for the question). That's a bit trickier. Whether a debconf question is asked is controlled by a combination of the question's priority and the "seen" flag. However, just setting the "seen" flag will suppress the normal behaviour of picking up the default value from your FQDN, which isn't what you want.
I think you therefore have two reasonable answers. Firstly, you could set the debconf priority to critical during installation, by using the 'priority=critical' boot parameter. That ensures that you will only get asked questions whose answers the installer can't do without. For most people, this is a good option when preseeding.
However, if for some reason you can't do this, you could use a computed preseed entry. This is trickier; you have to make sure to fetch the FQDN after network configuration happens. A safe, if hacky, way to do this is to abuse a hook provided at the start of partitioning:
d-i partman/early_command string \ echo "postfix postfix/mailname string $(hostname --fqdn)" >/tmp/computed-preseed.cfg; \ debconf-set-selections /tmp/computed-preseed.cfg
(I think this should work, but I haven't tested it. Please confirm!)
When your mail server connects to another mail server to transfer messages it performs a HELO which sends it's hostname to the other server. This is one of the reasons your hostname is so important. In fact, many servers in order to verify the integrity of mail exchanges will do a DNS lookup to verify the FQDN (Fully Qualified Domain Name) matches what if provided in the HELO. If they do not match some servers will not allow the transfer of mail. Therefore, make sure your FQDN is what is present in the HELO.
Postfix requires a fully qualified domain name or FQDN. A FQDN includes the hostname of the server as well as the domain name like this:
Postfix provides a utility that enables you to change the hostname into a FQDN. Use the command postconf with the -e option for editing Here is an example:
postconf -e myhostname=mail.hello.org
as a side note:
can you add the