--- Dale Kiefling <http://www.gmail.com/~daleki> wrote: > Hi Robert, > > Thanks very much for your help with fetchmail and procmail. I have not > gotten logging to setup yet, but I do have the quarantine working again, so > at least I see things there. > > The fetchmail technique is working for the most part, but we are running > into 2 issues: > 1. The amount of mail fetched is less than what is in the remote mailbox, > which is wierd because fetchmail will give a count like 1 of 340 as it is > fetching when 340 is the correct number, but when it is complete there are > only like 220 emails? I forgot what I set the log level to. Did I set it to "VERBOSE=on"? That would be ideal. If a message is a repeat, it will deliver the mail to /dev/null. You might also add LOG="$FILENO " early in the script to find out what message number is being processed. > Is it possible Imap is counting these as threads or > something? I haven't used "imap" in a long time, so I don't know. I would doubt that it does threading. > Or are some getting rejected as dupes? This is more likely. You might also add something like this before the dupes are checked in the procmail script: :0fhw *!^message-id: |formail -a Message-ID: which will add a unique message ID if one doesn't exist. (Some mailers are brain-dead and don't add a Message-ID field.) > I looked and only one > seems to be treated as spam. > > 2. The 'sent' folder was not included in the fetch which makes sense, but > the client wants that transferred, so I added it as a fetchmail folder > option which seemed to work. The issue was I think it put the sent mail in > the inbox with everything else? Is there a way to map it to inbox.sent or > something like that? You mean, on the receiver side? There may already be a header field which indicates whether the message has been read already or not. If not, you could do some script hacking. Have the procmail script add a special header field (perhaps "Status: OR", which my mailer seems to mark read messages as) when you know the mail received will be from the "sent" folder. You'll want to disable this after you've delivered the "sent" folder: :0fh |formail -A "Status: OR" Then, give the receiver his own procmail script. (I don't know if your mailer supports that or not.) Then have the receiver's procmail script check for :0: *^status:.*r /var/mail/$LOGNAME/sent (or whereever the sent folder is stored); obviously, if the mailer uses something other than "status:", you'll want to check for that instead. > Cheers, > Dale