LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-15-2006, 06:45 PM   #1
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Rep: Reputation: 15
procmail filtering for nonexistant user


I'm trying to set up a procmail filter for a user that doesn't exist on the system. Is this possible?

I wrote the filter using my account and it works perfectly. I had to create a .forward file to send my incoming mail to procmail.

In the end though I want this filter to work when mail is sent to data@host.com. Data is not a user on my system. I tried setting up a universal /etc/procmailrc file but mail is getting bounced back as undeliverable. Procmail appears to be installed setuid root.

I tried setting up a user account for data and copied the files into data's home directory. I changed the paths to reflect the move. Mail is delivered but never gets processed by procmail. I set up a .forward file just like I had for my account but it seems to be bypassed. If I manually run the mailbox through procmail it works as expected.

I'd prefer to set up a universal recipe instead of setting a user account up if thats possible. Either way though as long as it works that's what counts. Thanks for any help.


.forward
Code:
"|IFS=' ' && exec /usr/bin/procmail || exit 75 # data"
.procmailrc
Code:
LOGFILE=/home/data/procmail.log
VERBOSE=1

:0 :
# If there is an attachment run the shell script
* Content-Type: multipart/mixed
| munpack.bash

:0
#| Else reply requesting the expected files
| (formail -brt  -I 'From: <data@host.com>' ; cat $HOME/mail.msg) | $SENDMAIL -t
 
Old 07-15-2006, 09:13 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I use a global /etc/procmailrc for some stuff - I have sendmail invoke procmail directly so I don't need to use a forward file. Can you re-configure sendmail to do this as well? In my sendmail.mc (that sendmail.cf is built from) I have the following (I've stripped out the non-mailer stuff):
Code:
FEATURE(`local_procmail',`/usr/bin/procmail')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
MAILER(procmail)dnl
 
Old 07-19-2006, 11:29 PM   #3
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Original Poster
Rep: Reputation: 15
I created the sendmail.mc file modeled after yours. I then ran
Code:
sudo m4 sendmail.mc > sendmail.cf
Which created a sendmail.cf file. I copied that into /etc. (I couldn't find anything that stated where to place it or what to edit to tell sendmail to look at the file.) It's still a no go.

The way this will work in production is all mail will be processed by postfix. Depending on what domain it is addressed to it will either be forwarded to another server of forwarded to another port on the localhost that exim is listening on. I am concerned with the latter. The e-mails coming in to exim should be run through my procmail recipe. I'm not sure if that changes anything, I'm new to working with mail servers, MTA and the like, but I realized I hadn't included it in the first post.
 
Old 07-19-2006, 11:36 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Ah - using postfix does change things. Postfix is an alternative to Sendmail so the sendmail.cf file (normally kept in /etc/mail) won't be applicable. There's an article called How to get Dspam, Postfix, and Procmail to play well together which might help though.

Sorry I don't have more info on Postfix...
 
Old 10-06-2006, 07:33 PM   #5
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Original Poster
Rep: Reputation: 15
It's been a while but I just realized I never posted my results here. The problem was that I had written the script with my user account which had access to the shell. The user account that I had to move this to did not. I had to had the following line in .procmailrc to get the script to execute when used under that account

Code:
SHELL=/bin/bash
 
  


Reply

Tags
procmail


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
URL filtering by user babysnake Linux - Security 2 07-13-2006 01:27 AM
Filtering outgoing mail through Procmail SlackDaemon Linux - Newbie 2 06-22-2006 07:05 AM
Procmail Filtering Using a Full Subject Line lmcilwain Linux - Software 3 02-08-2006 01:07 PM
Procmail not filtering WiWa Linux - Networking 0 07-06-2004 02:22 PM
Procmail not filtering tomac Linux - General 0 05-26-2004 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:31 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