![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 02:55 PM |
| local mail relay problem in Sendmail | RajaRC | Linux | 0 | 09-13-2004 04: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 10:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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 02:42 AM.. Reason: Refer to whoever created those Sendmail rules ...? |
|
||||
|
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. |
|
||||
|
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 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 /-: |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|