Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I use procmail to handle some serverside mail processing. I am trying to setup one email address on a server that support multiple domains (in the example below, and I want mail sent to to go to bob and mail sent to to go to sara.




The above recipe seems to work quite well in that it catches incoming mail to and forwards it to bob.

However, instead of forwarding mail to to sara, it creates a file in /home/user called sara.

What am I doing wrong on this?

share|improve this question
The fundamental problem is "don't do that". See – tripleee Oct 19 '11 at 12:13
and the downvote is for ...? – warren Jun 19 '13 at 17:37
up vote 2 down vote accepted

You're delivering to a local file, not forwarding the message on to users. Also (as you pointed out in your comment) you aren't carbon-copying the message, so delivery stops after the first matching rule.

# 'c'opy the message to deliver it twice.
# ! to forward the message
:0 c
! bob

! sara

The prcomailrc manpage says:

Anything else will be taken as a mailbox name (either a filename or a directory, absolute or relative to the current directory (see MAILDIR)). If it is a (possibly yet nonexistent) filename, the mail will be appended to it.

The best way to debug procmail issues is to set verbose and logfile in your .procmailrc. Examining the logfile will go a long way toward revealing why procmail is acting a particular way.

EDIT: Updated with carbon-copy info based on OP comment.

share|improve this answer
Yes, without the bang (!) symbol, the recipe says to deliver to local file. – Robert Novak Mar 7 '11 at 22:11
Also, you might want to use something like ^ to be more precise in your targeting. The recipes as listed (I think) will match any header containing or, including the subject. – Robert Novak Mar 7 '11 at 22:12
thanks! the other component I need is a ` c` after the :0, so it not looks like :0 c. – warren Mar 7 '11 at 22:23

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.