Postfix is a widely used mail server, more specifically an MTA ( Mail Transfer Agent ). In this article we describe how to install Postfix under Debian Lenny 5.0. In the example we use a test server ( Replace this name with the name of your server.

Install package

On the command line, start the Postfix installation like this:

apt-get install postfix

Debian will then indicate that exim is removed and asks if you want to proceed with the installation:

lists: ~ # apt-get install postfix
Reading package lists ... Done
Building dependency tree       
Reading state information ... Done
Suggested packages:
  procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin libsasl2-modules
  resolvconf postfix-cdb ufw
The following packages will be REMOVED:
  exim4 exim4-base exim4-config exim4-daemon-light
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
Need to get 1224kB of archives.
After this operation, 1008kB disk space will be freed.
Do you want to continue [Y / n]? y
Get: 1 lenny / main postfix 2.5.5-1.1 [1224kB]
Fetched 1224kB in 0s (6060kB / s)
Preconfiguring packages ...

Package configuration

Postfix Configuration: General type of mail configuration

In the first configuration step we will choose Internet Site in this example . Depending on your individual requirements, select the appropriate entry here.

Package configuration
         ┌───────────────────────────────┤ Postfix Configuration ├───────────────────────────────────────────────────────────────────── ─────────┐
         │ Please select the mail server configuration type that best meets your needs. │
         As shown in Fig 
         Configuration No configuration: │ 
         │ Should be chosen to leave the current configuration unchanged. │
         │ Internet site: │ 
         │ Mail is sent and received directly using SMTP. │
         │ Internet with smarthost: │ 
         Is Mail is received directly using SMTP or by running a utility search │ 
         │ as fetchmail. Outgoing mail is sent using a smarthost. │
         │ Satellite system: │ 
         Mail All mail is sent to another machine, called a 'smart host', for delivery. │
         │ Local only: │ 
         │ The only delivered mail is the mail for local users. There is no network. │
         As shown in Fig 
         │ General type of mail configuration: │ 
         As shown in Fig 
         Configuration No configuration │ 
         │ Internet Site │ 
         │ Internet with smarthost │ 
         │ Satellite system │ 
         │ Local only │ 
         As shown in Fig 
         As shown in Fig 
         │ <Ok> <Cancel> │ 
         As shown in Fig 
         └───────────────────────────────────────────────── ──────────────────────────────┘ 

Postfix Configuration: System mail name

In the second step, we enter the mail name of the server. Since the example is a mailing list server, here (the email addresses are then

Package configuration

  ┌───────────────────────────┤ Postfix Configuration ├─────────────────────────────────────────────────────────────────── ────────────────────────┐
  │ The "mail name" is the domain name used to qualify _ALL_ mail addresses without a domain │ 
  │ name. This includes mail to and from <root>: please do not make your machine send out mail
  │ from unless has told you to. │
  As shown in Fig 
  │ This name also wants to be used by other programs. It should be the single, fully qualified │
  │ domain name (FQDN). │
  As shown in Fig 
  , Thus, if a mail address on the local host is, the correct value for this │ 
  │ option would be │
  As shown in Fig 
  │ System mail name: │ 
  As shown in Fig 
  │ ______________________________________________________________________________ </s> 
  As shown in Fig 
  │ <Ok> <Cancel> │ 
  As shown in Fig 
  └───────────────────────────────────────────────── ─────────────────────────────────────────────┘ 

Completion of the installation

(Reading database ... 21540 files and directories currently installed.)
Removing exim4 ...
dpkg: exim4-config: dependency problems, but removing anyway as you request:
 exim4-base depends on exim4-config (> = 4.30) | exim4-config-2; HOWEVER:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.
 exim4-base depends on exim4-config (> = 4.30) | exim4-config-2; HOWEVER:
  Package exim4-config is to be removed.
  Package exim4-config-2 is not installed.
  Package exim4-config which provides exim4-config-2 is to be removed.
Removing exim4-config ...
dpkg: exim4-daemon-light: dependency problems, but removing anyway as you request:
 bsd-mailx depends on exim4 | mail-transport-agent; HOWEVER:
  Package exim4 is not installed.
  Package mail-transport-agent is not installed.
  Package exim4-daemon-light which provides mail-transport-agent is to be removed.
Removing exim4-daemon-light ...
Stopping MTA: exim4_listener.
Removing exim4-base ...
Processing triggers for man-db ...
Selecting previously deselected package postfix.
(Reading database ... 21404 files and directories currently installed.)
Unpacking postfix (from ... / postfix_2.5.5-1.1_i386.deb) ...
Processing triggers for man-db ...
Setting up postfix (2.5.5-1.1) ...
Adding group `postfix '(GID 108) ...
Adding system user `postfix '(UID 104) ...
Adding new user `postfix '(UID 104) with group` postfix' ...
Not creating home directory `/ var / spool / postfix '.
Creating /etc/postfix/
Adding tcp map entry to /etc/postfix/
Adding group `postdrop '(GID 109) ...
setting myhostname:
setting alias maps
setting alias database
changing / etc / mailname to
setting myorigin
setting destinations:,,, localhost
setting relayhost: 
setting mynetworks: [::ffff:]/104 [:: 1] / 128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all
WARNING: / etc / aliases exists, but does not have a root alias.

Postfix is ​​now set up with a default configuration. If you need to make
changes, edit
/etc/postfix/ (and others) as needed. To view Postfix configuration
values, see postconf (1).

After modifying, be sure to run '/ etc / init.d / postfix reload'.

Running new aliases
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
lists: ~ # 

Checking the mail delivery

Whether the mail delivery works now, we check with telnet (as described in TCP port 25 (smtp) access with telnet check ):

ubuntu @ ubuntu: ~ $ telnet 25
Trying ...
Connected to
Escape character is '^]'.
220 ESMTP Postfix (Debian / GNU)
250-SIZE 10240000
250 DSN
250 2.1.0 Ok
250 2.1.5 Ok
354 End data with <CR> <LF>. <CR> <LF>
Subject: Test message

This is a test.

250 2.0.0 Ok: queued as 87D2CDE40A2
221 2.0.0 Bye
Connection closed by foreign host.
user @ ubuntu: ~ $ 

This message is now delivered to the server:

lists: ~ # mail
Mail version 8.1.2 01/15/2001. Type? for help.
"/ var / mail / root": 1 message 1 new
> N 1 Tue Jun 1 10:00 16/545 Test message
& 1
Message 1:
From Tue Jun 1 10:00:49 2010
Subject: Test message
Date: Tue, 1 Jun 2010 10:00:08 +0200 (CEST)
To: undisclosed-recipients :;

This is a test.

& q
Saved 1 message in / root / mbox
lists: ~ # 
Categories: Tutorials

1 Comment

nammoth · November 11, 2018 at 4:31 AM

where is the beginners class to understand what choices to make that works best for the system i don’t know how to create??

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: