Bug 61592 - Filtering needs an option for 'outbound messages' as the target
Summary: Filtering needs an option for 'outbound messages' as the target
Status: RESOLVED DUPLICATE of bug 48938
Alias: None
Product: kmail
Classification: Unclassified
Component: general (show other bugs)
Version: 1.5
Platform: Compiled Sources Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-23 23:08 UTC by Casey Allen Shobe
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Allen Shobe 2003-07-23 23:08:32 UTC
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.
Comment 1 Casey Allen Shobe 2003-07-23 23:11:17 UTC
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. 
Comment 2 Casey Allen Shobe 2003-07-23 23:33:17 UTC
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? 
Comment 3 Ingo Klöcker 2003-07-24 10:04:07 UTC
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. 
Comment 4 Casey Allen Shobe 2003-07-24 10:18:17 UTC
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. 
Comment 5 Ingo Klöcker 2003-07-24 13:57:23 UTC
Bug 53201: kmail filter action order important for correct function 
Bug 59327: Feature Request: Copy filter action 
Comment 6 Ingo Klöcker 2004-11-08 22:16:40 UTC

*** This bug has been marked as a duplicate of 48938 ***