Ubuntu – the difference between mail-server^ task and the mail-stack-delivery package

mail-servermetapackages

What is the difference between the mail-server^ task and the mail-stack-delivery package?

Best Answer

Visit the mail-stack-delivery package page and download the tar.gz containing the Debian/Ubuntu packaging.

Open the debian/control file and look for lines beginning with Provides: like this one:

Package: dovecot-imapd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, dovecot-core (= ${binary:Version}), ucf (>= 2.0020)
Provides: imap-server
Description: secure IMAP server that supports mbox, maildir, dbox and mdbox mailboxes

You can see that dovecot-imapd provides a package named imap-server, which is a virtual package, as defined in the Debian Policy Manual:

Sometimes, there are several packages which offer more-or-less the same functionality. In this case, it's useful to define a virtual package whose name describes that common functionality. (The virtual packages only exist logically, not physically; that's why they are called virtual.) The packages with this particular function will then provide the virtual package. Thus, any other package requiring that function can simply depend on the virtual package without having to specify all possible packages individually.

Edit: mail-server^ is not a metapackage, it's a task as defined in /usr/share/tasksel/**/*.desc

Apt can understand task if the "^" is appended to the task name but the installation process is a bit different from what tasksel is doing.

Visit Should I use tasksel, tasks in APT or install regular metapackages? for a complete description of both installation processes.

In terms of installed packages, you can easily dry-run apt-get install for both mail-server^ and mail-stack-delivery:

sudo apt-get install -s mail-server^
sudo apt-get install -s mail-stack-delivery

The task mail-server will install:

bsd-mailx
dovecot-core
dovecot-imapd
dovecot-pop3d
libgpgme11
libpth20
libtokyocabinet8
mutt
postfix
procmail
ssl-cert

But mail-stack-delivery will install those packages instead:

dovecot-core
dovecot-imapd
dovecot-managesieved
dovecot-pop3d
dovecot-sieve
mail-stack-delivery
postfix
ssl-cert

I hope that answers your initial question.

Related Question