LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-27-2017, 02:09 AM   #1
ThickGit
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Rep: Reputation: 0
Procmail fails to forward SOME email


Hi All,

Firstly, my apologies if this is posted twice, I thought I had submitted but I can't find the first post I made so I am doing it again.


I have spent long hours searching for a solution to this but have had little success, partly perhaps because I don't really know what to search for.


I am using a server running Centos 5.11 (upgrading is not an option right now) hosting a number of domains and users per domain. Email for some users is being forwarded to remote addresses but I have found that some email is not being forwarded when sent from some addresses. In particular addresses like "postmaster@..." and "service@..." and is simply left in the mailbox.


My searching has suggested that Procmail is the culprit. A sample of the .procmailrc file for these accounts is as follows :-

Quote:
:0
* !^FROM_MAILER
! harry@example.com
Again, from what I have read the line causing the trouble is "!^FROM_MAILER".


So, is there any way I can add a whitelist type of line that will prevent email from "postmaster@..." etc being affected?


Or am I barking up the wrong tree?


Thanks for reading and any thoughts you might have but please be gentle, my name is "Thick Git". )
 
Old 06-27-2017, 05:18 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
My searching has suggested that Procmail is the culprit. A sample of the .procmailrc file for these accounts is as follows :-

Quote:
:0
* !^FROM_MAILER
! harry@example.com
Again, from what I have read the line causing the trouble is "!^FROM_MAILER".

So, is there any way I can add a whitelist type of line that will prevent email from "postmaster@..." etc being affected?
Please note that FROM_MAILER is regular expression for system messages containing among others mail from postmaster and service,
If you want harry@example.com to be able to receive mail from the above system accounts, then you can delete the recipe.

Regards
 
1 members found this post helpful.
Old 06-28-2017, 03:22 AM   #3
ThickGit
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks for taking the time to enlighten me Bathory.

OK, so that gave me some leads on where to search for more info and a few hours later, yet again, my brain is fried.

So, sorry to press you and take advantage of you kindness but I think it made sense to me in as much as I can simply delete the line that says "* !^FROM_MAILER" and that should be ok.

ie. the .procmailrc file would just read :-

Quote:
:0
! harry@example.com

Please confirm that my reading is correct, I am a bit concerned because I can't afford to mess this up.



Thanks again.
 
Old 06-28-2017, 04:21 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
So, sorry to press you and take advantage of you kindness but I think it made sense to me in as much as I can simply delete the line that says "* !^FROM_MAILER" and that should be ok.

ie. the .procmailrc file would just read :-

:0
! harry@example.com

Please confirm that my reading is correct, I am a bit concerned because I can't afford to mess this up.
You're right about your assumption. Using the above all mail will be forwarded.

Just a FYI: If you're going to forward all email unconditionally, then you can also use a .forward file in the user's homedir. A .procmailrc is more suitable if you're going to filter mail.


Regards

Last edited by bathory; 06-28-2017 at 04:26 AM.
 
Old 06-28-2017, 09:37 PM   #5
ThickGit
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Absolutely excellent Bathory thank you so much for coming back to me.

From my initial tests, editing out the line "* !^FROM_MAILER" appears to have solved my problem.


I am also running Spamassassin on this server and the mail still gets scanned by that before being forwarded. So perhaps the "FROM_MAILER" bit is overkill anyway. I will have to keep an eye on this.


I will also read up about ".forward" though I don't think I will need it, thanks for the heads-up.


Thanks again.
 
  


Reply



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
Sendmail : Procmail : Aliases : .Forward vaibhavs Linux - Newbie 2 08-10-2009 06:50 AM
Procmail- .procmailrc and .forward files Chiragrs Linux - Server 2 05-17-2007 04:37 PM
Using procmail to forward a copy of mails J_Szucs Linux - Software 2 02-09-2006 02:31 PM
Problem with .forward and procmail Dick_Kennedy Linux - Software 0 02-03-2006 04:45 PM
need simple procmail & .forward help BaerRS Linux - Software 1 05-01-2003 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:49 PM.

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