|
NAMEjmba - junk mail buffering agentSYNOPSISjmba [-d QUEUEDIR] [-m MSGFILE] [-s SUBJECT] [-FbtTv] [-f NUM[,KB]]jmba [-d QDIR] [-e EXPIRY] [-x CMD] -q [-- COMMAND...] jmba -S jmba -[p|h|l|V] DESCRIPTIONjmba is a tool to queue email until the sender's email address has been verified, at which point the original email is delivered.What this means is that when jmba receives an email, it puts that email into a queue instead of delivering it to you, and sends a message to the sender of the email. If the sender of the email responds correctly to jmba's message, the original email is unfrozen from the queue and delivered to you. If they do not, the original email eventually expires and you never see it. jmba is designed to be used in conjunction with a spam filter such as qsf(1); when the spam filter says it thinks an email is spam, it can be passed to jmba, which can then verify whether a real person sent it or not. This works on the assumption that senders of spam won't reply to the email address in the headers, but senders of real email will. The vast majority of spam is sent with forged envelope sender addresses so it always appears to have come from an invalid address. For correct operation, four things are needed:
See the EXAMPLES section for examples of how this can be done. OPTIONSThe jmba options are listed below.
FILESThese files and directories are created automatically if they do not exist and you have not specified an alternative.
EXAMPLESThe following can be added to your .procmailrc file, after any special filtering you already do for mailing lists and such:
#
# Example procmail recipe
#
# Put this AFTER rules for mailing lists,
# so that we don't trip up on them!
#
# First, we'll set up some variables. # JMBAMAINEMAIL="your@own.mail.address" JMBASUBJECT="Email queued by JMBA" TESTPASS=$1 SUBJECT=`jmba -S` # Step 1: # Filter messages only if the pass-through flag # is not set and the message is small. # :0 * ! TESTPASS ?? JMBAPASSTHROUGH * ! > 500000 { # Step 2: # Discard any looping mail. # :0 * $ ^X-Loop: $JMBAMAINEMAIL /dev/null # Step 3: # Deal with any bounces. # :0 * ^FROM_MAILER { :0 Bw * $ SUBJECT ?? .*$JMBASUBJECT | jmba -v -b :0 Bw * $ ^X-Loop: $JMBAMAINEMAIL | jmba -v -b } # Step 4: # Pass any sender's replies straight to the program. # :0 w * ! ^FROM_DAEMON * $ SUBJECT ?? .*$JMBASUBJECT | jmba -v -s "$JMBASUBJECT" # Step 5: # Check whether message is spam. # :0 wf | qsf -ra # Step 6: # Drop potential spam into the # queue, and send the reply email. # :0 * ! ^FROM_DAEMON * !$ SUBJECT ?? .*$JMBASUBJECT * ! ^X-Spam: NO { # Generate the reply. :0 wf | jmba -t -v -s "$JMBASUBJECT" :0 Ha { # Discard unaddressed responses. :0 * ! ^To /dev/null # Add our loop catching header. :0 wf | formail -A "X-Loop: $JMBAMAINEMAIL" # Add our From: address. :0 wfa | formail -I "From: $JMBAMAINEMAIL" # Send the reply. :0 wa | $SENDMAIL $SENDMAILFLAGS -t } } } # Step 7: # Teach the spam filter that passed-through # messages are not spam. # :0 wc * TESTPASS ?? JMBAPASSTHROUGH | qsf -Ma # # End of example. # Don't forget to add "0 * * * * jmba -v -q" # to your crontab! # Note that the above recipe can be generated by doing jmba -p > SOME-FILE. Then, add the following to your crontab(5) using the crontab -e command, to deliver any queued messages that have been verified once an hour:
0 * * * * jmba -v -q
If you do not want to use qsf(1) as your spam filter, replace qsf -ra in the example procmail recipe above with a command that adds a header saying whether the email is spam, replace qsf -Ma with a command that trains the spam filter to accept the given email on standard input as non-spam, and replace the * ! ^X-Spam: NO line in step 6 with a rule that uses your spam filter's inserted header to cause step 6 to be skipped if the email is not spam. For more on procmail(1) recipes, see the procmailrc(5) and procmailex(5) manual pages. For more on command scheduling, see the crontab(1) and crontab(5) manual pages. NOTESIf the full path of procmail is not found at compile time, then it will be called without a path. This means that users who are not supposed to have shell accounts, but who have write access to a directory in the default $PATH (such as ~/bin on some systems), could upload a fake procmail and gain shell access.Also, some systems do not set $PATH when running cron jobs. It is therefore advisable to supply the full path when specifying a procmail command with the -q -- COMMAND option. The default command contains the full path if no warning was generated at compile time. This same problem exists with formail, which is called by jmba, but this can only be overcome if the full path to formail is correctly determined at compile time. AUTHORThe project maintainer is:Andrew Wood <andrew.wood@ivarch.com>
http://www.ivarch.com/ Credit is also due to: Ondrej Suchy
(provided Czech translation and code suggestions) Nick Rosier
(suggested logging) Project home page: http://www.ivarch.com/programs/jmba.shtml
BUGSIf you find any bugs, please contact the author, either by email or by using the contact form on the web site.SEE ALSOprocmail(1), crontab(1), procmailrc(5), procmailex(5), crontab(5), qsf(1)LICENSEThis is free software, distributed under the ARTISTIC license.
Visit the GSP FreeBSD Man Page Interface. |