Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th November 2011, 11:23
eko_taas eko_taas is offline
Member
 
Join Date: Feb 2011
Posts: 92
Thanks: 2
Thanked 12 Times in 10 Posts
Default How to detele dublicate (received) emails from postfix

Due some server-error, my postfix fetched many times (from same source) and now I would like to delete identical emails (e.g same time and body). For some reason IDs seems to be different (this email has been fetcged 26 times), below header from 1st and last:

Quote:
Return-Path: <getmail@server1.example.com>
Delivered-To: user1@example.com
Received: from localhost (localhost.localdomain [127.0.0.1])
by server1.example.com (Postfix) with ESMTP id 5AE324CC5AC
for <user1@example.com>; Fri, 18 Nov 2011 08:56:23 +0000 (GMT)
X-Virus-Scanned: Debian amavisd-new at server1.example.com
Received: from server1.example.com ([127.0.0.1])
by localhost (server1.example.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id tTYZkRaRG1pF for <user1@example.com>;
Fri, 18 Nov 2011 08:56:05 +0000 (GMT)
Received: by server1.example.com (Postfix, from userid 5001)
id 4F8F04C547A; Sat, 12 Nov 2011 08:16:24 +0000 (GMT)
Delivered-To: unknown
Received: from mail.ISPexample.tld (193.229.0.46) by server1.example.com with
IMAP4-SSL; 12 Nov 2011 08:16:24 -0000
Received: via tmail-2006i.2007-sau for userabc.350; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from emh02.mail.ISPxyz.tld (emh02.mail.ISPxyz.tld [123.456.5.108])
by be55.mail.ISPxyz.tld (Postfix) with ESMTP id C734C2E0D2
for <userabc@be55.mail.ISPxyz.tld>; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from response.sourceforge.com (response.sourceforge.com [74.116.233.70])
by emh02.mail.ISPxyz.tld (Postfix) with ESMTP id 5789F2BD45
for <name1.name2@ISPnamenet.tld>; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from mail5.elabs10.com (10.10.10.55) by response.sourceforge.com (PowerMTA(TM) v3.5r15) id h4q7vc0vd5c0 for <name1.name2@ISPnamenet.tld>; Wed, 20 Jul 2011 01:16:53 -0700 (envelope-from <newsletter@response.sourceforge.com>)
To: <name1.name2@ISPnamenet.tld>
Subject: =?utf-8?Q?10=20Tips=20for=20Better=20Web=20Security,=20a nd=20more!?=
Date: Wed, 20 Jul 2011 01:16:47 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=resources.sourceforge.com; s=s2010001400a; h=Reply-To:From; bh=GIx7hL3KMBzl1APSoi0ypf+chsk=; b=NVHki4frNys+a1JYZTWcnSrj7rHi/HUE/GyomZc1G47GQmnApqwbsYCZZlfJ/owaCWAbouRqRmIqOnXJ2DcxdA==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2010001400a; d=resources.sourceforge.com; b=Roi2JOoglA4l2N/rOSxhxEqbEZfXDaf7+a/EwfOypSTmx64gadcGzReXXzGb1Kf+kPv8cobIJpjwzwM2LyjLu g==; h=Reply-To:From
X-EmailAdvisor: 995842
X-Delivery: Custom 2010001400
Reply-To: sourceforge@resources.sourceforge.com
List-Unsubscribe: <mailto:unsubscribe-6640@elabs10.com?subject=name1.name2@ISPnamenet.tl d>
Content-description: ee00d316c2name1.name2@ISPnamenet.tld...f8!rynof10.pbz!
X-Complaints-To: abuse@elabs10.com
Message-Id: <20110720081728.EE00D316C266@elabs10.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_c1c7d966a30506ff37acc82fb2f01676"
From: "=?utf-8?Q?SourceForge=20Resource=20Newsletter?=" <sourceforge@resources.sourceforge.com>

- - - -

Return-Path: <getmail@server1.example.com>
Delivered-To: user1@example.com
Received: from localhost (localhost.localdomain [127.0.0.1])
by server1.example.com (Postfix) with ESMTP id A48174C005B
for <user1@example.com>; Wed, 20 Jul 2011 08:25:20 +0000 (GMT)
X-Virus-Scanned: Debian amavisd-new at server1.example.com
Received: from server1.example.com ([127.0.0.1])
by localhost (server1.example.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id RCWLDFown5Ye for <user1@example.com>;
Wed, 20 Jul 2011 08:25:02 +0000 (GMT)
Received: by server1.example.com (Postfix, from userid 5001)
id EBBB14C005E; Wed, 20 Jul 2011 08:25:01 +0000 (GMT)
Delivered-To: unknown
Received: from mail.ISPexample.tld (193.229.0.46) by server1.example.com with
IMAP4-SSL; 20 Jul 2011 08:25:01 -0000
Received: via tmail-2006i.2007-sau for userabc.350; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from emh02.mail.ISPxyz.tld (emh02.mail.ISPxyz.tld [123.456.5.108])
by be55.mail.ISPxyz.tld (Postfix) with ESMTP id C734C2E0D2
for <userabc@be55.mail.ISPxyz.tld>; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from response.sourceforge.com (response.sourceforge.com [74.116.233.70])
by emh02.mail.ISPxyz.tld (Postfix) with ESMTP id 5789F2BD45
for <name1.name2@ISPnamenet.tld>; Wed, 20 Jul 2011 11:21:04 +0300 (EEST)
Received: from mail5.elabs10.com (10.10.10.55) by response.sourceforge.com (PowerMTA(TM) v3.5r15) id h4q7vc0vd5c0 for <name1.name2@ISPnamenet.tld>; Wed, 20 Jul 2011 01:16:53 -0700 (envelope-from <newsletter@response.sourceforge.com>)
To: <name1.name2@ISPnamenet.tld>
Subject: =?utf-8?Q?10=20Tips=20for=20Better=20Web=20Security,=20a nd=20more!?=
Date: Wed, 20 Jul 2011 01:16:47 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=resources.sourceforge.com; s=s2010001400a; h=Reply-To:From; bh=GIx7hL3KMBzl1APSoi0ypf+chsk=; b=NVHki4frNys+a1JYZTWcnSrj7rHi/HUE/GyomZc1G47GQmnApqwbsYCZZlfJ/owaCWAbouRqRmIqOnXJ2DcxdA==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2010001400a; d=resources.sourceforge.com; b=Roi2JOoglA4l2N/rOSxhxEqbEZfXDaf7+a/EwfOypSTmx64gadcGzReXXzGb1Kf+kPv8cobIJpjwzwM2LyjLu g==; h=Reply-To:From
X-EmailAdvisor: 995842
X-Delivery: Custom 2010001400
Reply-To: sourceforge@resources.sourceforge.com
List-Unsubscribe: <mailto:unsubscribe-6640@elabs10.com?subject=name1.name2@ISPnamenet.tl d>
Content-description: ee00d316c2name1.name2@ISPnamenet.tld...f8!rynof10.pbz!
X-Complaints-To: abuse@elabs10.com
Message-Id: <20110720081728.EE00D316C266@elabs10.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_c1c7d966a30506ff37acc82fb2f01676"
From: "=?utf-8?Q?SourceForge=20Resource=20Newsletter?=" <sourceforge@resources.sourceforge.com>
tried to google (again for a hint, but found posts only abour dublicate sendings.

Anyone with nice shell-command to help newbee to clean up this, pls
Reply With Quote
Sponsored Links
  #2  
Old 30th November 2011, 18:38
nbhadauria nbhadauria is offline
Member
 
Join Date: Aug 2010
Location: New Delhi, India
Posts: 79
Thanks: 1
Thanked 13 Times in 13 Posts
Send a message via Skype™ to nbhadauria
Default

use maildrop with following option ..


`reformail -D 8000 duplicate.cache`
if ( $RETURNCODE == 0 )
exit
Reply With Quote
  #3  
Old 7th December 2011, 14:37
eko_taas eko_taas is offline
Member
 
Join Date: Feb 2011
Posts: 92
Thanks: 2
Thanked 12 Times in 10 Posts
Default maildrop

Thanks for advice. This will be usefull in future, but does not solve existing mailbox (with 171t emails, mostly dublicates
Reply With Quote
  #4  
Old 7th December 2011, 15:01
nbhadauria nbhadauria is offline
Member
 
Join Date: Aug 2010
Location: New Delhi, India
Posts: 79
Thanks: 1
Thanked 13 Times in 13 Posts
Send a message via Skype™ to nbhadauria
Default

ohh..

you can try to remove all mails with help of some script like..

http://www.perlmonks.org/?abspart=1;...=830438;part=1

http://www.athensfbc.com/imap_tools/...delIMAPdups.pl
__________________
Best
Nitin Bhadauria
Reply With Quote
  #5  
Old 8th December 2011, 06:32
eko_taas eko_taas is offline
Member
 
Join Date: Feb 2011
Posts: 92
Thanks: 2
Thanked 12 Times in 10 Posts
Default tried to get argumets right...

Thanks for links

IMAP-tools were nicely documented and usefull (but in this case did not help).


I was unable to get 2nd link/ "only body"-cleaning up and running...
Tried to see how to use w/o success...

Any nice lisk:
- to see typical command with parameters?
- should I run it in same machine as mail-file is (server)?

Thanks again to help newbee....
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 23:58
Postfix SMTP Auth to Dovecot Not Working -- HELP! Scratchpad Server Operation 6 12th April 2011 14:29
Sending emails with custom FROM email address merisor Installation/Configuration 4 8th February 2010 17:27
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 16:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 16:36


All times are GMT +2. The time now is 12:24.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.