PDA

View Full Version : autoreply not to Spammer


vistree
3rd December 2006, 14:15
Hi, is it possible to modify the autoresponder-script in a way, that SPAM-detected mails are not included (no autoresponder for email containing the rewrite subjet from the user-spamfilter-dialog)?

Regards
Kai

till
4th December 2006, 11:01
Yes. You can try to modify the autoresponder procmail recipe in /root/ispconfig/isp/conf/

vistree
4th December 2006, 16:53
Thank you till for reply!
I had a look at the autoresponder.rc.master - but thing that this job is to big for me!
Did anyone allready tried this? I think this could be a matter of general intesest, as every autoreply to a Spammer (which mostly use not-existing-email-adresses) causes in an additonal mail in the users inbox: a not delivered notice from postfix.

Kai

falko
5th December 2006, 18:37
You could put this at the beginning of the autoresponder file:

:0:
* ^X-Spam-Status: Yes

so that it looks like this:

:0:
* ^X-Spam-Status: Yes

SHELL=/bin/sh # for other shells, this might need adjustment
EMAIL=`formail -zxTo:`
[...]I haven't tested this, but it could work.

vistree
5th December 2006, 23:11
Hi Falko,
thank you for that code - I already put it in a testaccount. Normals Mails are still replied. I wait until tomorrow and post the result of incomming spam.

Regards
Kai

vistree
6th December 2006, 17:51
Hi Falko an forum,
the solution code

:0:
* ^X-Spam-Status: Yes

does not work for me ...
Is it enough just to include this code in the autoresponder.rc or must there be any other changes for example in the master.cf of postfix?!
Could it work with a smal change in the code? e.g.

* !^X-Spam-Status: Yes

instead

Regards
Kai

falko
6th December 2006, 19:08
Is it enough just to include this code in the autoresponder.rc or must there be any other changes for example in the master.cf of postfix?!It must be in your .autoresponder.rc only (and also in the template in /root/ispconfig/isp/conf, otherwise ISPConfig will overwrite your changes).

Could it work with a smal change in the code? e.g.

instead

Regards
Kai
Yes. Try it. This tutorial might be interesting for you: http://www.howtoforge.com/procmail_tips_recipes

vistree
16th December 2006, 18:41
Testing around a little bit, we found a very simple solution. The job was to insert Falkos code at the correct place:

We modified the file:
/root/ispconfig/isp/conf/autoresponder.rc.master

inserting the line after "# Don't reply to SPAM"


SHELL=/bin/sh # for other shells, this might need adjustment
EMAIL=`formail -zxTo:`

:0 Whc: vacation.lock
# Perform a quick check to see if the mail was addressed to us
#* $^To:.*\<$\LOGNAME\>
# Don't reply to daemons and mailinglists
* !^FROM_DAEMON
# Don't reply to SPAM
* !^X-Spam-Status: Yes
# Mail loops are evil
* !^X-Loop: ${EMAIL}
| formail -rD 8192 {PFAD}/.vacation.cache

:0 ehc # if the name was not in the cache
| (formail -rI"From: {EMAIL_ADDRESS}" -I"Precedence: junk" \
-A"X-Loop: ${EMAIL}" ; \
cat {PFAD}/.vacation.msg \
) | $SENDMAIL -oi -t


Of course, the code effect only accounts marked for autoreply after this modification. So for existing autoreplies just disable and enable again using one of the possiblities offert by ISPConfig (domain-control or mailuser-login)

Have a nice weekend
Kai