Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First of all: I'm working on a rented server setup here (hosted at I only have access to my user folder (/home/preparee) folder and an online application that allows me to manage my account, and set up mail aliases.

Now, I want to be able to manage mail forwards for my domain, which is called Preparee is our organisation. In the past, we just added users to mail forwarding manually using the online application. Now, I'm developing a PHP solution to manage our organisation. I wanted to be able to control the mail forwards from PHP, without having to manually visit the online tool every time. I've got all the mail adresses in a MySQL database, seems a bit silly to manually copy them and paste them in the online tool every time.

For example: -> (list of board mail addresses) -> (list of regular members mail addresses)

The admins told me to do the following:

  1. In the online tool, make sure the mail is delivered to "Inbox" (which seems to be the postfix inbox)
  2. In the online tool, define (for example) to forward to
  3. In my home directory, create a file called ".forward+pudding", and make it contain the line-seperated mail addresses the mails should be forwarded too when they arrive at

I was told postfix should try to "match" the incoming mail to these .forward files, and use the most specific .forward file.

Well, this doesn't work. The only thing that works is if I define mail addresses in the regular ".forward" file, but that file just seems to get used if all else fails. I've tried poking around with the user rights to read the .forward files, tried other syntax than line-seperation, but to no avail.

I've checked the postfix documentation, but it is quite archaic, and no info seems to match the restricted environment in which I'm working (only access to home directory, I can't even access the postfix logs).

Anybody with experience with this type of forwarding?

share|improve this question

The behavior is described in in the paragraph of Address Extension:

   For  example,  with  "recipient_delimiter  =  +", mail for
   name+foo is delivered to the  alias  name+foo  or  to  the
   alias  name,  to  the  destinations  listed in ~name/.for-
   ward+foo or in ~name/.forward, to the mailbox owned by the
   user name, or it is sent back as undeliverable.

But to be honest: Ditch that provider. Letting you configure mail forwarding only by .forward files is technology of the last century.

share|improve this answer
Well, it's a provider run by students in their free time, and it's dirt cheap, because it's running on campus bandwidth. And to be fair, they've got a nice web front-end to manage mail forwarding, just nothing to configure it from PHP or any other language. – Jeroen Baert Oct 18 '11 at 13:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.