Re: new-mail flag files

At 13:49 2010-09-30, Enrico Weigelt wrote:
> > :0
> > * some condition
> > * ? touch /path/to/file
> > ACTION
>
>"* ? ..." means that <...> will be executed ?

'man procmail' and 'man procmailex' would be appropriate commands to 
run about now.

Alternatley, you could invoke touch inside a braced action:

:0
* some condition
{
         DUMMY=`touch /path/to/file`

         :0
         DELIVERY_ACTION
}

You can use the ? condition syntax to grep the touched file, or you 
could echo something into a file, whatever.

I'm unclear on the specifics of what you're trying to accomplish, but 
let's say that the external process that cares about the touched file 
only needs to be run once in a while, but not on each message 
reception, if that process deletes the touchfile when complete, your 
procmail recipe could TEST to see if the file exists - if it does, 
(Continue reading)

Matee Moshkovits | 3 Oct 2010 03:31

Vacation (was: procmail Digest, Vol 93, Issue 1)

Hi
Thank You for your email. Currently the AffordHost office is closed for holidays .  The Office will re-open Monday October 1, 2010.  If your matter is Urgent please contact Kumar <at> (416)844-0783
-- If you have any questions, please do not hesitate to contact our office. Thank You Matee Moshkovits Chief Technology Officer AffordHost Inc. Direct Telephone: (416)238-7698 ext. 225 Toll Free: 1-888-613-HOST Email: mmmoshko <at> affordhost.com Business-Class Web Hosting at Affordable Prices
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

Re: Vacation (was: procmail Digest, Vol 93, Issue 1)

At 18:31 2010-10-02, Matee Moshkovits wrote:
>Thank You for your email. Currently the AffordHost office is closed 
>for holidays .  The Office will re-open Monday October 1, 2010.

Ordinarily, if there were an autoreply to a _digest_, and the 
implication is that they'd be back the following day, I might not 
remove the subscriber, but here, the return date isn't even valid.

As a general rule, if you've got to send vacation messages, 
pre-filter list messages (I'd use my list-id.rc include to identify 
lists, but it'd suffice to look for any of the RFC-2369 or RFC-2919 
specified list headers).  This is on top of not sending autoreplies 
to looped or daemon (non-human) messages, and of course, cacheing the 
addresses to which replies have been sent.

I don't use vacation autoreplies myself, but I took the code from 
'man procmailex' and revised it (heavily), in the hopes that someone 
might consider their vacation recipe implementation before inflicting 
it upon the masses:

# set this to your email address, or some identifier at your domain which
# associates to your email account (i.e. if you have multiple aliases
# processed by one account, this needn't be the specific alias)
LOOPADDR="your <at> own.mail.address"

# specify the name of the vacation message
VACATIONMSG=$HOME/vacation_msg

# specify cache
ALREADYSENT=$HOME/vacation.cache

:0
# check to see if the vacation message is present - if not, assume
# we're not on vacation (what would the purpose be if we don't have
# a message to reply with?)
* ? test -e $VACATIONMSG
# Perform a quick check to see if the mail was addressed to us
# (may need to exclude this if you have a lot of aliases, but if you don't,
# it is best to keep this)
* $ ^To:.*\<$\LOGNAME\>
# Don't reply to daemons and mailinglists - among other things, this
# incorporates Precedence: (junk|bulk|list)
* ! ^FROM_DAEMON
# Mail loops are evil
* !$ ^X-Loop: $LOOPADDR
# RFC-2369 or RFC-2919 list headers (this regexp is broad)
* ! ^List-
{
         # update cache.  Use larger size if needed
         # the result of this action is used to determine whether a notice
         # should actually be sent or not
         :0 Whc: vacation.lock
         | formail -rD 8192 $ALREADYSENT

         # if the name was not in the cache, reply with your
         # vacation message
         :0 ehc
         | (formail -rI"Precedence: junk" \
                 -A"X-Loop: $LOOPADDR" ; \
                 cat $VACATIONMSG $HOME/.signature \
                 ) | $SENDMAIL -oi -t
}

I'm open to suggestions for improvements - again, I don't use 
vacation recipes, but perhaps we should try to make a fairly all 
inclusive one?  I have a few other variations on vacation in my 
procmail archives, but as I've not been following the vacation 
"scene", I haven't been making sure they've kept up with the times.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.
Henry E. | 8 Oct 2010 01:08
Picon

how to delete duplicate emails

Hello,

I've got  duplicate messages in an email folder. The SA does not
know what's causing the issue.  So, I need to delete them
I read I can use the following command.  However it just deletes
all messages in the old folder and does not create the new folder.
If someone knows how this can be done, could they pls post
how to solve it.

formail -D 8192 msgid.cache < oldfolder >> newfolder

Also, could you suggest how to lock the oldfolder while doing
the formail.

thanks alot,
henry

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

Re: how to delete duplicate emails

At 16:08 2010-10-07, Henry E. wrote:

>I've got  duplicate messages in an email folder. The SA does not
>know what's causing the issue.  So, I need to delete them
>I read I can use the following command.  However it just deletes
>all messages in the old folder and does not create the new folder.
>If someone knows how this can be done, could they pls post
>how to solve it.
>
>formail -D 8192 msgid.cache < oldfolder >> newfolder

The formail command would be invoked from within a procmail recipe, 
not standalone at the commandline.  See 'man procmailex', which 
provides an example of its usage for eliminating duplicates.  BEFORE 
YOU IMPLEMENT THE RECIPE, BE SURE TO PURGE YOUR BOGUS msgid.cache 
FILE, OR EVERYTHING IN oldfolder WILL BE CONSIDERED A DUPLICATE (up 
to the constraints of the size of the cache at least).

This is using the messageid of the message - so you may have a 
message that passes through a mailing list AND is CC'd to you - 
despite having taken two separate paths to reach you, only the first 
to arrive will be maintained.  That is, while a list message will 
have additional headers, and perhaps a list-inserted footer, it is 
ONLY the messageid that is used to identify that they are duplicates.

>Also, could you suggest how to lock the oldfolder while doing
>the formail.

Per the recipe in 'man procmailex':

:0 Whc: msgid.lock
| formail -D 8192 msgid.cache

:0 a:
duplicates

## uncomment this if running standalone
## change as necessary for maildir
#:0:
#new.mbx

If you want to take old mail and handle it, you'll need to put the 
above recipe into its own file and uncomment the recipe at the 
bottom, then invoke it with something like:

         formail -s procmail -m duplicates.rc < old.mbx

If you're dealing with maildir instead of mbx, you'll need to update 
the recipe to deliver to your maildirm MOVE your maildir to a new 
folder, then invoke procmail with each message.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.
Matthew G. Saroff | 10 Oct 2010 22:37
Picon
Favicon

Why do I Get "sh: Cannot determine current working directory"

 	I moved to a new ISP, and I started to get this error in my 
procmail log.

 	I have narrowed down to two recipes, because when I comment them 
out, the error goes away:

=======================================
#Add to Jobs Folder
# This will send anything on my jobs list to my jobs folder
# 
:0:
* ? ($FORMAIL -xFrom:) | /usr/bin/fgrep -i -f $HOME/Procmail/jobs
$HOME/incoming/jobs

# This will send anything on my approved list to my default in box
# inbox
:0:
* ? ($FORMAIL -xFrom:) | /usr/bin/fgrep -i -f $GOLIST
$DEFAULT
=======================================

I'm wondering if this is a permissions issue on my maildir:

lrwxrwxrwx   1 root     wheel        43 Sep 24  2007 .maildir -> 
/net/mail/spool/panix/0/5/msaroff <at> panix.com

My maildir is specified as :
MAILDIR=$HOME/.maildir/

Since I use POP, the shell, and web mail, to read my email, I need this 
setting I so that my inbox is accessible via their webmail system when 
I am on the road.

--

-- 
Matthew G. Saroff, E.I.T.
Owings Mills, MD
E-mail: msaroff <at> pobox.com

Yadda, yadda, yadda, I gotta blog.
http://40yrs.blogspot.com

Re: Why do I Get "sh: Cannot determine current working directory"

At 13:37 2010-10-10, Matthew G. Saroff wrote:
>         I moved to a new ISP, and I started to get this error in my 
> procmail log.

Well, for one, that's not a procmail error, it's an error being 
kicked up by sh.

Chances are, there's an intermediate directory that you don't have 
permissions to.  Perhaps the mail directory is mounted NFS?

>lrwxrwxrwx   1 root     wheel        43 Sep 24  2007 .maildir -> 
>/net/mail/spool/panix/0/5/msaroff <at> panix.com

What are the perms of the target itself -- the perms and ownership 
you see here are for the symlink.

Q: is procmail the LDA, or are you invoking it from a .forward?  Are 
these the only recipes you have that are invoking shell?  Is it 
possible that your new ISP has smrsh (sendmail restricted shell)?

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.
Matthew G. Saroff | 12 Oct 2010 06:44
Picon
Favicon

Re: Why do I Get "sh: Cannot determine current working directory"

I just got an answer from tech support.

Basically, procmail doesn't handle the symbolic link well on this system, 
so I changed it to another directory $HOME/Mail, and I do not get the 
error message.

No data waqs lost in either case.

-- 
Matthew G. Saroff
Owings Mills, MD

On Sun, 10 Oct 2010, Professional Software Engineering wrote:

> At 13:37 2010-10-10, Matthew G. Saroff wrote:
>>         I moved to a new ISP, and I started to get this error in my 
>> procmail log.
>
> Well, for one, that's not a procmail error, it's an error being kicked up by 
> sh.
>
> Chances are, there's an intermediate directory that you don't have 
> permissions to.  Perhaps the mail directory is mounted NFS?
>
>> lrwxrwxrwx   1 root     wheel        43 Sep 24  2007 .maildir -> 
>> /net/mail/spool/panix/0/5/msaroff <at> panix.com
>
> What are the perms of the target itself -- the perms and ownership you see 
> here are for the symlink.
>
> Q: is procmail the LDA, or are you invoking it from a .forward?  Are these 
> the only recipes you have that are invoking shell?  Is it possible that your 
> new ISP has smrsh (sendmail restricted shell)?
>
> ---
> Sean B. Straw / Professional Software Engineering
>
> Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
> Please DO NOT carbon me on list replies.  I'll get my copy from the list.
>
> ____________________________________________________________
> procmail mailing list   Procmail homepage: http://www.procmail.org/
> procmail <at> lists.RWTH-Aachen.de
> http://mailman.rwth-aachen.de/mailman/listinfo/procmail
>
Jostein Berntsen | 13 Oct 2010 12:53
Picon
Gravatar

Problems filtering mail addresses

Hi,

I am subscribing to the Van Morrison mailing lists(van-l <at> yahoogroups.com 
and van-m <at> yahoogroups.com) but it seems like several of the emails to 
this list is not filtered by my procmail setup. Here is my procmail 
rules:

":0
* ^TO_van-m <at> yahoogroups\.com
* ^TO_Van-M <at> yahoogroups\.com
* ^TO_Van-M <at> nic\.surfnet\.nl
* ^TO_van-l <at> yahoogroups\.com
* ^TO_van-info <at> yahoogroups\.com
* ^TO_van-l <at> nic\.surfnet\.nl
* ^TO_van-info <at> nic\.surfnet\.nl
* ^TO_van.*
* ^TO_VAN.*
* ^Subject: Van-.*
innboks/VAN/"

Example from the log:

"procmail: Assigning "LASTFOLDER=formail -D 8192 msgid.cache"
procmail: Unlocking "msgid.lock"
procmail: Executing "formail,-z"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)rec"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)vimoutliner"
procmail: No match on "^Subject: Cron.*rem"
procmail: No match on "^Subject: Cron.*mairix"
procmail: No match on "^Subject: Cron.*screen"
procmail: No match on "^Subject: Cron.*mpc"
procmail: No match on "^Subject: Cron.*rsync"
procmail: No match on "^From.*conkyhardcore"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)conkyhardcore"
procmail: No match on "^From.*misty"
procmail: Match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)van-m <at> yahoogroups\.com"
procmail: Match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)Van-M <at> yahoogroups\.com"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)Van-M <at> nic\.surfnet\.nl"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)broadpark"
procmail: No match on "^From.*vidnes"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)recgroup"
procmail: No match on "^From.*recgroup"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)jostein\ <at> josteinb\.site"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)xlntit"
procmail: No match on "^From.*xlntit"
procmail: [30243] Wed Oct 13 12:39:31 2010
procmail: Assigning "LASTFOLDER=innboks/unsorted/new/1286966360.30243_2.josteinb"
procmail: Notified comsat: "jostein <at> 0:/home/jostein/mail//innboks/unsorted/new/1286966360.30243_2.josteinb"
From sentto-10763663-53810-1286966299-jbernts=broadpark.no <at> returns.groups.yahoo.com  Wed Oct 13
12:39:20 2010
 Subject: Re: Van-M Twitter - Huffington Post: Masonic Center, San Francisco,
  Folder: innboks/unsorted/new/1286966360.30243_2.josteinb   "

  Can I change my procmail filters to something more effective here? All 
  other mail filters seems to work perfectly. 

  TIA,

  Jostein
Ruud H.G. van Tol | 13 Oct 2010 14:52
Picon

Re: Problems filtering mail addresses

On 2010-10-13 12:53, Jostein Berntsen wrote:

> I am subscribing to the Van Morrison mailing lists(van-l <at> yahoogroups.com
> and van-m <at> yahoogroups.com) but it seems like several of the emails to
> this list is not filtered by my procmail setup. Here is my procmail
> rules:
>
>
> ":0
> * ^TO_van-m <at> yahoogroups\.com
> * ^TO_Van-M <at> yahoogroups\.com
> * ^TO_Van-M <at> nic\.surfnet\.nl
> * ^TO_van-l <at> yahoogroups\.com
> * ^TO_van-info <at> yahoogroups\.com
> * ^TO_van-l <at> nic\.surfnet\.nl
> * ^TO_van-info <at> nic\.surfnet\.nl
> * ^TO_van.*
> * ^TO_VAN.*
> * ^Subject: Van-.*
> innboks/VAN/"

That looks really weird. It is in double quotes, and ands a few 
non-cooperating conditions.

ITYM:

   :0
   * 9876543210^0 ^TO()van
   * 9876543210^0 ^Subject: Van-
   innboks/VAN/

--

-- 
Ruud

Gmane