18 Jan 2011 19:47
Re: Procmail Help
Figures it out. THat has to be a ! not | at the beginning of the line: :0c * ^X-Forwarded-For: kira...@... ash...@... ! ashley-arch...@... Having a | implies executing of a script or command. The ! forwards it properly. Oops. Oh, and this was resolved by looking at procmail's verbose log file. Thanks for the tip! On Jan 18, 11:09 am, KirAsh4 <kira...@...> wrote: > Nope, that's how it shows up in the headers. I've literally copied it > from the headers like that. It's a GMail thing when you set > forwarding up. And if it didn't work, then the first rule would also > fail, and I know that one works. > > On Jan 18, 10:42 am, Roger <roger.in.eug...@...> wrote: > > > I think you can enable verbose loggging to see what's going on. > > > spaces are critical. Perhaps you need to account for possible > > spaces in the 'x-forwarded-for' line? > > > I honestly don't know about having two addresses on the one line. > > Does that line appear exactly in the header or are you trying to have > > it catch for both addresses? > > If it could have either address, but not both, you'll need two recipes. > > > * ^X-Forwarded-For: kira...@... > > | ashley-arch...@... > > > * ^X-Forwarded-For: ash...@... > > | ashley-arch...@... > > > On Tue, Jan 18, 2011 at 8:51 AM, KirAsh4 <kira...@...> wrote: > > > > Well, all of what you said and the way I understand the various > > > recipes I've been scouring online, all of it makes sense. But for > > > some reason it's not working. Procmail is doing the first part, and > > > ignoring the second part (it's not copying the message when it returns > > > from GMail.) And I can't figure out why. This is what the recipe > > > looks like now: > > > > :0 > > > * !^X-Forwarded-For: kira...@... ash...@... > > > * !^From.*kira...@... > > > ! kira...@... > > > > :0c > > > * ^X-Forwarded-For: kira...@... ash...@... > > > | ashley-arch...@... > > > > (having a space between 0 and c doesn't seem to make any difference, > > > but this is also how many recipes are written, without the space.) > > > > I have double checked the returning message from GMail and the X- > > > Forwarded line is spot on accurate. So what am I missing here? How > > > can I trace it or figure out why it's not running the second recipe > > > and just drops it in my INBOX without the forward? I wonder what > > > would happen if I reverse the rules ... if the second one will fail > > > (and thus not forward to GMail at all.) > > > > A > > > > On Jan 13, 3:37 pm, Roger <roger.in.eug...@...> wrote: > > >> After your current recipe, would something like: > > >> :0 c > > >> * ^X-Forwarded-For: kira...@... ash...@... > > >> | secondemail <at> address > > >> ### 'c' essentially means a copy of the email, even if it matches, a > > >> copy drops through. > > > >> If that condition exists, then send a copy to that second address. > > >> The original forwarded would still fall through and go to primary > > >> mailbox.. (I think) > > > >> Is that what you want? > > >> in summary, your recipe combined with the one above. > > > >> New email arrives for you, if it hasn't been forwarded, then send it > > >> off to gmail for spam check. once it comes back (via google forward), > > >> the 1st recipe ignores it. the second recipe (above), would then > > >> forward a copy to the second address in addition to the primary > > >> mailbox. > > > >> Roger > > > >> On Thu, Jan 13, 2011 at 1:37 PM, KirAsh4 <kira...@...> wrote: > > >> > Procmail is considered a scripting language, right? Right? > > >> > Right? :) > > > >> > Anyway, I need some words of wisdom here. At the moment, I'm > > >> > using a short procmail script that forwards incoming email to gmail > > >> > and only delivers it to the final mailbox if it comes back from > > >> > gmail. It's a crude way of filtering for SPAM since Gmail is much > > >> > better at it: > > > >> > :0 > > >> > * !^X-Forwarded-For: kira...@... ash...@... > > >> > * !^From.*kira...@... > > >> > ! kira...@... > > > >> > This works really well. Email arrives at our server, procmail > > >> > sees that it hasn't passed through Gmail and sends it on to my Gmail > > >> > address. Gmail scans it, deems it legitimate and sends it back (via > > >> > Gmail's internal forwarding). When it arrives back at our server, > > >> > procmail sees the X-Forwarded for and delivers it in my INBOX. > > > >> > But now I need to augment this a bit and forward those emails to a > > >> > second mailbox, but ONLY those that are coming back from Gmail. > > >> > Basically, when procmail sees the X-Forwarded for, it needs to forward > > >> > that massage to a second mailbox besides dropping it into my INBOX. I > > >> > can't just put a forward line at the bottom because then it simply > > >> > forwards and doesn't drop in my INBOX. > > > >> > Suggestions? > >
RSS Feed