Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This should forward emails that are ment for *@letscall.nl to a IMAP-subdir.
Don't look at the procmail-rules, those work fine. I just wanted to test something.
Orginal email (~/testmail.txt):
Code:
Return-Path: <alitrix@gmail.com>
X-Original-To: alitrix@localhost
Delivered-To: alitrix@localhost
Received: by alitrix.nl (Postfix, from userid 1007)
id 3011362C1D0; Sat, 24 May 2008 16:36:30 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on r1k7s19.kdiss.com
X-Spam-Level: **
X-Spam-Status: No, score=2.1 required=5.0 tests=HTML_MESSAGE,
HTML_SHORT_LENGTH,MISSING_SUBJECT,NO_RECEIVED,TO_CC_NONE autolearn=no
version=3.1.4
Received: from r1k7s19.kdiss.com (localhost [127.0.0.1])
by alitrix.nl (Postfix) with ESMTP id 0FA6762C082
for <alitrix@localhost>; Sat, 24 May 2008 16:36:25 +0200 (CEST)
Envelope-to: ali@letscall.nl
Delivery-date: Sat, 24 May 2008 10:31:52 +0200
Received: from mail.letscall.nl [81.4.97.190]
by r1k7s19.kdiss.com with POP3 (fetchmail-6.3.4)
for <alitrix@localhost> (single-drop); Sat, 24 May 2008 16:36:25 +0200 (CEST)
Received: from an-out-0708.google.com ([209.85.132.246])
by blade24.geenpunt.nl with esmtp (Exim 4.63)
(envelope-from <alitrix@gmail.com>)
id 1JzpAN-0000qQ-DS
for ali@letscall.nl; Sat, 24 May 2008 10:31:51 +0200
Received: by an-out-0708.google.com with SMTP id c38so237616ana.3
for <ali@letscall.nl>; Sat, 24 May 2008 01:31:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
bh=rlbtInY6KRTZg0R8gzXdHCminImaA5sLZtcOoPQAAD4=;
b=c2CdtRt/vaakBxGxaz6Iiyfr2FErj8dffVPizEapTaJtG1mssK1oj29gb0js2IUxtMHmZQDSWRsm4t0ddTco776JT2IKmS/JNZPWwbL9XfwaO3BT2sfbOkKKgsXYQVPN/l88MYTsGAaxilq0adJ8ssSCQ9HHVA30f8niMHgeKaQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:date:from:to:subject:mime-version:content-type;
b=MGQh090HWftfq/Rebq8uS3wvFJiBvM0YMUIvkzU7wJDr9hQFWN0QM5+vW7gazH61BvxqEir22sH1434MeXsVLgqPZ4vZ6062AGwD5CgJaVzGughA0Eu6t/cTOADTwuJTulbJ8BZjND/9CWq8aW6jjDVaVkrhLpucZlmfGVVBscU=
Received: by 10.100.228.17 with SMTP id a17mr3425165anh.100.1211617909932;
Sat, 24 May 2008 01:31:49 -0700 (PDT)
Received: by 10.100.178.6 with HTTP; Sat, 24 May 2008 01:31:49 -0700 (PDT)
Message-ID: <d004dafc0805240131o77b5693ajf58f76dce941508b@mail.gmail.com>
Date: Sat, 24 May 2008 10:31:49 +0200
From: "Alitrix aka Ali" <alitrix@gmail.com>
To: ali@letscall.nl
Subject: testing.... with new stuff
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_17727_13626508.1211617909927"
------=_Part_17727_13626508.1211617909927
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
adfasdf
asd
f
asdf
------=_Part_17727_13626508.1211617909927
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
adfasdf<br>asd<br>f<br>asdf<br>
------=_Part_17727_13626508.1211617909927--
Forwarded mail (too ~/.mailbox/.INBOX.aliLC/new/):
Code:
Return-Path: <alitrix@gmail.com>
X-Original-To: alitrix@localhost
Delivered-To: alitrix@localhost
Received: by alitrix.nl (Postfix, from userid 1007)
id 3011362C1D0; Sat, 24 May 2008 16:36:30 +0200 (CEST)
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on r1k7s19.kdiss.com
X-Spam-Level: **
X-Spam-Status: No, score=2.1 required=5.0 tests=HTML_MESSAGE,
HTML_SHORT_LENGTH,MISSING_SUBJECT,NO_RECEIVED,TO_CC_NONE autolearn=no
version=3.1.4
Received: from r1k7s19.kdiss.com (localhost [127.0.0.1])
by alitrix.nl (Postfix) with ESMTP id 0FA6762C082
for <alitrix@localhost>; Sat, 24 May 2008 16:36:25 +0200 (CEST)
Envelope-to: ali@letscall.nl
Delivery-date: Sat, 24 May 2008 10:31:52 +0200
Received: from mail.letscall.nl [81.4.97.190]
by r1k7s19.kdiss.com with POP3 (fetchmail-6.3.4)
for <alitrix@localhost> (single-drop); Sat, 24 May 2008 16:36:25 +0200 (CEST)
Received: from an-out-0708.google.com ([209.85.132.246])
by blade24.geenpunt.nl with esmtp (Exim 4.63)
(envelope-from <alitrix@gmail.com>)
id 1JzpAN-0000qQ-DS
for ali@letscall.nl; Sat, 24 May 2008 10:31:51 +0200
Received: by an-out-0708.google.com with SMTP id c38so237616ana.3
for <ali@letscall.nl>; Sat, 24 May 2008 01:31:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
bh=rlbtInY6KRTZg0R8gzXdHCminImaA5sLZtcOoPQAAD4=;
b=c2CdtRt/vaakBxGxaz6Iiyfr2FErj8dffVPizEapTaJtG1mssK1oj29gb0js2IUxtMHmZQDSWRsm4t0ddTco776JT2IKmS/JNZPWwbL9XfwaO3BT2sfbOkKKgsXYQVPN/l88MYTsGAaxilq0adJ8ssSCQ9HHVA30f8niMHgeKaQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:date:from:to:subject:mime-version:content-type;
b=MGQh090HWftfq/Rebq8uS3wvFJiBvM0YMUIvkzU7wJDr9hQFWN0QM5+vW7gazH61BvxqEir22sH1434MeXsVLgqPZ4vZ6062AGwD5CgJaVzGughA0Eu6t/cTOADTwuJTulbJ8BZjND/9CWq8aW6jjDVaVkrhLpucZlmfGVVBscU=
Received: by 10.100.228.17 with SMTP id a17mr3425165anh.100.1211617909932;
Sat, 24 May 2008 01:31:49 -0700 (PDT)
Received: by 10.100.178.6 with HTTP; Sat, 24 May 2008 01:31:49 -0700 (PDT)
Message-ID: <d004dafc0805240131o77b5693ajf58f76dce941508b@mail.gmail.com>
Date: Sat, 24 May 2008 10:31:49 +0200
From: "Alitrix aka Ali" <alitrix@gmail.com>
To: ali@letscall.nl
Subject: testing.... with new stuff
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_17727_13626508.1211617909927"
I tested it on 2 ways:
Through mailbox_command in /etc/postfix/main.cf
Through 'procmail < ~/testmail.txt'
Both forward the email correct, but everything after the "Content-Type" is removed
alitrix@r1k7s19:~/.mailbox/cur$ procmail < 1211666195.V806I64c00fM235567.r1k7s19.kdiss.com\:2\,S
procmail: [6187] Sun May 25 00:04:12 2008
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "LOGFILE=/home/alitrix/.procmail.log"
procmail: Opening "/home/alitrix/.procmail.log"
Code:
alitrix@r1k7s19:~/.mailbox/cur$ cat /home/alitrix/.mailbox//from
From alitrix@gmail.com Sat May 24 06:15:22 2008
Subject: joh, en nu werken!
Folder: .INBOX.aliLC/new/1 2537
From alitrix@gmail.com Sat May 24 06:15:24 2008
Subject: Fwd: Daisycon Week 21 (Account: 58alitri)
Folder: .INBOX.aliLC/new/1 2702
From alitrix@gmail.com Sat May 24 06:16:38 2008
Subject: testing
Folder: .INBOX.aliLC/new/1 2525
From alitrix@gmail.com Sat May 24 06:30:12 2008
Subject: working with new bash script
Folder: .INBOX.aliLC/new/1 2558
Subject: testing.... with new stuff
Folder: .INBOX.aliLC/new/1 2496
Subject: testing.... with new stuff
Folder: .INBOX.aliLC/new/1 2496
Subject: testing.... with new stuff
Folder: .INBOX.aliLC/new/2 2496
Subject: testing in LC zelf
Folder: .INBOX.aliLC/new/1 2487
Subject: testing in LC zelf
Folder: .INBOX.aliLC/new/1 2487
procmail: Match on ".*\@letscall.nl"
procmail: Assigning "LASTFOLDER=.INBOX.aliLC/new/1"
procmail: Opening ".INBOX.aliLC/new/1"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "alitrix@0:/home/alitrix/.mailbox//.INBOX.aliLC/new/1"
Subject: testing in LC zelf
Folder: .INBOX.aliLC/new/1 2487
procmail: Match on ".*\@letscall.nl"
procmail: Assigning "LASTFOLDER=.INBOX.aliLC/new/1"
procmail: Opening ".INBOX.aliLC/new/1"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "alitrix@0:/home/alitrix/.mailbox//.INBOX.aliLC/new/1"
Subject: testing in LC zelf
Folder: .INBOX.aliLC/new/1 2487
I asked the ppl on the procmail-list. This is the answer:
Code:
You have several problems here:
'H' is the default (egrep headers) and doesn't need to be specified.
'h' specifically tells procmail to only deliver headers to the
filter/mbox/maildir
If you remove both you'll get the behavior you want.
Also, you shouldn't deliver directly to /new/ but just to the maildir
and let procmail handle putting emails in new.
With your regex, you should probably use ^TO or ^TO_. You don't need
to escape '@' but you do need to escape '.'. Your leading '.*' is
meaningless in the context that you are using it.
Try changing the recipe to:
:0
* ^(To|Cc):.*@letscall\.nl
.INBOX.aliLC/
Brandon
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.