The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sendmail relay problem soliberus SUN Solaris 4 03-06-2008 05:03 AM
sendmail + procmail + spamassassin sx3v1l_1n51de SUN Solaris 1 05-20-2005 01:55 PM
local mail relay problem in Sendmail RajaRC Linux 0 09-13-2004 03:53 AM
Sendmail open relay skotapal UNIX for Dummies Questions & Answers 2 11-05-2003 11:12 AM
Sendmail Relay Solaris Security 4 06-28-2002 09:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-23-2008
hardesty hardesty is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
Problem with sendmail procmail spamassasin & relay

I have been working on setting up a mail relay. I have just about everything working except for the procmail part. The configuration is as follows:

Internet -> mailrelay -> mail server
|
spamassassin server

I have spamassassin running on a seperate server and have configured spamc to connect to it.

I have this in my cf file:

MAILER(procmail)dnl
LOCAL_CONFIG
CPprocmail
LOCAL_RULESETS
LOCAL_RULE_0
R$* < @ $=w > $* $#procmail $@ /etc/mail/procmailrc $: $1<@$2.procmail.>$3
R$* < @ $=w. > $* $#procmail $@ /etc/mail/procmailrc $: $1<@$2.procmail.>$3
R$* < @ $=R > $* $#procmail $@ /etc/mail/procmailrc $: $1<@$2.procmail.>$3
R$* < @ $=R. > $* $#procmail $@ /etc/mail/procmailrc $: $1<@$2.procmail.>$3
R$* < @$* .procmail. > $* $1<@$2.>$3 Already filtered, map to original address


In my procmailrc file I have:

DROPPRIVS=yes
VERBOSE=on
LOGFILE=/var/log/procmail.log

:0fw
* < 256000
| /usr/local/bin/spamc
:0
* ^X-Spam-Status: Yes
/dev/null

:0 w
! -oi -f "$@"


My threshold for spamd is 15 at the moment for finding spam.

It looks like sendmail send the new mail off to procmal and process it: I see this in the log:
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
Subject: [SPAM] More length and width
Folder: /dev/null 4175
procmail: [21421] Wed Jul 23 00:05:51 2008
procmail: No match on "^X-Spam-Status: Yes"
procmail: No match on "^^rom[ ]"
procmail: Executing "/usr/lib/sendmail,-oi,-oi,-f,ilan@escortcorp.com,sfair_funw@hardlink.net.procmail"
procmail: Match on "< 256000"
procmail: Executing "/usr/local/bin/spamc"
procmail: Match on "< 256000"
procmail: Executing "/usr/local/bin/spamc"
procmail: [21402] Wed Jul 23 00:05:52 2008
procmail: Assigning "LASTFOLDER=/usr/lib/sendmail -oi -oi -f "
Subject: 20m reward for capture of Osama
Folder: /usr/lib/sendmail -oi -oi -f 1137
procmail: [21421] Wed Jul 23 00:05:52 2008
procmail: Assigning "LASTFOLDER=/usr/lib/sendmail -oi -oi -f "
Subject: Visit to See our Newly Opened Discount Store and KEEP your bucks INTA
Folder: /usr/lib/sendmail -oi -oi -f 25378
procmail: [21441] Wed Jul 23 00:05:54 2008
procmail: Match on "^X-Spam-Status: Yes"
procmail: Assigning "LASTFOLDER=/dev/null"


It is deleting spam Like I would expect. The problem is what it does with the good mail. It seems to try to send it back to sendmail and then I never see it again. I do see procmail jobs running where they have rewritten the address to end in .procmail, but it just sort of disappears.

Any idea on where I could be missing things?

solaris 5.8
sendmail 8.14.2
spamassassin 3.25
procmail 3.22
  #2 (permalink)  
Old 07-25-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
The last command is resubmitting the message to Sendmail, so you are creating a mail loop. If you simply remove that last recipe, Procmail should deliver to $DEFAULT (possibly after consulting the user's $HOME/.procmailrc if present).

Oops, wait a minute, the Sendmail voodoo seems like it might be supposed to work that way, actually. Do you see anything in Sendmail's logs for stuff sent to something.procmail? Where did you get those Sendmail rules, anyway? Probably that site should have some documentation and perhaps troubleshooting tips.

(Also notice that -oi is already present in $SENDMAILFLAGS, so you should not add it explicitly. And you might want to remove those live addresses from the log file excerpt before the spammers scrape them.)

Last edited by era; 07-25-2008 at 01:42 AM.. Reason: Refer to whoever created those Sendmail rules ...?
  #3 (permalink)  
Old 07-27-2008
hardesty hardesty is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
I saw the info a lot of places. Here is one of them:

Using SpamAssassin on a Sendmail relay

All I really want to happen is that sendmail sends to procmail, which checks if it is spam or not and hands the good email back to sendmail who will forward the good mail off to the correct mail server depending on the domain.

If any one knows a better way to do this, I am all ears.
  #4 (permalink)  
Old 08-05-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Upon closer examination of the log, it looks like the $@ argument string is empty for many of those messages. But some others are routed back to sendmail with the .procmail extension added at the end, which should result in their being forwarded to the correct recipient. Is that correct? Again, check Sendmail's logs. Perhaps also add a condition to Procmail to save to a temporary location if $@ is empty.

Code:
ARGS="$@"
:0:
* ARGS ?? ^^$$
temporaryfile.emptyargs
You could add that before the final :0w recipe. Any messages which are saved in the temporaryfile.emptyargs mailbox are basically errors, but perhaps you can diagnose the problem from that.

Referring to the page where you got this set-up, can you verify that you indeed have tabs in the right places in your sendmail.cf file?

Sorry for the late reply, I had forgotten this page open in a browser tab so the site thought I had already seen your response /-:
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0