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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

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

  




 

 

Postfix Documentation
Previous Page Home Next Page

Autoreplies

In order to set up an autoreply for virtual recipients while still delivering mail as normal, set up a rule in a virtual alias table:

/etc/postfix/main.cf:
    
virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual:
    [email protected] [email protected], [email protected]@autoreply.
mydomain.tld

This delivers mail to the recipient, and sends a copy of the mail to the address that produces automatic replies. The address can be serviced on a different machine, or it can be serviced locally by setting up a transport map entry that pipes all mail for autoreply. mydomain.tld into some script that sends an automatic reply back to the sender.

DO NOT list autoreply. mydomain.tld in mydestination!

/etc/postfix/main.cf:
    
transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
    autoreply.
mydomain.tld  autoreply:

/etc/postfix/master.cf:
    # =============================================================
    # service type  private unpriv  chroot  wakeup  maxproc command
    #               (yes)   (yes)   (yes)   (never) (100)
    # =============================================================
    autoreply unix  -       n       n       -       -       pipe
        flags= user=nobody argv=/path/to/autoreply $sender $mailbox

This invokes /path/to/autoreply with the sender address and the [email protected] recipient address on the command line.

For more information, see the pipe(8) manual page, and the comments in the Postfix master.cf file.

Postfix Documentation
Previous Page Home Next Page