LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2011, 05:50 AM   #1
j-epp
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
Procmail: Forwarding just does not work


Hi,
I've spent pretty much the whole night trying to figure out how I can achieve the following:
If a certain Keyword, say [key], is in the subject line, then the email is forwarded to a list of people.

My recipe (now) looks like this:
Code:
:0
* ^Subject: .*\[key\].*
! my-email@gmail.com
The (verbose) procmail logfile gives me this:
Code:
procmail: [16756] Sun Mar 13 03:20:30 2011
procmail: Assigning "MAILDIR=/fs/home1/student/j/USER/Mailfolder"
procmail: Assigning "DEFAULT=/fs/home1/student/j/USER/Mailfolder/IN-unmatched"
procmail: Assigning "INCLUDERC=/fs/home1/student/j/USER/Procmail/rc.forwarding"
procmail: Match on "^Subject: .*\[key\].*"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi my-email@gmail.com"
procmail: Executing "/usr/sbin/sendmail,-oi,my-email@gmail.com"
procmail: Notified comsat: "USER@:/usr/sbin/sendmail -oi my-email@gmail.com"
From some-email@gmail.com Sun Mar 13 03:20:30 2011
 Subject: Fwd: [key] bla
  Folder: /usr/sbin/sendmail -oi my-email@gmail.com                   3474
Now, that does look like it actually worked, right? Well, the forwarded message never arrived at my-email@gmail.com.
However, if I myself issue
Code:
echo "test"|sendmail -oi my-email@gmail.com
the message "test" arrives at my-email@gmail.com instantly.

Is my recipe wrong in any way? I pretty much copied it from available ones.
It's a university server, so I'm no admin, just a user. How can I figure out whether some setting that the admin made prevents procmail from calling sendmail or whatever?
What commands should I run to give you the info about the system you need to help me with that problem?

Thanks guys!
Jona
 
Old 03-13-2011, 05:54 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Perhaps you can ask them?
They can look in the logfiles to see why the mail isn't sent.

Kind regards
 
Old 03-13-2011, 06:25 AM   #3
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
Try;
Code:
 :0 c
* ^Subject: .*\[key\].*
! my-email@gmail.com
 
Old 03-13-2011, 07:55 PM   #4
j-epp
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
So the extra c did not help, and all the admins would answer to me is that they're not debugging procmail for me, even less so since what I'm trying to do has nothing to do with academic work. Also, I wouldn't know what to ask them for, if I had to say "please include command xyz in smrsh" or something like that, I would, but as it stands I don't even know what's wrong.

That said, I still figured it out. I had a .forward file with these 2 lines:
Code:
\USER
"|/usr/bin/procmail"
The first one just forwards everything to my mailbox, the 2nd one pipes it to procmail. I reversed the order, and surprise, it works now with this .forward file:
Code:
"|/usr/bin/procmail"
\USER
Why, I don't know, the incoming messages obviously got piped to procmail with the 1st version, too. Maybe someone can explain that?

Best
 
  


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
Procmail: forwarding mail to remote mail account Cadmium Linux - Software 2 01-14-2010 01:05 PM
procmail removing headers after forwarding alitrix Linux - Server 4 05-26-2008 05:20 AM
Procmail forwarding loop jusme Linux - Software 10 02-28-2006 12:51 PM
procmail and forwarding samek Linux - Software 3 09-12-2005 08:18 AM
Forwarding messages to another server via procmail handsomeRob Linux - Software 5 01-18-2005 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:57 AM.

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