Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Postfix Documentation
Previous Page Home Next Page

Direct delivery without the local delivery agent

Postfix can be configured to deliver mail directly to maildrop, without using the local(8) delivery agent as an intermediate. This means that you do not get local aliases(5) expansion or $HOME/.forward file processing. You would typically do this for hosted domains with recipients that don't have UNIX home directories.

The following example shows how to use maildrop for some.domain and for someother.domain.

 1 /etc/postfix/
 2     maildrop_destination_recipient_limit = 1
virtual_mailbox_domains = some.domain someother.domain
virtual_transport = maildrop
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
virtual_alias_maps = hash:/etc/postfix/virtual_alias
 8 /etc/postfix/virtual_mailbox:
 9     [email protected]        ...text here does not matter...
10     [email protected]        ...text here does not matter...
11     [email protected]   ...text here does not matter...
13 /etc/postfix/virtual_alias:
14     [email protected]           postmaster
15     [email protected]      postmaster
  • Line 2 is needed so that Postfix will provide one recipient at a time to the maildrop delivery agent.

  • Line 3 informs Postfix that some.domain and someother.domain are so-called virtual mailbox domains. Instead of listing the names in you can also list them in a file; see the virtual_mailbox_domains documentation for details.

  • Line 4 specifies that mail for some.domain and someother.domain should be delivered by the maildrop delivery agent.

  • Lines 5 and 8-11 specify what recipients the Postfix SMTP server should receive mail for. This prevents the mail queue from becoming clogged with undeliverable messages. Specify an empty value (" virtual_mailbox_maps =") to disable this feature.

  • Lines 6 and 13-15 redirect mail for postmaster to the local postmaster. RFC 821 requires that every domain has a postmaster address.

The vmail userid as used below is the user that maildrop should run as. This would be the owner of the virtual mailboxes if they all have the same owner. If maildrop is suid (see maildrop documentation), then maildrop will change to the appropriate owner to deliver the mail.

Note: Do not use the postfix user as the maildrop user.

    maildrop  unix  -       n       n       -       -       pipe
      flags=ODRhu user=vmail argv=/path/to/maildrop -d ${recipient}

The pipe(8) manual page gives a detailed description of the above command line arguments, and more.

If you want to support [email protected] style addresses, use the following instead:

    maildrop  unix  -       n       n       -       -       pipe
      flags=ODRhu user=vmail argv=/path/to/maildrop 
      -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}

The mail is delivered to ${user}@${nexthop} (match key for maildrop userdb lookup). The ${extension} and the other address components are available to maildrop rules as $1, $2, $3, ... and can be omitted from or ignored by maildrop when not needed.

Postfix Documentation
Previous Page Home Next Page