best way to forward yesterdays spam
best way to forward yesterdays spam
am 24.08.2005 06:07:23 von netkev
I'm using qmail, procmail and bogofilter on a linux machine with
maildir style folders. I have a single folder that contains about 3000
spam messages. I'd like create a cron job that runs once a day, that
forwards all spam(individually) received yesterday to a specified
address. I'm not sure which tools to use or the wording for exactly
what I want to do. Your tips, help is appreciated.
-Kevin
Re: best way to forward yesterdays spam
am 24.08.2005 16:12:26 von AK
netkev@gmail.com wrote:
> I'm using qmail, procmail and bogofilter on a linux machine with
> maildir style folders. I have a single folder that contains about 3000
> spam messages. I'd like create a cron job that runs once a day, that
> forwards all spam(individually) received yesterday to a specified
> address. I'm not sure which tools to use or the wording for exactly
> what I want to do. Your tips, help is appreciated.
>
> -Kevin
>
Not sure why you would want to forward spam, but if you do.
shell script
#!/bin/sh
dir=spamdir
find $dir -name '*' | while read a; do
[ -f $a ] && cat $a | sendmail -oi -fyouremailaddress
address_to_which_the_message_is_sent.
done
sendmail references the sendmail provided in the qmail bin directory.
AK
Re: best way to forward yesterdays spam
am 24.08.2005 20:34:11 von unknown
Post removed (X-No-Archive: yes)
Re: best way to forward yesterdays spam
am 01.09.2005 23:36:29 von netkev
what about the yesterday requirement? it neds to only forward spam
that was received the day before the current day.
Re: best way to forward yesterdays spam
am 02.09.2005 07:40:16 von AK
netkev@gmail.com wrote:
> what about the yesterday requirement? it neds to only forward spam
> that was received the day before the current day.
>
add -mtime 0 to the find command. This will look for messages arrived
exactly 24 hours ago. You would need to run the cron every one/five
minutes to make sure that all messages are forwarded.
It depends on how the messages are stored, you could add a move of the
file to a separate directory when done at which point the mtime will be
+0 older then one day. In this case you can run the cron job once a day.
#!/bin/sh
dir=spamdir
backup=processed_dir
find $dir -name -mtime +0 '*' | while read a; do
if [ -f $a ]; then
cat $a | sendmail -oi \
-fyouremailaddress_address_to_which_the_message_is_sent
mv $a $backup/
else
echo "do something else"
fi
the \ above is used to make sure that the cat command is a single
contigous line
AK
Re: best way to forward yesterdays spam
am 04.09.2005 22:33:24 von netkev
thanks very much. im going to try it now
Re: best way to forward yesterdays spam
am 05.09.2005 05:33:25 von AK
netkev@gmail.com wrote:
> thanks very much. im going to try it now
>
Oops,
It seems that the sendmail settings got one item messed up.
#!/bin/sh
dir=spamdir
backup=processed_dir
find $dir -name -mtime +0 '*' | while read a; do
if [ -f $a ]; then
cat $a | sendmail -oi \
-fyouremailaddress address_to_which_the_message_is_sent
mv $a $backup/
else
echo "do something else"
fi
AK
Re: best way to forward yesterdays spam
am 22.09.2005 08:11:24 von netkev
ok, i have one more complication. i need to send the spam message as
an text attachment and not as the actual message. Any ideas?
Re: best way to forward yesterdays spam
am 22.09.2005 08:42:38 von Alan Connor
wrote in message
news:1127369484.118450.189920@g14g2000cwa.googlegroups.com
> ok, i have one more complication. i need to send the spam message as
> an text attachment and not as the actual message. Any ideas?
Yes, take your spam and SHOVE IT UP YOUR ASS!
Re: best way to forward yesterdays spam
am 22.09.2005 12:52:24 von Sam
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-2627-1127386350-0002
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Usenet Beavis writes:
> wrote in message
> news:1127369484.118450.189920@g14g2000cwa.googlegroups.com
>
>> ok, i have one more complication. i need to send the spam message as
>> an text attachment and not as the actual message. Any ideas?
>
> Yes, take your spam and SHOVE IT UP YOUR ASS!
Please ignore Beavis. He has been dropped on his head, as a child. As a
result, his diaper is always full when he posts to Usenet.
--=_mimegpg-commodore.email-scan.com-2627-1127386350-0002
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)
iD8DBQBDMozux9p3GYHlUOIRAu8dAJ9G7XEYsZN3L41gi1s0gKtXy+125ACf SUzB
ushRc3h0odSNI+hWissU20Q=
=lw6P
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-2627-1127386350-0002--
Re: best way to forward yesterdays spam
am 22.09.2005 20:22:05 von netkev
actually, im trying to shove the spam up the spammers ass by passing
his spam on to a DBL but hey...help still needed.
Re: best way to forward yesterdays spam
am 26.09.2005 06:27:39 von AK
netkev@gmail.com wrote:
> ok, i have one more complication. i need to send the spam message as
> an text attachment and not as the actual message. Any ideas?
>
You can use formail -I "" and formail -x "" to extract the body and
header respectively and assign their data into a variable. ( I think I
have the correct mix, double check to make sure)
You would then need to use the proper context for a MIME attachment.
This makes it somewhat complicated as you would have to determine the
content length and reflect it in the header of your outgoing mail.
You might be better of using a perl script with an appropriate module to
extract the data in the email and then generate the email to your DBL list.
AK