Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Sending sendmail(or other program) a mail queue??

Posted on 2004-08-19
6
204 Views
Last Modified: 2010-03-18
hi,

Unfortunatly, somehow our spamassasin got configured to append all spam to a file named spam in the /var/spool/mqueue/ folder (if anyone could tell me why this occured that would be helpful too) and it unfortunatly took us until now to realise we were loosing emails.  I was wondering therefore if there was anyway we could send this spam file to the mail queue so it may be processed correctly and we can get our emails back...

Thanks

Jon
0
Comment
Question by:busbyjon
6 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 84 total points
ID: 11844079
If all of the data is in a single file it probably is no longer is a format suitable for re-injecting into the mail stream. However, it the data was placed in the file in mbox format you should be able to point a mail client at the file and manually forward each message to its origninal recipient. If the content is in mbox format each message will start with a Unix From line, similar to:

From root@wilowisp.entrophy-free.net  Sun Aug 18 04:02:04 2004

which will be followed by the mail headers and message body. A blank line separates each each message from the next.
0
 
LVL 14

Assisted Solution

by:pablouruguay
pablouruguay earned 83 total points
ID: 11846574
i have this problem year ago, and i solve with the jlevie method and i use the mutt mailer client.

if you use MH you dont have to use this process because mail are separeted in single files and are uncompatible for resend like jlevie say.
0
 
LVL 1

Assisted Solution

by:master_chris
master_chris earned 83 total points
ID: 11899195
SPAM ASSASIN SUCKS.. WE CREATED OUR OWN PROCMAILRC... IT LOOKS LIKE THIS.

iNCLUDERC=/etc/procmail/sanitizer.procmail

# Remove any Duplicate Emails
:0 Wh: msgid.lock
| formal -D 8192 msgid.cache

#<---- BEGIN DYNAMIC FILTER ---->
# Create Dump Directory for Emails
DUMP_DIR=/tmp/dynamic_ip

:0 Wic
* ? test ! -d $DUMP_DIR
| mkdir $DUMP_DIR

:0
* (^TO|^Subject:.*)IP_UP_DYNAMIC
$DUMP_DIR
#<---- END DYNAMIC FILTER ---->

# Strip Procmail Crap
:0
* ? formail -x"From" -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" -x"To:" \
    | egrep -is Procmail
{
   :0
   /dev/null
}

# Redirect common virus attachments inc. zipped versions
:0 B
* name=.*\.(pif|scr|com|exe|vbe|hta|bat|dll|wsf|cmd)
    {
        :0
        /var/spool/mail/spam.virus

    }
:0 B
* name=.*(judge|Part-2|document|details|msg|data|transfer|letter|abuse|message|o
hyeah).*\.(zip)
    {
        :0
        /var/spool/mail/spam.virus

    }

}

# Begin Blacklist Rules ( Using From Field )
:0
* ? formail -x"From" -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" -x"To:" \
    | egrep -is -f /etc/procmailrc_black_from.lst
{
  :0
  /var/spool/mail/spam
}

# Begin Blacklist Rules ( Using Subject Field )
:0
* ? formail -x"Subject" -x"Subject:" \
    | egrep -is -f /etc/procmailrc_black_subject.lst
{
  :0
  /var/spool/mail/spam
}

# Begin Blacklist Rules ( Using Entire Body )
:0 B:
* ? formail \
| egrep -is -f /etc/procmailrc_black_content.lst
{
  :0
  /var/spool/mail/spam
}

:0 B:
* ? formail \
| /bin/cat - | /usr/bin/tr -d '\r\n' \
| egrep "\<(IMG|img).*(src|SRC)\=.*(http\:\/\/).*\>"
{
   :0 B:
   * ? formail \
   | /bin/cat - | /usr/bin/tr -d '\r\n' \
   | egrep -v -f /etc/procmailrc_black_imgex.lst
   {
      :0
      /var/spool/mail/spam
   {
}
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question