HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   How to detele dublicate (received) emails from postfix (http://www.howtoforge.com/forums/showthread.php?t=55178)

eko_taas 30th November 2011 10:23

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

nbhadauria 30th November 2011 17:38

use maildrop with following option ..


`reformail -D 8000 duplicate.cache`
if ( $RETURNCODE == 0 )
exit

eko_taas 7th December 2011 13:37

maildrop
 
Thanks for advice. This will be usefull in future, but does not solve existing mailbox (with 171t emails, mostly dublicates

nbhadauria 7th December 2011 14:01

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

eko_taas 8th December 2011 05:32

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....


All times are GMT +2. The time now is 02:00.

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