• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

Sendmail mail forwarding


Using sendmail/ procmail, how would you forward emails sent to user joe@localhost to forward to joe@remotehost, unless the email is larger than 1Mb or it has a Subject line that  includes the string “From Uncle Sam”.
0
farzanj
Asked:
farzanj
  • 3
  • 2
4 Solutions
 
jar3817Commented:
It's been a LONG time since I've used procmail...but this should be close:

:0hb
* ^To: joe@localhost
{
      :0HB
      * !^Subject: From Uncle Sam
      * < 1000000
      ! joe@remotehost
}
0
 
TachionCommented:
This is not really answering your question directly, BUT, instead of doing this with procmail, you may want to consider "sieve". It allows you do to that and a whole lot more. See: http://en.wikipedia.org/wiki/Sieve_(mail_filtering_language)
and http://www.fastmail.fm/docs/sieve/

We use this with postfix, but a previous setup used it with procmail. It is a whole lot more user friendly than the archaic procmail language.
0
 
jar3817Commented:
If you're a perl guy you can use Mimedefang too with sendmail. I use this on my mail gateways and it gives you programmatic access to every step of the SMTP exchange.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
farzanjAuthor Commented:
Hi Jar3817,
Yes, I know Perl but could you please give me a more specific answer about how to use Mimedefang.  Never used this particular library.
0
 
jar3817Commented:
It's a sendmail milter. This will explain much of it: http://www.mimedefang.org/static/mimedefang-lisa04.pdf
0
 
farzanjAuthor Commented:
Thank you experts!  All the recommendations are acceptable.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now