Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I don't want postfix to ask for its mailname i just want it to use its fqdn name.

This is my preseed file

share|improve this question

2 Answers 2

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!)

share|improve this answer

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:

mail.example.com

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 main.cf?

share|improve this answer
    
From command line is no problem, but i want to do it when doing with preseed (sort of kickstart from redhar), you boot pxe or from special ubuntu cd and it auto installes you system, what i want is that i don't get the question for the hostname i want it to use the system name –  Bas van den Dikkenberg Mar 19 '12 at 19:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.