Version: 1.5 (using KDE 3.1.0) Installed from: compiled sources Compiler: gcc version 3.2.2 OS: Linux (i686) release 2.4.20 Currently there exists an option in the Kmail filtering to apply a filter on 'sent messages'. This was a bit misleading, as I thought that I could use it to rewrite some headers before a mail was actually sent. The reason I need to do this...I have an array of spam filters set up...when one triggers, it moves the message to a Spam folder, creates a Bounce message, and marks the message as replied to. Problem #1: The bounce messages just sit in the outbox until I manually send them. It would be nice to send them immediately, but there's probably already a bug report for that, so I'm merely going to mention it here. Problem #2: KMail doesn't seem to produce bounce messages very well. Oftentimes, the from address is set to MAILER-DAEMON@softhome.net (my mail provider). Other times, it's set to MAILER-DAEMON@spammers.net (where spammers.net is the domain of the mail sender). Other times, it's set to just MAILER-DAEMON, which my SMTP server rejects since there is no domain. Other times, it's set to weird things like 'MAILER-DAEMON@softhome.net,' or 'MAILER-DAEMON@softhome.net;d.'. These don't make it through the SMTP server either. So, I created a new filter to be applied to sent messages, and replace any From equalling 'MAILER-DAEMON' to 'MAILER-DAEMON@softhome.net'. I'm not sure if it's really appropriate to use my mailserver here, but it seems to be the most common thing that Kmail does...so... Well of course the problem is that the filter is applied after messages are sent and moved to the Sent Mail directory...and I need the filter to be applied to outbound messages, before sending. If I'm missing something really obvious or going about this the wrong way, please let me know.
Oh, right, and the other thing about the bounce messages...every once in a while, it will list my address as the failed address, but other times, it will leave the failed address section blank, or put in some of the other recipients of the message. I would think that it wouldn't be effective unless my own address is there, so there needs to be some control over the formatting of bounce messages, or the bounce message generator needs some serious renovation.
In reply to my previous comment only: I found that if I set up the filter actions like so: * Move to folder - Spam * Remove header - To * Add header - To - cshobe@softhome.net * Bounce * Mark as - Replied Then the bounce messages contain my address in the failed addresses section, which is good; I think. But...the saved copy of each message in the Spam folder does not have the rewritten header saved. Instead it's in it's original form. Is this a bug? The other problem here is that I have two mail accounts. Granted, one of them brings in 95% of the spam, but hardcoding the address to 'cshobe@softhome.net' regardless isn't that great. There's also a chance it was sent to a mailing list, though that is rare. So...that's not of too much concern right now, though I imagine it might be for people with more mail accounts. Here's an example: Return-Path: <owner-espritmail-l@PEACH.EASE.LSOFT.COM> Delivered-To: cshobe@SOFTHOME.NET To: ESPRITMAIL-L@PEACH.EASE.LSOFT.COM Precedence: list So here we see that the spammer is sending to their own mailing list, which sends it out to 50 million addresses, keeping the To header intact. Would it not be better for Kmail to use the delivered-to header for the failed addresses section of the bounce messages if it exists?
To answer your question "Is this a bug?" in comment #3: Yes, it's a known bug. Make the Move to folder action the last action to workaround this bug.
Cool, I wasn't sure if it was intentional or not. It does come in rather handy, as I'm able to preserve all of my spam messages in their original form for later review. I hunted around a bit for the bug, but didn't find it...if you could direct me to it such that I could leave a comment there, I would appreciate it. I think it would be ideal to add a 'copy to folder' in addition to the 'move to folder'. That way, if I still wanted to do pre-bounce header reformatting, but also wanted to preserve the original message, then I could copy it to a folder before rewriting the headers. Then send off the bounce and delete the original; thus preserving the current 'buggy' behaviour of 'move to folder' coming first.
Bug 53201: kmail filter action order important for correct function Bug 59327: Feature Request: Copy filter action
*** This bug has been marked as a duplicate of 48938 ***