Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-04-2009, 06:22 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
Postfix, forwarding a copy of email based on header

I was wondering if there is a way to forward a copy of an incoming email, to another email, based on a "From:" field or subject on a postfix mail server.

I read a bit on postfix's header_checks, but anything similar to forwarding a copy of email would be the REDIRECT function in header_checks. This function can redirect an email to only one address, and I need to forward it to at least two addresses. REDIRECT doesn't also redirect to an alias.

On this mail server I have postfix and amavis with spamassassin and clamav as filters.

Anyone know of a way to accomplish this?

Last edited by ncicovic; 06-05-2009 at 02:27 AM.
Old 06-04-2009, 11:01 PM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Is the To: header to a local recipient?
Old 06-05-2009, 02:26 AM   #3
LQ Newbie
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Oops, i mean't the "From:" field. From field is not a local recipient.
Old 06-05-2009, 08:06 AM   #4
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
sounds like maybe a job for procmail, maildrop, or some other MDA (Mail Deliver Agent).
This is the home page of the procmail mail processing and SmartList mailing list suites. Procmail can be used to create mail-servers, mailing lists, sort your incoming mail into separate folders/files (real convenient when subscribing to one or more mailing lists or for prioritizing your mail), preprocess your mail, start any programs upon mail arrival (e.g. to generate different chimes on your workstation for different types of mail) or selectively forward certain incoming mail automatically to someone.
maildrop optionally reads instructions from a file, which describe how to filter incoming mail. These instructions can direct maildrop to deliver the message to an alternate mailbox, or forward it somewhere else. Unlike procmail, maildrop uses a structured filtering language.

maildrop is written in C++, and is significantly larger than procmail. However, it uses resources much more efficiently. Unlike procmail, maildrop will not read a 10 megabyte mail message into memory. Large messages are saved in a temporary file, and are filtered from the temporary file. If the standard input to maildrop is a file, and not a pipe, a temporary file will not be necessary.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make postfix send email to another postfix in local network (LAN)? h4k33m Linux - Server 9 06-04-2015 04:33 PM
Postfix - forward email to another address and keep a copy in the mailbox Drognan Linux - Software 3 10-23-2010 12:37 PM
Use web-based email as preferred email app? Short.Cipher Linux - Software 3 07-22-2007 03:23 AM
What email program can work with email header on pop3 server TruongAn Linux - Software 0 01-13-2005 11:48 AM
How do I configure postfix master to forward all email to an email server ? hello321_1999 Linux - Software 1 11-18-2004 04:43 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration