Solved

Sendmail mail forwarding

Posted on 2010-09-24
6
393 Views
Last Modified: 2012-05-10

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
Comment
Question by:farzanj
  • 3
  • 2
6 Comments
 
LVL 26

Assisted Solution

by:jar3817
jar3817 earned 375 total points
ID: 33753319
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
 
LVL 4

Assisted Solution

by:Tachion
Tachion earned 125 total points
ID: 33753406
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
 
LVL 26

Assisted Solution

by:jar3817
jar3817 earned 375 total points
ID: 33753541
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 31

Author Comment

by:farzanj
ID: 33753586
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
 
LVL 26

Accepted Solution

by:
jar3817 earned 375 total points
ID: 33753788
It's a sendmail milter. This will explain much of it: http://www.mimedefang.org/static/mimedefang-lisa04.pdf
0
 
LVL 31

Author Closing Comment

by:farzanj
ID: 33777879
Thank you experts!  All the recommendations are acceptable.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Guacamole cut and paste issue 3 47
yahoo suddenly spam email 13 35
CentOS create a user with predefined MD5 Hashed password 17 69
Video Streaming 6 56
Utilizing an array to gracefully append to a list of EmailAddresses
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now