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 (lists.wefi.net). 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:
  postfix
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 http://http.at.debian.org 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 lists.wefi.net (the email addresses are then mailingliste@lists.wefi.net):

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 root@example.org unless root@example.org 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 foo@example.org, the correct value for this │ 
  │ option would be example.org. │
  As shown in Fig 
  │ System mail name: │ 
  As shown in Fig 
  │ lists.wefi.net ______________________________________________________________________________ </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) ...
Done.
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/dynamicmaps.cf
Adding tcp map entry to /etc/postfix/dynamicmaps.cf
Adding group `postdrop '(GID 109) ...
Done.
setting myhostname: lists.wefi.net
setting alias maps
setting alias database
changing / etc / mailname to lists.wefi.net
setting myorigin
setting destinations: lists.wefi.net, localhost.wefi.net,, localhost
setting relayhost: 
setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/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/main.cf (and others) as needed. To view Postfix configuration
values, see postconf (1).

After modifying main.cf, 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 lists.wefi.net 25
Trying 80.66.32.103 ...
Connected to lists.wefi.net.
Escape character is '^]'.
220 lists.wefi.net ESMTP Postfix (Debian / GNU)
EHLO test.example.com
250-lists.wefi.net
250 PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250 ENHANCEDSTATUSCODES
250-8bitmime
250 DSN
MAIL FROM: test@example.com
250 2.1.0 Ok
RCPT TO: postmaster@lists.wefi.net
250 2.1.5 Ok
DATA
354 End data with <CR> <LF>. <CR> <LF>
Subject: Test message

This is a test.

,
250 2.0.0 Ok: queued as 87D2CDE40A2
QUIT
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 test@example.com Tue Jun 1 10:00 16/545 Test message
& 1
Message 1:
From test@example.com Tue Jun 1 10:00:49 2010
X-Original-To: postmaster@lists.wefi.net
Subject: Test message
Date: Tue, 1 Jun 2010 10:00:08 +0200 (CEST)
From: test@example.com
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: