Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to forward all messages received on one server to another server (Exchange box). I know how to forward for an individual, but I am unable to forward for all addresses to their respective destination. The usernames are all the same, as is the domain name.

I've seen tons of documentation online for user-based procmail files, but global procmailrc documentation is scarce.

Again, this is for a GLOBAL procmailrc file that will affect all users. None of the recipients have home directories on the Linux box for which I would create individual procmail files (which is also an administrative nightmare).

EDIT:

To sum up - how do I create a global procmailrc that forwards mail for all users?

Edit 2 (Environment): Debian Squeeze Postfix Microsoft Exchange 2003

share|improve this question
    
Sorry to bother you again. What is the question? Questions normally end in a question mark. –  mailq Oct 19 '11 at 16:26
    
question restated at the end, but laid out in the first sentence –  Larry G. Wapnitsky Oct 19 '11 at 17:24

2 Answers 2

Do you need the messages delivered on the Linux host in the first place? If not, you could set up your MTA so it would simply forward all mail to the Exchange box without trying to deliver it locally, hence without any need for local forwarding via procmail.

share|improve this answer
    
The ultimate goal is to have the Linux box strip attachments of a certain size, save them to an FTP site, then forward the message along to the original recipient with a link to the FTP site. I've posted this question before and apparently wasn't clear enough. I've also been recommended to use Python Milter, but don't have the time to learn Python right now. –  Larry G. Wapnitsky Oct 19 '11 at 13:12
    
You would not need procmail for this. There are plenty similar setups with walkthroughs on the net, here is one using simple postfix content filters to do the job. Since you mention milters, you are probably using Sendmail (it is good style to describe your software environment instead of letting your readers make guesses BTW) - a similar setup should be possible with Sendmail as well, but presumably at a much greater level of complexity. –  the-wabbit Oct 19 '11 at 21:28
    
I am using postfix. THe only reason I mentioned milters was they were suggested as an idea to me a while back. Environment specs added above –  Larry G. Wapnitsky Oct 20 '11 at 12:05
    
I see. So what's wrong with content filters then? –  the-wabbit Oct 20 '11 at 12:16
    
syneticon - i'm new to the linux-side of mail processing, so I'm going with what I've been able to figure is the best solution first. I could be very wrong –  Larry G. Wapnitsky Oct 20 '11 at 12:34

Oh now I see. That's an easy one. Reading the manual of procmail it states:

   If  no rcfiles and no -p have been specified on the command line, proc-
   mail will, prior to reading $HOME/.procmailrc, interpret commands  from
   /etc/procmailrc  (if  present).   Care  must  be  taken  when  creating
   /etc/procmailrc, because, if circumstances permit, it will be  executed
   with  root  privileges  (contrary  to  the  $HOME/.procmailrc  file  of
   course).

And in that /etc/procmailrc you forward mails as in every procmailrc:

:0
!some.user@example.local
share|improve this answer
    
I saw that, but it still doesn't explain how to universally forward a message. –  Larry G. Wapnitsky Oct 19 '11 at 19:52
    
@LarryG.Wapnitsky Better that way? –  mailq Oct 19 '11 at 20:19
    
so I'd still have to manually enter EVERY e-mail address? –  Larry G. Wapnitsky Oct 20 '11 at 12:04
    
@LarryG.Wapnitsky Who said that? You have full power of procmail and can read configuration of files, databases, whatever. But that wasn't the question. –  mailq Oct 20 '11 at 12:13
1  
This is not (!!!) a forum, it is a Q&A site. A question gets answered and is archived. If you have follow-up questions, you should post them as new questions. The Q&A principle works well because it is different from a forum where technical problems would cause discussions which tend to get off-topic soon. –  the-wabbit Oct 20 '11 at 22:05

Your Answer

 
discard

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.