Hey folks,
Seems the procmail list has fallen off of the face of the planet ... at least, the address given on the procmail.org website doesn't seem to work anymore.
So perhaps someone here might be able to help. I'm trying to figure out why a recipe isn't working (when it used to in the past.)
The entire recipe is as follows:
:0 * !^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com * !^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com * !^From.*kirash4@gmail.com * !^To.*ashley@papillon.pcraft.com ! kirash4@gmail.com
:0c * ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com * ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com ! salesdept
Basically, any incoming e-mail that does not have that X-Forwarded-For line in it will get sent to GMail (which forwards it back).
Email that does have that tag in it, will get copied to the 'salesdept' mailbox as well. It's this second part that doesn't seem to work.
Incoming e-mail gets forwarded to GMail as they should. When they come back, they get dropped in the recipient's mailbox as they should. However, that second recipe seems to completely ignored. Nothing gets copied to the salesdept mailbox.
What am I missing, or did wrong here?
On Wed, 23 Jan 2013 11:12:32 -0700, Ashley M. Kirchner wrote:
:0
- !^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
- !^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
- !^From.*kirash4@gmail.com
- !^To.*ashley@papillon.pcraft.com
! kirash4@gmail.com
:0c
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
! salesdept
Basically, any incoming e-mail that does not have that X-Forwarded-For line in it will get sent to GMail (which forwards it back).
Email that does have that tag in it, will get copied to the 'salesdept' mailbox as well. It's this second part that doesn't seem to work.
The '!' forward action takes email addresses. If '! salesdept' is supposed to store the copy into a mailbox 'salesdept', one typically writes just 'salesdept' without a leading '! '.
In case you've tried that already, what does your procmail log file say about these two recipes?
Actually, I just noticed that recipe isn't complete. In my haste I didn't type out the complete address. It should read salesdept@pcraft.com - it's being forwarded to another e-mail address.
And I have no procmail log ... anywhere.
On Wed, Jan 23, 2013 at 11:24 AM, Michael Schwendt mschwendt@gmail.comwrote:
On Wed, 23 Jan 2013 11:12:32 -0700, Ashley M. Kirchner wrote:
:0
- !^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
- !^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
- !^From.*kirash4@gmail.com
- !^To.*ashley@papillon.pcraft.com
! kirash4@gmail.com
:0c
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
! salesdept
Basically, any incoming e-mail that does not have that X-Forwarded-For
line
in it will get sent to GMail (which forwards it back).
Email that does have that tag in it, will get copied to the 'salesdept' mailbox as well. It's this second part that doesn't seem to work.
The '!' forward action takes email addresses. If '! salesdept' is supposed to store the copy into a mailbox 'salesdept', one typically writes just 'salesdept' without a leading '! '.
In case you've tried that already, what does your procmail log file say about these two recipes?
-- Fedora release 19 (Rawhide) - Linux 3.8.0-0.rc4.git1.1.fc19.x86_64 loadavg: 0.00 0.03 0.05 -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Wed, 23 Jan 2013 11:38:36 -0700, Ashley M. Kirchner wrote:
Actually, I just noticed that recipe isn't complete. In my haste I didn't type out the complete address. It should read salesdept@pcraft.com - it's being forwarded to another e-mail address.
And I have no procmail log ... anywhere.
Consider turning it on then in your ~/.procmailrc
LOGFILE=/some/path VERBOSE=yes
On 23.01.2013, Ashley M. Kirchner wrote:
So perhaps someone here might be able to help. I'm trying to figure out why a recipe isn't working (when it used to in the past.)
First let procmail write a logfile:
LOGFILE=${HOMEDIR}/procmail.log
And then let it be verbose:
VERBOSE=on
After that, let it fail again and look into the logfile. Now you can see what's going on. If not, post the relevant lines here, and somebody will have a look.
Ok, adding those two lines does nothing. I have:
LOGFILE=/var/log/procmail VERBOSE=on (also tried 'yes')
This is at the top of the recipe. I'm getting nothing in that log file. It exists, and it's writable.
On Wed, Jan 23, 2013 at 12:11 PM, Heinz Diehl htd@fritha.org wrote:
On 23.01.2013, Ashley M. Kirchner wrote:
So perhaps someone here might be able to help. I'm trying to figure out why a recipe isn't working (when it used to in the past.)
First let procmail write a logfile:
LOGFILE=${HOMEDIR}/procmail.log
And then let it be verbose:
VERBOSE=on
After that, let it fail again and look into the logfile. Now you can see what's going on. If not, post the relevant lines here, and somebody will have a look.
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Wed, 23 Jan 2013 13:32:29 -0700, Ashley M. Kirchner wrote:
Ok, adding those two lines does nothing. I have:
LOGFILE=/var/log/procmail VERBOSE=on (also tried 'yes')
This is at the top of the recipe. I'm getting nothing in that log file. It exists, and it's writable.
Create a fresh user account for testing. Create a $HOME/.procmailrc that turns on logging as above, but with a path somewhere below $HOME. Even a very basic test such as "echo 'fubar' | procmail" should result in procmail filling the log file. Does that work for you?
It works if I use ${HOME} instead of ${HOMEDIR}.
It also works if the path is set to /var/log/procmail
If I log in to the account with the actual recipe, and I echo 'fubar' | procmail, that too dumps stuff into the log file.
So why won't it work when in this recipe:
LOGFILE=/var/log/procmail VERBOSE=yes
:0 * !^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com * !^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com * !^From.*kirash4@gmail.com * !^To.*ashley@papillon.pcraft.com ! ashley@gmail.com
:0c * ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com * ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com ! salesdept@pcraft.com
On Wed, Jan 23, 2013 at 1:51 PM, Michael Schwendt mschwendt@gmail.comwrote:
On Wed, 23 Jan 2013 13:32:29 -0700, Ashley M. Kirchner wrote:
Ok, adding those two lines does nothing. I have:
LOGFILE=/var/log/procmail VERBOSE=on (also tried 'yes')
This is at the top of the recipe. I'm getting nothing in that log file. It exists, and it's writable.
Create a fresh user account for testing. Create a $HOME/.procmailrc that turns on logging as above, but with a path somewhere below $HOME. Even a very basic test such as "echo 'fubar' | procmail" should result in procmail filling the log file. Does that work for you?
-- Fedora release 19 (Rawhide) - Linux 3.8.0-0.rc4.git1.1.fc19.x86_64 loadavg: 0.01 0.04 0.05 -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Once upon a time, Ashley M. Kirchner ashley@pcraft.com said:
It works if I use ${HOME} instead of ${HOMEDIR}.
It also works if the path is set to /var/log/procmail
If I log in to the account with the actual recipe, and I echo 'fubar' | procmail, that too dumps stuff into the log file.
So why won't it work when in this recipe:
LOGFILE=/var/log/procmail
Try using a log file in the user's home directory, rather than /var/log. I suspect that SELinux doesn't allow procmail to write to files all over the filesystem.
a) selinux doesn't exist on this box b) doesn't matter where the log file is
And related to a), I have two other accounts that are successfully logging to /var/log/procmail. They dump custom messages. The differences I see is that those recipes have this at the top, under the LOGFILE line: LOGABSTRACT=off
And neither of them have an explicit 'VERBOSE=yes' (or 'on') line.
On Wed, Jan 23, 2013 at 2:40 PM, Chris Adams cmadams@hiwaay.net wrote:
Once upon a time, Ashley M. Kirchner ashley@pcraft.com said:
It works if I use ${HOME} instead of ${HOMEDIR}.
It also works if the path is set to /var/log/procmail
If I log in to the account with the actual recipe, and I echo 'fubar' | procmail, that too dumps stuff into the log file.
So why won't it work when in this recipe:
LOGFILE=/var/log/procmail
Try using a log file in the user's home directory, rather than /var/log. I suspect that SELinux doesn't allow procmail to write to files all over the filesystem.
-- Chris Adams cmadams@hiwaay.net Systems and Network Administrator - HiWAAY Internet Services I don't speak for anybody but myself - that's enough trouble. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Wed, 23 Jan 2013 14:45:52 -0700, Ashley M. Kirchner wrote:
a) selinux doesn't exist on this box b) doesn't matter where the log file is
And related to a), I have two other accounts that are successfully logging to /var/log/procmail. They dump custom messages. The differences I see is that those recipes have this at the top, under the LOGFILE line: LOGABSTRACT=off
And neither of them have an explicit 'VERBOSE=yes' (or 'on') line.
LOGABSTRACT is completely unrelated. It's documented in "man procmailrc" in case you want to read up on what it does.
Ok, well those recipes are working and logging to /var/log/procmail.
I don't understand why this one, which is a lot shorter and simpler, won't log. Nor will it work properly.
On Wed, Jan 23, 2013 at 2:54 PM, Michael Schwendt mschwendt@gmail.comwrote:
On Wed, 23 Jan 2013 14:45:52 -0700, Ashley M. Kirchner wrote:
a) selinux doesn't exist on this box b) doesn't matter where the log file is
And related to a), I have two other accounts that are successfully
logging
to /var/log/procmail. They dump custom messages. The differences I see
is
that those recipes have this at the top, under the LOGFILE line: LOGABSTRACT=off
And neither of them have an explicit 'VERBOSE=yes' (or 'on') line.
LOGABSTRACT is completely unrelated. It's documented in "man procmailrc" in case you want to read up on what it does.
-- Fedora release 19 (Rawhide) - Linux 3.8.0-0.rc4.git1.1.fc19.x86_64 loadavg: 0.12 0.11 0.07 -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part.
So this (adjusted for the test account):
LOGFILE=/var/log/procmail VERBOSE=yes
:0 * !^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.comashley@pcigrafx.com * !^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com ashley@pcraft.com * !^From.*kirash4@gmail.com * !^To.*mytest@papillon.pcraft.com ashley@papillon.pcraft.com ! kirash4@gmail.com ashley@gmail.com
:0c * ^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.comashley@pcigrafx.com * ^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com ashley@pcraft.com ! salesdept@pcraft.com
Generates this in the log file when it first shows up and gets forwarded to GMail:
procmail: [7884] Wed Jan 23 16:02:10 2013 procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com" procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com" procmail: Match on ! "^From.*kirash4@gmail.com" procmail: Match on ! "^To.*mytest@papillon.pcraft.com" procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi kirash4@gmail.com" procmail: Executing "/usr/sbin/sendmail,-oi,kirash4@gmail.com" procmail: Notified comsat: "mytest@:/usr/sbin/sendmail -oi kirash4@gmail.com "
From USER@DOMAIN.com Wed Jan 23 16:02:10 2013
Subject: This is a test message Folder: /usr/sbin/sendmail -oi kirash4@gmail.com 3139
And when it comes back from GMail:
procmail: [7892] Wed Jan 23 16:02:18 2013 procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com" procmail: No match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com" procmail: No match on "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com" procmail: Locking "/var/spool/mail/mytest.lock" procmail: Assigning "LASTFOLDER=/var/spool/mail/mytest" procmail: Opening "/var/spool/mail/mytest" procmail: Acquiring kernel-lock procmail: [7892] Wed Jan 23 16:02:19 2013 procmail: Unlocking "/var/spool/mail/mytest.lock" procmail: Notified comsat: "mytest@78076490:/var/spool/mail/mytest"
From kirash4+caf_=mytest=pcraft.com@gmail.com Wed Jan 23 16:02:18 2013
Subject: This is a test message Folder: /var/spool/mail/mytest 5251
I see the matches and no matches, but I can't tell what's being done before the other. Especially when it comes back. When it returns, the message DOES end up in mytest's mailbox, however it never gets copied to the salesdept email address. So somewhere it's failing. And it doesn't matter which domain I use, it only seems to run the first part of the recipe.
On Wed, Jan 23, 2013 at 2:58 PM, Ashley M. Kirchner ashley@pcraft.comwrote:
Ok, well those recipes are working and logging to /var/log/procmail.
I don't understand why this one, which is a lot shorter and simpler, won't log. Nor will it work properly.
On Wed, Jan 23, 2013 at 2:54 PM, Michael Schwendt mschwendt@gmail.comwrote:
On Wed, 23 Jan 2013 14:45:52 -0700, Ashley M. Kirchner wrote:
a) selinux doesn't exist on this box b) doesn't matter where the log file is
And related to a), I have two other accounts that are successfully
logging
to /var/log/procmail. They dump custom messages. The differences I
see is
that those recipes have this at the top, under the LOGFILE line: LOGABSTRACT=off
And neither of them have an explicit 'VERBOSE=yes' (or 'on') line.
LOGABSTRACT is completely unrelated. It's documented in "man procmailrc" in case you want to read up on what it does.
-- Fedora release 19 (Rawhide) - Linux 3.8.0-0.rc4.git1.1.fc19.x86_64 loadavg: 0.12 0.11 0.07 -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On 2013/01/23 15:28, Ashley M. Kirchner wrote:
Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part.
So this (adjusted for the test account):
LOGFILE=/var/log/procmail VERBOSE=yes
:0
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcigrafx.com mailto:ashley@pcigrafx.com
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcraft.com mailto:ashley@pcraft.com
- !^From.*kirash4@gmail.com mailto:kirash4@gmail.com
- !^To.*mytest@papillon.pcraft.com mailto:ashley@papillon.pcraft.com
! kirash4@gmail.com mailto:ashley@gmail.com
:0c
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcigrafx.com mailto:ashley@pcigrafx.com
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcraft.com mailto:ashley@pcraft.com ! salesdept@pcraft.com mailto:salesdept@pcraft.com
Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes.
As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do.
{^_^}
The way this should work is as follows:
- new e-mail arrives at the recipient's box and procmail picks it up and checks the X-Forward-For header - if the header does NOT contain any of those listed, it forwards the message to the specified gmail address
STOP <
- if the header exists and contains any of the matches listed, the message gets dropped into the recipient's inbox AND - it is at this point that I want it to also forward a copy of said message to the second e-mail address
The first rule works as expected. Message comes in, first rule checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored.
Now, perhaps I'm wrong in thinking that when it comes back and passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE?
A
On Wed, Jan 23, 2013 at 7:50 PM, jdow jdow@earthlink.net wrote:
On 2013/01/23 15:28, Ashley M. Kirchner wrote:
Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part.
So this (adjusted for the test account):
LOGFILE=/var/log/procmail VERBOSE=yes
:0
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcigrafx.com mailto:ashley@pcigrafx.com
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcraft.com mailto:ashley@pcraft.com
- !^From.*kirash4@gmail.com mailto:kirash4@gmail.com
- !^To.*mytest@papillon.pcraft.**com mytest@papillon.pcraft.com<mailto:
ashley@papillon.**pcraft.com ashley@papillon.pcraft.com> ! kirash4@gmail.com mailto:ashley@gmail.com
:0c
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcigrafx.com mailto:ashley@pcigrafx.com
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
mytest@pcraft.com mailto:ashley@pcraft.com ! salesdept@pcraft.com mailto:salesdept@pcraft.com
Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes.
As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do.
{^_^}
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.**org/mailman/listinfo/usershttps://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelineshttp://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
The basic rule to remember with procmail is that once the email is delivered processing is ended. So if the rule passes you must then clone the email and deliver the clone. That allows the rules to keep on processing.
I imagine you also want the second rule to continue processing as well.
Something akin to :0 * !^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com * !^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com * !^From.*kirash4@gmail.com * !^To.*ashley@papillon.pcraft.com { :0 c ! kirash4@gmail.com }
:0c * ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com * ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com { :0 c ! salesdept }
{^_^}
On 2013/01/23 20:00, Ashley M. Kirchner wrote:
The way this should work is as follows:
- new e-mail arrives at the recipient's box and procmail picks it up and checks
the X-Forward-For header
- if the header does NOT contain any of those listed, it forwards the message to
the specified gmail address
STOP <
- if the header exists and contains any of the matches listed, the message gets
dropped into the recipient's inbox AND
- it is at this point that I want it to also forward a copy of said message to
the second e-mail address
The first rule works as expected. Message comes in, first rule checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored.
Now, perhaps I'm wrong in thinking that when it comes back and passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE?
A
On Wed, Jan 23, 2013 at 7:50 PM, jdow <jdow@earthlink.net mailto:jdow@earthlink.net> wrote:
On 2013/01/23 15:28, Ashley M. Kirchner wrote: Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part. So this (adjusted for the test account): LOGFILE=/var/log/procmail VERBOSE=yes :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> * !^To.*mytest@papillon.pcraft.__com <mailto:mytest@papillon.pcraft.com> <mailto:ashley@papillon.__pcraft.com <mailto:ashley@papillon.pcraft.com>> ! kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:ashley@gmail.com <mailto:ashley@gmail.com>> :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> ! salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes. As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do. {^_^} -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.fedoraproject.org> To unsubscribe or change subscription options: https://admin.fedoraproject.__org/mailman/listinfo/users <https://admin.fedoraproject.org/mailman/listinfo/users> Guidelines: http://fedoraproject.org/wiki/__Mailing_list_guidelines <http://fedoraproject.org/wiki/Mailing_list_guidelines> Have a question? Ask away: http://ask.fedoraproject.org
No, the second rule should ONLY process when a message passes the first rule (and does NOT get bounced out to gmail.) I believe, please correct me if I'm wrong here, but I believe the way you've rewritten it, rule 2 will ALWAYS run, regardless of the outcome of rule 1. This will result in duplicate message being sent to the second e-mail address.
On Wed, Jan 23, 2013 at 9:10 PM, jdow jdow@earthlink.net wrote:
The basic rule to remember with procmail is that once the email is delivered processing is ended. So if the rule passes you must then clone the email and deliver the clone. That allows the rules to keep on processing.
I imagine you also want the second rule to continue processing as well.
Something akin to :0
!^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
!^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
!^From.*kirash4@gmail.com
!^To.*ashley@papillon.pcraft.**com ashley@papillon.pcraft.com
{ :0 c ! kirash4@gmail.com }
:0c
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcraft.com
- ^X-Forwarded-For: kirash4@gmail.com ashley@pcigrafx.com
{ :0 c ! salesdept }
{^_^}
On 2013/01/23 20:00, Ashley M. Kirchner wrote:
The way this should work is as follows:
- new e-mail arrives at the recipient's box and procmail picks it up and
checks the X-Forward-For header
- if the header does NOT contain any of those listed, it forwards the
message to the specified gmail address
STOP <
- if the header exists and contains any of the matches listed, the
message gets dropped into the recipient's inbox AND
- it is at this point that I want it to also forward a copy of said
message to the second e-mail address
The first rule works as expected. Message comes in, first rule checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored.
Now, perhaps I'm wrong in thinking that when it comes back and passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE?
A
On Wed, Jan 23, 2013 at 7:50 PM, jdow <jdow@earthlink.net mailto:jdow@earthlink.net> wrote:
On 2013/01/23 15:28, Ashley M. Kirchner wrote: Ok, I'm still trying to figure this out. On the new, test
account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part.
So this (adjusted for the test account): LOGFILE=/var/log/procmail VERBOSE=yes :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:
ashley@pcraft.com
<mailto:ashley@pcraft.com>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> * !^To.*mytest@papillon.pcraft._**_com <mailto:mytest@papillon.**
pcraft.com mytest@papillon.pcraft.com> <mailto:ashley@papillon.__pcra**ft.com http://pcraft.com<mailto: ashley@papillon.**pcraft.com ashley@papillon.pcraft.com>> ! kirash4@gmail.com mailto:kirash4@gmail.com <mailto: ashley@gmail.com
<mailto:ashley@gmail.com>> :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:
ashley@pcraft.com
<mailto:ashley@pcraft.com>> ! salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes. As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do. {^_^} -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.**fedoraproject.org<users@lists.fedoraproject.org>
To unsubscribe or change subscription options: https://admin.fedoraproject.__**org/mailman/listinfo/users <https://admin.fedoraproject.**org/mailman/listinfo/users<https://admin.fedoraproject.org/mailman/listinfo/users>
Guidelines: http://fedoraproject.org/wiki/**__Mailing_list_guidelines<http://fedoraproject.org/wiki/__Mailing_list_guidelines> <http://fedoraproject.org/**wiki/Mailing_list_guidelines<http://fedoraproject.org/wiki/Mailing_list_guidelines>
Have a question? Ask away: http://ask.fedoraproject.org
--
users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.**org/mailman/listinfo/usershttps://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelineshttp://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
OK, you do not want things to continue processing. So what I posted will not solve your problem.
So what you have for rule 1 is: not Xforwarded to both kirash4@gmail.com and ashley@pcraft.com and not xforwarded to both kirash4@gmail.com and ashley@pcigrafx.com and not from kirash4@gmail.com and not to ashley@papillon.pcraft.__com forward to kirash4@gmail.com
What you have for rule two is the first half of rule 1 to another recipient: not Xforwarded to both kirash4@gmail.com and ashley@pcraft.com and not xforwarded to both kirash4@gmail.com and ashley@pcigrafx.com forward to salesdept@wherever
Is this a general rule for all mail coming into the system to any recipient? Presuming it is then email to george@gmail.com will be sent off to kirash and processing ends there since it fails all the conditions and the conditions are anded and inverted.
Mail to kirash will fall through both rules.
Mail from kirash will match the third test which means it's false when inverted and the mail falls through to the second rule and gets forwarded to salesdept.
mail to ashley will fall through the first rule and be diverted salesdept by the second rule.
Mail that has been xforwarded to kirash and ashley (at either address) passes one of the first two rules which when inverted fails the procmail rule for both rules 1 and 2 so they simply pass through.
So have account phil at phoo.com send a message to george@pcraft.com and see what happens. I believe it should pass through. So you'd see both rules hitting. You can forge a test message and feed it through procmail to see what happens with the rule.
For testing let's try this set of rules:
:0 * !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com ashley@pcraft.com mailto:ashley@pcraft.com * !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com ashley@pcigrafx.com mailto:ashley@pcigrafx.com * !^From.*kirash4@gmail.com mailto:kirash4@gmail.com * !^To.*ashley@papillon.pcraft.__com mailto:ashley@papillon.pcraft.com /tmp/foo1
0: * ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com ashley@pcraft.com mailto:ashley@pcraft.com * ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com ashley@pcigrafx.com mailto:ashley@pcigrafx.com /tmp/foo2
/tmp/foo3
That should sort the mail to three different destinations in /tmp. You can easily see where the messages go as you try variants without polluting mail boxes.
I'm wondering about this line in the first rule: * !^From.*kirash4@gmail.com mailto:kirash4@gmail.com
Is that really what you mean? I presume it is. But if it's not that could lead to confusing results when you test.
{^_^}
On 2013/01/23 20:15, Ashley M. Kirchner wrote:
No, the second rule should ONLY process when a message passes the first rule (and does NOT get bounced out to gmail.) I believe, please correct me if I'm wrong here, but I believe the way you've rewritten it, rule 2 will ALWAYS run, regardless of the outcome of rule 1. This will result in duplicate message being sent to the second e-mail address.
On Wed, Jan 23, 2013 at 9:10 PM, jdow <jdow@earthlink.net mailto:jdow@earthlink.net> wrote:
The basic rule to remember with procmail is that once the email is delivered processing is ended. So if the rule passes you must then clone the email and deliver the clone. That allows the rules to keep on processing. I imagine you also want the second rule to continue processing as well. Something akin to :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcraft.com <mailto:ashley@pcraft.com> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> * !^To.*ashley@papillon.pcraft.__com <mailto:ashley@papillon.pcraft.com> { :0 c ! kirash4@gmail.com <mailto:kirash4@gmail.com> } :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcraft.com <mailto:ashley@pcraft.com> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> { :0 c ! salesdept } {^_^} On 2013/01/23 20:00, Ashley M. Kirchner wrote: The way this should work is as follows: - new e-mail arrives at the recipient's box and procmail picks it up and checks the X-Forward-For header - if the header does NOT contain any of those listed, it forwards the message to the specified gmail address > STOP < - if the header exists and contains any of the matches listed, the message gets dropped into the recipient's inbox AND - it is at this point that I want it to also forward a copy of said message to the second e-mail address The first rule works as expected. Message comes in, first rule checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored. Now, perhaps I'm wrong in thinking that when it comes back and passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE? A On Wed, Jan 23, 2013 at 7:50 PM, jdow <jdow@earthlink.net <mailto:jdow@earthlink.net> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net>>> wrote: On 2013/01/23 15:28, Ashley M. Kirchner wrote: Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part. So this (adjusted for the test account): LOGFILE=/var/log/procmail VERBOSE=yes :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> * !^To.*mytest@papillon.pcraft.____com <mailto:mytest@papillon.__pcraft.com <mailto:mytest@papillon.pcraft.com>> <mailto:ashley@papillon. <mailto:ashley@papillon.>__pcra__ft.com <http://pcraft.com> <mailto:ashley@papillon.__pcraft.com <mailto:ashley@papillon.pcraft.com>>> ! kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:ashley@gmail.com <mailto:ashley@gmail.com> <mailto:ashley@gmail.com <mailto:ashley@gmail.com>>> :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>> ! salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>>> Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes. As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do. {^_^} -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.fedoraproject.org> <mailto:users@lists.__fedoraproject.org <mailto:users@lists.fedoraproject.org>> To unsubscribe or change subscription options: https://admin.fedoraproject.____org/mailman/listinfo/users <https://admin.fedoraproject.__org/mailman/listinfo/users <https://admin.fedoraproject.org/mailman/listinfo/users>> Guidelines: http://fedoraproject.org/wiki/____Mailing_list_guidelines <http://fedoraproject.org/wiki/__Mailing_list_guidelines> <http://fedoraproject.org/__wiki/Mailing_list_guidelines <http://fedoraproject.org/wiki/Mailing_list_guidelines>> Have a question? Ask away: http://ask.fedoraproject.org -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.fedoraproject.org> To unsubscribe or change subscription options: https://admin.fedoraproject.__org/mailman/listinfo/users <https://admin.fedoraproject.org/mailman/listinfo/users> Guidelines: http://fedoraproject.org/wiki/__Mailing_list_guidelines <http://fedoraproject.org/wiki/Mailing_list_guidelines> Have a question? Ask away: http://ask.fedoraproject.org
Let's try this:
In simple form, it looks like this:
if (message does NOT contain header) { send to GMail } else { drop in recipient mailbox send copy to other email }
The first recipe works, as specified, and does what it should do which is to check whether an incoming e-mail to the system contains that specific header line. If the message does not, that e-mail gets bounced out to GMail instead. (Gmail's job here is simply filtering and forwarding it back.) Done, end of processing.
When the message comes back from GMail, it will have that X-Forwarded-For line in it, in which case the recipe sees it and exits, and the message gets dropped in the user's mailbox.
That's it, that's what the first recipe does. It works. Note: this is NOT a system wide recipe. It's user specific, namely my account only. I'm simply forwarding a copy to a coworker, but only after things come back from GMail's filter, not before.
I'm trying to add to that by sending a copy of the message after it's been returned from GMail (and therefore contains the header already) to another e-mail address as well as dropping it in the recipient's mailbox.
The reason I have those two lines at the beginning of the second recipe is to make sure the only messages being copied are those that contain that header. Otherwise, I may end up sending duplicates of the same message, once when it first arrives, and again when it comes back from GMail. At least, I think that's what will happen if I omit those lines. I could be wrong.
On Thu, Jan 24, 2013 at 12:34 AM, jdow jdow@earthlink.net wrote:
OK, you do not want things to continue processing. So what I posted will not solve your problem.
So what you have for rule 1 is: not Xforwarded to both kirash4@gmail.com and ashley@pcraft.com and not xforwarded to both kirash4@gmail.com and ashley@pcigrafx.com and not from kirash4@gmail.com and not to ashley@papillon.pcraft.__com forward to kirash4@gmail.com
What you have for rule two is the first half of rule 1 to another recipient: not Xforwarded to both kirash4@gmail.com and ashley@pcraft.com and not xforwarded to both kirash4@gmail.com and ashley@pcigrafx.com forward to salesdept@wherever
Is this a general rule for all mail coming into the system to any recipient? Presuming it is then email to george@gmail.com will be sent off to kirash and processing ends there since it fails all the conditions and the conditions are anded and inverted.
Mail to kirash will fall through both rules.
Mail from kirash will match the third test which means it's false when inverted and the mail falls through to the second rule and gets forwarded to salesdept.
mail to ashley will fall through the first rule and be diverted salesdept by the second rule.
Mail that has been xforwarded to kirash and ashley (at either address) passes one of the first two rules which when inverted fails the procmail rule for both rules 1 and 2 so they simply pass through.
So have account phil at phoo.com send a message to george@pcraft.com and see what happens. I believe it should pass through. So you'd see both rules hitting. You can forge a test message and feed it through procmail to see what happens with the rule.
For testing let's try this set of rules:
:0
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
ashley@pcraft.com mailto:ashley@pcraft.com
- !^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
ashley@pcigrafx.com mailto:ashley@pcigrafx.com
- !^From.*kirash4@gmail.com mailto:kirash4@gmail.com
- !^To.*ashley@papillon.pcraft._**_com <mailto:ashley@papillon.**
pcraft.com ashley@papillon.pcraft.com> /tmp/foo1
0:
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
ashley@pcraft.com mailto:ashley@pcraft.com
- ^X-Forwarded-For: kirash4@gmail.com mailto:kirash4@gmail.com
ashley@pcigrafx.com mailto:ashley@pcigrafx.com /tmp/foo2
/tmp/foo3
That should sort the mail to three different destinations in /tmp. You can easily see where the messages go as you try variants without polluting mail boxes.
I'm wondering about this line in the first rule:
- !^From.*kirash4@gmail.com mailto:kirash4@gmail.com
Is that really what you mean? I presume it is. But if it's not that could lead to confusing results when you test.
{^_^}
On 2013/01/23 20:15, Ashley M. Kirchner wrote:
No, the second rule should ONLY process when a message passes the first rule (and does NOT get bounced out to gmail.) I believe, please correct me if I'm wrong here, but I believe the way you've rewritten it, rule 2 will ALWAYS run, regardless of the outcome of rule 1. This will result in duplicate message being sent to the second e-mail address.
On Wed, Jan 23, 2013 at 9:10 PM, jdow <jdow@earthlink.net mailto:jdow@earthlink.net> wrote:
The basic rule to remember with procmail is that once the email is delivered processing is ended. So if the rule passes you must then clone the email and deliver the clone. That allows the rules to keep on processing. I imagine you also want the second rule to continue processing as
well.
Something akin to :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcraft.com <mailto:ashley@pcraft.com> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> * !^To.*ashley@papillon.pcraft._**_com <mailto:ashley@papillon.**
pcraft.com ashley@papillon.pcraft.com> { :0 c ! kirash4@gmail.com mailto:kirash4@gmail.com }
:0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcraft.com <mailto:ashley@pcraft.com> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> { :0 c ! salesdept } {^_^} On 2013/01/23 20:00, Ashley M. Kirchner wrote: The way this should work is as follows: - new e-mail arrives at the recipient's box and procmail picks it
up and checks the X-Forward-For header - if the header does NOT contain any of those listed, it forwards the message to the specified gmail address > STOP <
- if the header exists and contains any of the matches listed, the message gets dropped into the recipient's inbox AND - it is at this point that I want it to also forward a copy of
said message to the second e-mail address
The first rule works as expected. Message comes in, first rule
checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored.
Now, perhaps I'm wrong in thinking that when it comes back and
passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE?
A On Wed, Jan 23, 2013 at 7:50 PM, jdow <jdow@earthlink.net <mailto:jdow@earthlink.net> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net>>> wrote: On 2013/01/23 15:28, Ashley M. Kirchner wrote: Ok, I'm still trying to figure this out. On the new,
test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part.
So this (adjusted for the test account): LOGFILE=/var/log/procmail VERBOSE=yes :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:
mytest@pcraft.com
<mailto:mytest@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> * !^To.*mytest@papillon.pcraft._**___com <mailto:mytest@papillon.__pcra**ft.com <http://pcraft.com><mailto:
mytest@papillon.**pcraft.com mytest@papillon.pcraft.com>> <mailto:ashley@papillon. mailto:ashley@papillon.__pcr**a__ft.com http://pcra__ft.com < http://pcraft.com%3E
<mailto:ashley@papillon.__pcra**ft.com <http://pcraft.com><mailto:
ashley@papillon.**pcraft.com ashley@papillon.pcraft.com>>> ! kirash4@gmail.com mailto:kirash4@gmail.com <mailto:kirash4@gmail.com mailto:kirash4@gmail.com>
<mailto:ashley@gmail.com <mailto:ashley@gmail.com> <mailto:ashley@gmail.com <mailto:ashley@gmail.com>>> :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:
mytest@pcraft.com
<mailto:mytest@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>> ! salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> <mailto:salesdept@pcraft.com <mailto:
salesdept@pcraft.com> <mailto:salesdept@pcraft.com mailto:salesdept@pcraft.com>**>
Ashley, it might pay to explicitly say, in words, what you
think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes.
As it is your description of passing the first rule is the
correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do.
{^_^} -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.**
fedoraproject.org users@lists.fedoraproject.org> <mailto:users@lists.__fedorapr**oject.orghttp://fedoraproject.org
<mailto:users@lists.**fedoraproject.org<users@lists.fedoraproject.org>
To unsubscribe or change subscription options: https://admin.fedoraproject.__**__org/mailman/listinfo/users <https://admin.fedoraproject._**_org/mailman/listinfo/users <https://admin.fedoraproject.**org/mailman/listinfo/users<https://admin.fedoraproject.org/mailman/listinfo/users>
Guidelines: http://fedoraproject.org/wiki/**____Mailing_list_guidelines<http://fedoraproject.org/wiki/____Mailing_list_guidelines> <http://fedoraproject.org/**wiki/__Mailing_list_guidelines<http://fedoraproject.org/wiki/__Mailing_list_guidelines>
**>
<http://fedoraproject.org/__**wiki/Mailing_list_guidelines<http://fedoraproject.org/__wiki/Mailing_list_guidelines> <http://fedoraproject.org/**wiki/Mailing_list_guidelines<http://fedoraproject.org/wiki/Mailing_list_guidelines>
Have a question? Ask away: http://ask.fedoraproject.org -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.**fedoraproject.org<users@lists.fedoraproject.org>
To unsubscribe or change subscription options: https://admin.fedoraproject.__**org/mailman/listinfo/users <https://admin.fedoraproject.**org/mailman/listinfo/users<https://admin.fedoraproject.org/mailman/listinfo/users>
Guidelines: http://fedoraproject.org/wiki/**__Mailing_list_guidelines<http://fedoraproject.org/wiki/__Mailing_list_guidelines> <http://fedoraproject.org/**wiki/Mailing_list_guidelines<http://fedoraproject.org/wiki/Mailing_list_guidelines>
Have a question? Ask away: http://ask.fedoraproject.org
--
users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.**org/mailman/listinfo/usershttps://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelineshttp://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
That does not seem to match what I broke down as the rule.
Whose account is getting filtered. That will help analyze the rule. The loop through GMail is muddying the water here. And note that you CANNOT do the "else" clause without a clone operation. I presume that is what the GMail loop kludge is supposed to do.
Without the loops through GMail what is it you are trying to accomplish?
Let's break this down to what you really want to do to email that is coming in and who are ALL the people whose email are being processed?
If you subtract out the loop are you trying to make a courtesy copy to one or more other addresses for all mail that is coming in? Your brief description below suggests that is the case. But the whole GMail loop is "undocumented" so it's hard to guess what really gets done.
Who all SHOULD be getting copies?
The forwarded lines really obfuscate the GMail end of things, since it seems to be a loop and you're trying to avoid the loop.
I think procmail is doing exactly what you wrote when you forgot there is no DWIM flag on procmail. I'm not sure, from your description, whether it is ever possible to match the second rule if the first rule matches. Certainly the second rule never gets played if the first rule passed. And if the first rule passes an email through it also will fall through the second rule.
1) So let's get incoming addresses, even if its "foo1@gmail" and "foo2Qpoof" as long as the number of addresses is right.
2) How is this email getting to procmail?
3) What end results are you expecting?
4) What happens when you send the email to kraish4@gmail.com?
5) Are you concerned about CC?
6) Are you concerned about BCC? (Which may not be possible to handle in all cases.
Sometimes going through the problem definition again can clarify the path to a solution.
{^_^}
On 2013/01/24 00:20, Ashley M. Kirchner wrote:
Let's try this:
In simple form, it looks like this:
if (message does NOT contain header) { send to GMail } else { drop in recipient mailbox send copy to other email }
The first recipe works, as specified, and does what it should do which is to check whether an incoming e-mail to the system contains that specific header line. If the message does not, that e-mail gets bounced out to GMail instead. (Gmail's job here is simply filtering and forwarding it back.) Done, end of processing.
When the message comes back from GMail, it will have that X-Forwarded-For line in it, in which case the recipe sees it and exits, and the message gets dropped in the user's mailbox.
That's it, that's what the first recipe does. It works. Note: this is NOT a system wide recipe. It's user specific, namely my account only. I'm simply forwarding a copy to a coworker, but only after things come back from GMail's filter, not before.
I'm trying to add to that by sending a copy of the message after it's been returned from GMail (and therefore contains the header already) to another e-mail address as well as dropping it in the recipient's mailbox.
The reason I have those two lines at the beginning of the second recipe is to make sure the only messages being copied are those that contain that header. Otherwise, I may end up sending duplicates of the same message, once when it first arrives, and again when it comes back from GMail. At least, I think that's what will happen if I omit those lines. I could be wrong.
On Thu, Jan 24, 2013 at 12:34 AM, jdow <jdow@earthlink.net mailto:jdow@earthlink.net> wrote:
OK, you do not want things to continue processing. So what I posted will not solve your problem. So what you have for rule 1 is: not Xforwarded to both kirash4@gmail.com <mailto:kirash4@gmail.com> and ashley@pcraft.com <mailto:ashley@pcraft.com> and not xforwarded to both kirash4@gmail.com <mailto:kirash4@gmail.com> and ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> and not from kirash4@gmail.com <mailto:kirash4@gmail.com> and not to ashley@papillon.pcraft.__com forward to kirash4@gmail.com <mailto:kirash4@gmail.com> What you have for rule two is the first half of rule 1 to another recipient: not Xforwarded to both kirash4@gmail.com <mailto:kirash4@gmail.com> and ashley@pcraft.com <mailto:ashley@pcraft.com> and not xforwarded to both kirash4@gmail.com <mailto:kirash4@gmail.com> and ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> forward to salesdept@wherever Is this a general rule for all mail coming into the system to any recipient? Presuming it is then email to george@gmail.com <mailto:george@gmail.com> will be sent off to kirash and processing ends there since it fails all the conditions and the conditions are anded and inverted. Mail to kirash will fall through both rules. Mail from kirash will match the third test which means it's false when inverted and the mail falls through to the second rule and gets forwarded to salesdept. mail to ashley will fall through the first rule and be diverted salesdept by the second rule. Mail that has been xforwarded to kirash and ashley (at either address) passes one of the first two rules which when inverted fails the procmail rule for both rules 1 and 2 so they simply pass through. So have account phil at phoo.com <http://phoo.com> send a message to george@pcraft.com <mailto:george@pcraft.com> and see what happens. I believe it should pass through. So you'd see both rules hitting. You can forge a test message and feed it through procmail to see what happens with the rule. For testing let's try this set of rules: :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> * !^To.*ashley@papillon.pcraft.____com <mailto:ashley@papillon.__pcraft.com <mailto:ashley@papillon.pcraft.com>> /tmp/foo1 0: * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> /tmp/foo2 /tmp/foo3 That should sort the mail to three different destinations in /tmp. You can easily see where the messages go as you try variants without polluting mail boxes. I'm wondering about this line in the first rule: * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> Is that really what you mean? I presume it is. But if it's not that could lead to confusing results when you test. {^_^} On 2013/01/23 20:15, Ashley M. Kirchner wrote: No, the second rule should ONLY process when a message passes the first rule (and does NOT get bounced out to gmail.) I believe, please correct me if I'm wrong here, but I believe the way you've rewritten it, rule 2 will ALWAYS run, regardless of the outcome of rule 1. This will result in duplicate message being sent to the second e-mail address. On Wed, Jan 23, 2013 at 9:10 PM, jdow <jdow@earthlink.net <mailto:jdow@earthlink.net> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net>>> wrote: The basic rule to remember with procmail is that once the email is delivered processing is ended. So if the rule passes you must then clone the email and deliver the clone. That allows the rules to keep on processing. I imagine you also want the second rule to continue processing as well. Something akin to :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> * !^To.*ashley@papillon.pcraft.____com <mailto:ashley@papillon.__pcraft.com <mailto:ashley@papillon.pcraft.com>> { :0 c ! kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> } :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> { :0 c ! salesdept } {^_^} On 2013/01/23 20:00, Ashley M. Kirchner wrote: The way this should work is as follows: - new e-mail arrives at the recipient's box and procmail picks it up and checks the X-Forward-For header - if the header does NOT contain any of those listed, it forwards the message to the specified gmail address > STOP < - if the header exists and contains any of the matches listed, the message gets dropped into the recipient's inbox AND - it is at this point that I want it to also forward a copy of said message to the second e-mail address The first rule works as expected. Message comes in, first rule checks it and upon failing, bounces back out to gmail. Nothing happens after that. When the message returns, it passes the first rule and gets dropped in the recipient's box. When I added the second rule, nothing changed. The first keeps running as is and the second is simply ignored. Now, perhaps I'm wrong in thinking that when it comes back and passes the first rule, it will also run through the second rule. Is this a case where I need to write things wrapped in a nest? Sort of like an IF .. THEN .. ELSE? A On Wed, Jan 23, 2013 at 7:50 PM, jdow <jdow@earthlink.net <mailto:jdow@earthlink.net> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net>> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net> <mailto:jdow@earthlink.net <mailto:jdow@earthlink.net>>>> wrote: On 2013/01/23 15:28, Ashley M. Kirchner wrote: Ok, I'm still trying to figure this out. On the new, test account, i can get it to log so I just need to figure out the other two. However, I recreated the same recipe on the test account and what I'm seeing in the log is the first part of the recipe only, it doesn't seem to do anything with the second part. So this (adjusted for the test account): LOGFILE=/var/log/procmail VERBOSE=yes :0 * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>>> * !^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>>> * !^From.*kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>>> * !^To.*mytest@papillon.pcraft.______com <mailto:mytest@papillon. <mailto:mytest@papillon.>__pcra__ft.com <http://pcraft.com> <mailto:mytest@papillon.__pcraft.com <mailto:mytest@papillon.pcraft.com>>> <mailto:ashley@papillon <mailto:ashley@papillon>. <mailto:ashley@papillon <mailto:ashley@papillon>.>__pcr__a__ft.com <http://pcra__ft.com> <http://pcraft.com> <mailto:ashley@papillon. <mailto:ashley@papillon.>__pcra__ft.com <http://pcraft.com> <mailto:ashley@papillon.__pcraft.com <mailto:ashley@papillon.pcraft.com>>>> ! kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:ashley@gmail.com <mailto:ashley@gmail.com> <mailto:ashley@gmail.com <mailto:ashley@gmail.com>> <mailto:ashley@gmail.com <mailto:ashley@gmail.com> <mailto:ashley@gmail.com <mailto:ashley@gmail.com>>>> :0c * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>>> mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com> <mailto:mytest@pcigrafx.com <mailto:mytest@pcigrafx.com>>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com> <mailto:ashley@pcigrafx.com <mailto:ashley@pcigrafx.com>>>> * ^X-Forwarded-For: kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com> <mailto:kirash4@gmail.com <mailto:kirash4@gmail.com>>>> mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com> <mailto:mytest@pcraft.com <mailto:mytest@pcraft.com>>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com> <mailto:ashley@pcraft.com <mailto:ashley@pcraft.com>>>> ! salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>>> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com> <mailto:salesdept@pcraft.com <mailto:salesdept@pcraft.com>>>__> Ashley, it might pay to explicitly say, in words, what you think you want to do if the first rule passes, if the first rule does not pass and the second rule passes, and if neither rule passes. As it is your description of passing the first rule is the correct action for what you've developed as a rule. You have delivered the email and rule processing ceases at that point. So you might have to clone the output of the first rule to pass it to the second rule IF that is the action you want based on your disappointment at these rules doing what you told them to do. {^_^}
On Wed, 23 Jan 2013 16:28:07 -0700, Ashley M. Kirchner wrote:
:0
- !^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.comashley@pcigrafx.com
- !^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com ashley@pcraft.com
- !^From.*kirash4@gmail.com
- !^To.*mytest@papillon.pcraft.com ashley@papillon.pcraft.com
! kirash4@gmail.com ashley@gmail.com
:0c
- ^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.comashley@pcigrafx.com
- ^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com ashley@pcraft.com
! salesdept@pcraft.com
Generates this in the log file when it first shows up and gets forwarded to GMail:
procmail: [7884] Wed Jan 23 16:02:10 2013 procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com" procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com" procmail: Match on ! "^From.*kirash4@gmail.com" procmail: Match on ! "^To.*mytest@papillon.pcraft.com" procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi kirash4@gmail.com" procmail: Executing "/usr/sbin/sendmail,-oi,kirash4@gmail.com" procmail: Notified comsat: "mytest@:/usr/sbin/sendmail -oi kirash4@gmail.com " From USER@DOMAIN.com Wed Jan 23 16:02:10 2013 Subject: This is a test message Folder: /usr/sbin/sendmail -oi kirash4@gmail.com 3139
And when it comes back from GMail:
procmail: [7892] Wed Jan 23 16:02:18 2013 procmail: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com" procmail: No match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcraft.com"
Those two above are for the first recipe.
procmail: No match on "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com"
This is for the second recipe. So far so good. But please pay attention to what it matched! Compare the first two lines of the log for each of the recipes:
1st recipe: Match on ! "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com"
2nd recipe: No match on "^X-Forwarded-For: kirash4@gmail.com mytest@pcigrafx.com"
"Match on ! …" is equivalent to "No match on …", so your returning email did NOT contain the wanted X-Forwarded-For line in the header. Can you look up such a forwarded message and show its headers? Does the message really contain such a header? The recipe looks strange, because it refers to a line with multiple email address, for example.
On 01/24/2013 01:26 AM, jdow wrote:
If you subtract out the loop are you trying to make a courtesy copy to one or more other addresses for all mail that is coming in? Your brief description below suggests that is the case. But the whole GMail loop is "undocumented" so it's hard to guess what really gets done.
I'm not sure, but I think he's running all of his incoming mail through Gmail's spam filter and only working with what gets through.
Yeah. I realize that's probably what's getting jdow confused as well. Hopefully my previous message explains it better. One bit I forgot to add, was something jdow asked, 'what happens if someone e-mails kirash4@gmaildirectly'
GMail forwards it back to my @pcraft domain. And that too will have the X-Forwarded-For header in it. So yes, the *only* messages that should reach the second part of the recipe, are those who have gone through the GMail loop (and therefore will contain the X-Forwarded-For header). Those messages are the ones I'm wanting to a) drop in my mailbox and b) send a copy to a co-worker.
Also asked was, why not use CC or BCC or a simple forward. I tried the forward path. Thing is, that happens both when the message arrives the first time as well as the second time, after getting filtered. So that won't work.
As for CC and BCC, I can't ask everyone and every list to send a CC/BCC to my coworker. That's just insane. Hence this approach to let procmail do it for me.
So yes, I am well aware that I need to make a copy of the message to send to my coworker. THAT's the part I can't figure out. It needs to happen only when it comes back from GMail, not before.
On Thu, Jan 24, 2013 at 11:39 AM, Joe Zeff joe@zeff.us wrote:
On 01/24/2013 01:26 AM, jdow wrote:
If you subtract out the loop are you trying to make a courtesy copy to one or more other addresses for all mail that is coming in? Your brief description below suggests that is the case. But the whole GMail loop is "undocumented" so it's hard to guess what really gets done.
I'm not sure, but I think he's running all of his incoming mail through Gmail's spam filter and only working with what gets through.
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.**org/mailman/listinfo/usershttps://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelineshttp://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
If I understand that correctly nothing at all gets through the first filter except mail that has been through gmail once.
If that is correct a simple clone will do the rest.
#initial filter for "has been through gmail once" goes here.
# copy email to second recipient :0 c ! secondrecipient@foobar.com
# falls through to firstrecipient@foobar.com
{^_^}
On 2013/01/24 11:09, Ashley M. Kirchner wrote:
Yeah. I realize that's probably what's getting jdow confused as well. Hopefully my previous message explains it better. One bit I forgot to add, was something jdow asked, 'what happens if someone e-mails kirash4@gmail directly'
GMail forwards it back to my @pcraft domain. And that too will have the X-Forwarded-For header in it. So yes, the *only* messages that should reach the second part of the recipe, are those who have gone through the GMail loop (and therefore will contain the X-Forwarded-For header). Those messages are the ones I'm wanting to a) drop in my mailbox and b) send a copy to a co-worker.
Also asked was, why not use CC or BCC or a simple forward. I tried the forward path. Thing is, that happens both when the message arrives the first time as well as the second time, after getting filtered. So that won't work.
As for CC and BCC, I can't ask everyone and every list to send a CC/BCC to my coworker. That's just insane. Hence this approach to let procmail do it for me.
So yes, I am well aware that I need to make a copy of the message to send to my coworker. THAT's the part I can't figure out. It needs to happen only when it comes back from GMail, not before.
On Thu, Jan 24, 2013 at 11:39 AM, Joe Zeff <joe@zeff.us mailto:joe@zeff.us> wrote:
On 01/24/2013 01:26 AM, jdow wrote: If you subtract out the loop are you trying to make a courtesy copy to one or more other addresses for all mail that is coming in? Your brief description below suggests that is the case. But the whole GMail loop is "undocumented" so it's hard to guess what really gets done. I'm not sure, but I think he's running all of his incoming mail through Gmail's spam filter and only working with what gets through. -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.fedoraproject.org> To unsubscribe or change subscription options: https://admin.fedoraproject.__org/mailman/listinfo/users <https://admin.fedoraproject.org/mailman/listinfo/users> Guidelines: http://fedoraproject.org/wiki/__Mailing_list_guidelines <http://fedoraproject.org/wiki/Mailing_list_guidelines> Have a question? Ask away: http://ask.fedoraproject.org