From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qf1Os-0006EN-1w for garchives@archives.gentoo.org; Fri, 08 Jul 2011 03:06:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22E9421C033 for ; Fri, 8 Jul 2011 03:06:40 +0000 (UTC) Received: from mail-vx0-f181.google.com (mail-vx0-f181.google.com [209.85.220.181]) by pigeon.gentoo.org (Postfix) with ESMTP id A530121C04B for ; Fri, 8 Jul 2011 02:35:52 +0000 (UTC) Received: by vxa40 with SMTP id 40so1413117vxa.40 for ; Thu, 07 Jul 2011 19:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=NyY2oTX5ypfits1oHxzNxG8qxMIusLbwRoFwdGo+aAU=; b=eMhJ/jq4u6eNAyFaUcizBCu7O9v1akCszjB/hykWKSdMSouCU/2PGX7vhmUH+5bJOY e/68tRa1ldRDykHVeST0tbjEp0iH4TXtAzj7t0PZRdEoUtEkzU+kO0T+jj9pBsxRsnr0 wiO3uziu1y4FTP+udgg3DKjKi7GCEo8kVqVYA= Received: by 10.52.177.1 with SMTP id cm1mr1938929vdc.295.1310092552082; Thu, 07 Jul 2011 19:35:52 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-server@lists.gentoo.org Reply-to: gentoo-server@lists.gentoo.org MIME-Version: 1.0 Received: by 10.52.166.197 with HTTP; Thu, 7 Jul 2011 19:35:32 -0700 (PDT) In-Reply-To: <4E165246.5070700@badapple.net> References: <4E16324B.7080904@badapple.net> <4E165246.5070700@badapple.net> From: Paul Hartman Date: Thu, 7 Jul 2011 21:35:32 -0500 Message-ID: Subject: Re: [gentoo-server] Postfix: Can I insert a custom header to incoming mail? To: gentoo-server@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ce0f5e4b9689e8919c13882efc0cd1cf On Thu, Jul 7, 2011 at 7:41 PM, kashani wrote: > On 7/7/2011 4:59 PM, Paul Hartman wrote: >> >> On Thu, Jul 7, 2011 at 5:25 PM, kashani =A0wr= ote: >>> >>> On 7/7/2011 2:50 PM, Paul Hartman wrote: >>>> >>>> The idea: >>>> >>>> Assuming I can't do anything about how Postfix handles the >>>> Delivered-To header, I'd like to insert a new header entry >>>> (X-Originally-To: or something like that) into incoming mail before it >>>> hits the catchall forward, so I can know to whom the email was >>>> originally addressed... but i don't really know where to begin. >>>> >>>> The question: >>>> >>>> Are there any postfix gurus out there who can point me in the right >>>> direction? Thanks in advance for any tips or advice (or if you want to >>>> tell me that I'm doing it all wrong). >>> >>> It should already be there at least in 2.7.4 which is stable unless >>> you've >>> really tweaked your main.cf. I'd run a postconf | grep enable_orig and >>> see >>> if it's not set to yes. >>> >>> kashani >>> >>> http://www.postfix.org/postconf.5.html >>> >>> enable_original_recipient (default: yes) >>> >>> =A0 =A0Enable support for the X-Original-To message header. This header= is >>> needed for multi-recipient mailboxes. >> >> Hi kashani, >> >> I actually read about that option when I was trying to make this >> happen (forgot about it when composing my original message). Googling >> that option I found that most people were interested in combining >> multi-recipient messages to one on disk (to save space). Indeed the >> option is already set to "yes" on my setup, but I still don't get that >> header. I supposed that it has nothing to do with the address I'm >> interested in (from the envelope) and instead is looking at the To: >> name from headers (which is unchanged). Or because my message does not >> have multiple recipients. But maybe I'm completely misunderstanding >> what it's all about. > > I think I've got it figured out and this is your culprit. > > http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot#Dove= cot_Integration_-_LDA > > This is because Postfix adds the x-original-to when it delivers, but not > when it passes the mail via lmtp to Dovecot. See this Dovecot thread for > some details. > > http://www.dovecot.org/list/dovecot/2011-January/056787.html > > The primary benefits of Dovecot LDA seem to be cache files and Sieve. > http://wiki.dovecot.org/LDA/Indexing > http://wiki.dovecot.org/LDA/Sieve > > If you aren't using Sieve, I would try is using virtual_transport =3D vir= tual > instead of virtual_transport =3D dovecot > > You might need to change some settings in your Dovecot config to match wh= ere > Postfix will deliver the emails, specifically mail_location =3D > maildir:/var/mail/%d/%n/Maildir/:INDEX=3D/var/mail/%d/%n/indexes > > This are the settings I use for Postfix w/ Courier. Should work with > Dovecot, but again you might need to change things a bit. > > # virtual stuff > virtual_alias_maps =3D proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.= cf > virtual_gid_maps =3D static:207 > virtual_mailbox_base =3D /var/mail/ > virtual_mailbox_domains =3D > proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf > virtual_mailbox_limit =3D 512400000 > virtual_mailbox_maps =3D > proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf > virtual_minimum_uid =3D 207 > virtual_transport =3D virtual > virtual_uid_maps =3D static:207 Really great info, thanks a lot for taking your time to look into it. I will experiment with it and see what I can do. Thankfully I'm just using a new domain for testing for now, so I have the freedom to break things as much as needed until I get it right. :) Thanks again, Paul