[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vps-mail] reject code in procmail



On Wed, Aug 20, 2003 at 06:59:46PM +0200, Tim Gorter wrote:
> Hello all,
> 
> Just looking at what can be done with procmail and EXITCODE
> 
> as one can set EXITCODE=67 on specific case and cause email to bounce
> as user unknown, or EXITCODE=77 permission denied, one can cause a
> good amount of email just to bounce nicely it seems.
> 
> This being the case (please correct me if I am wrong)
> is there an EXITCODE for SPAM, i.e. could one be created on a VPS1 (or
> VPS2) for a response code saying it is rejected as it looks like SPAM.

What you're asking about would require a change to sendmail (at least
doing it the way you're talking about).

When sendmail hands off locally delivered mail to the LDA (procmail,
in this case), the LDA usually delivers the mail. In the case of a
failure, the LDA gives the mail back to sendmail along with an
exitcode indicating the error.

Procmail has the capacity to explicitly specify the exitcode (e.g.,
what you've put above: EXITCODE=67), but the actual bounce message is
created by sendmail (i.e., sendmail reads the exitcode from procmail
and generates a message to send back to the envelope-sender).

So, to generate alternative bounce messages, you'd need to modify
sendmail to generate those. *It may be possible to make those
modifications in the sendmail.cf file (there are some experts on the
list that may be able to come up with something useful).*

An alternative method I have used once upon a time is to let procmail
generate the bounce message. A good example of this is found in the
spambouncer (http://www.spambouncer.org/) package:

 :0 c: bouncetemp.${BOUNCEPID}.lock
 | (${FORMAIL} -rt \
    -I"From: MAILER-DAEMON@${HOST}.${DOMAIN} (Mail Delivery Subsystem)" \
    -I"Subject: Returned mail: User unknown" \
    -I"Auto-Submitted: auto-generated (failure)" \
    -A"Bcc: ${SPAMERROR}" \
    -A"X-Loop: MAILER-DAEMON@${HOST}.${DOMAIN}";\
     echo "The original message was received at ${SPAMDATE}";\
     echo "from ${SPAMFROM}";\
     echo " ";\
     echo "----- The following addresses had permanent fatal errors -----";\
     echo "${LOGNAME}@${HOST}.${DOMAIN}";\
     echo " ";\
     echo "----- Transcript of session follows -----";\
     echo "... while talking to ${HOST}.${DOMAIN}:";\
     echo ">>> RCPT To:<${LOGNAME}@${HOST}.${DOMAIN}>";\
     echo "<<< 550 Bad recipient";\
     echo "550 ${LOGNAME}@${HOST}.${DOMAIN}... User unknown";\
     echo "Reporting-MTA: dns; ${HOST}.${DOMAIN}";\
     echo " ";\
     echo "Arrival-Date: ${SPAMDATE}";\
     echo "Final-Recipient: RFC822; ${LOGNAME}@${HOST}.${DOMAIN}";\
     echo "Action: failed";\
     echo "Status: 5.1.1";\
     echo "Diagnostic-Code: SMTP; 550 Bad recipient";\
     echo "Last-Attempt-Date: ${SPAMDATE}";\
     ${RM} -f bouncetemp.${BOUNCEPID}) \
     | ${SENDMAIL} -oi -t

This generates an RFC822-looking bounce message, which you can edit
to say whatever you want.

I have not used spambouncer (or bounced spam in any other way) for a
couple of years because I don't think bouncing spam back to the sender
works except in very rare cases. It usually just creates more bounces
and clutter (and verifies that your email address is good).

The most effective way to get your address removed from a list is to
fail during the SMTP handshaking (MAIL TO, RCPT FROM); this is the
domain of sendmail's access.db and has been effective for me in
removing my addresses from so-called legitimate spammers (i.e., paid
mailing list resellers who use their own address for sending).

Milters are also looking promising, though they're still just a little
complex for most practical use (but that's changing very quickly!). I
expect by years end we'll see some nice spam packages that scan mail
during the SMTP DATA transfer and shut down the connection right there
and then, as well as some fancier header scanning to detect spam and
shut it down before it arrives on your server.

Good luck,

Scott
-- 
Scott Wiersdorf
scottw@xxxxxxxxxxxx
======================================================================
Technical questions regarding this list may be sent to
<vps-mail-owner@xxxxxxxxxxxx>. You may request an automated help
response by sending an email with the word 'help' (w/o quotes) in the
BODY of the message (subject is ignored) to <vps-mail-request@xxxxxxxxxxxx>.
======================================================================


Main Index | Thread Index
Match: Format: Sort by:
Search: