procmail
[Top] [All Lists]

Re: Email forwarding

1996-02-09 17:21:05
Nancy McGough <nancym(_at_)halcyon(_dot_)com> wrote:

On Fri, 9 Feb 1996 jzc(_at_)sibs(_dot_)com wrote:
I am using following recipes to do email forwarding:

:0
* ^TOtom(_at_)sibs(_dot_)com
! sibs(_at_)styx(_dot_)ios(_dot_)com

:0
* ^TOjoe(_at_)sibs(_dot_)com
! joet(_at_)styx(_dot_)ios(_dot_)com

When someone send an email:
  To: tom(_at_)sibs(_dot_)com
  cc: joe(_at_)sibs(_dot_)com

Tom gets two copies and Joe gets nothing.

It seems to me that a message with these headers:

  To: tom(_at_)sibs(_dot_)com
  Cc: joe(_at_)sibs(_dot_)com

And your recipes would match on the first recipe
and then be forwarded to tom once (does it really get
forwarded to him twice?).

He gets two copies because TWO messages come through the procmail 
script -- one for the TO: delivery to tom, and another for the CC: 
delivery to joe (these are separatley delivered messages) -- but both 
of them appear the same in content.  That is, this script is only a 
problem when more than one recepient on the sibs.com system recieves 
the same message.


[big snip]

If there are more than 2 users at sibs.com then the
number of cases becomes astronomical.  As Soren
said, it's best to use sendmail!

Another (kludgy) alternative would be to have a logfile for each of the 

recepients (joe.log, tom.log) somewhere, and feed the messageid into 
each one.  Then, after checking each recepient, you'd check to see 
whether THIS messageid was already processed for that person, and if 
so, skip out and continue (to process for any other reciepients).  
Since you shouldn't be receiving the message more times than the number 
of people you'd have set up for forwarding to, nobody should lose mail, 
and the default forwarding mechanism at the bottom of the script (you 
have one, right?) would be forwarding it because apparently it'd been 
sent into the domain without a valid userid (at least not one being 
handled in your script).

Entries in the logs could be purged after 7 days or so, which is 
probably quite sufficient.

Of course, this is a kludge, and broken mailers (inserting bogus-formed 
message ids) could pose a problem.  I don't know of any off hand 
though.

[when reading the following, keep in mind, I'm not the originator of 
this thread]

Since I have an interest in setting up such a forwarding system myself 
((I'm getting a domain soon, and I'll be forwarding my own mail, as 
well as family members and some friends), this is a rather important 
issue to me.  I'm not root on the system (i.e. it is a domain to which 
ALL uids forward into the one mailbox on someone else's physical 
system), which I believe presents some issues with using sendmail to 
resolve this sort of thing, does it not?

Ultimatley, I'd rather be able to have a file with a list of addresses 
for forwarding, and simply have the script handle all the addresses:

default,PSE(_at_)ix(_dot_)netcom(_dot_)com
PSE(_at_)professional(_dot_)net,PSE(_at_)ix(_dot_)netcom(_dot_)com
Sean(_at_)professional(_dot_)net,PSE(_at_)ix(_dot_)netcom(_dot_)com
Mom(_at_)professional(_dot_)net,mom-n-dad's address
Dad(_at_)professional(_dot_)net,mom-n-dad's address
etc...

(similarily, the target email addresses could instead be mailboxes -- 
especially useful for netless associates and downloaded periodically -- 
and the messages _could_ be public key encrypted if desired, but that 
is another matter entirely).

An external file has the benefit of not requiring the script to be 
constantly modified because you offer forwarding for yet another 
friend.  I've become moderatley proficient at using procmail to start 
up scripts on my shell account to do things (send files, info, start 
processes and update web pages, etc), and figure it would be trivial to 
add code to update the forwarding file in the same manner (from a 
message from my verified account -- with a change authorization 
password in the message to reduce problems with forgeries), just like 
the vacation message scripting adding addresses of people who've 
already received the vacation message.  In short, doing it this way 
means I don't have to constantly have to revisit the script to change 
things (I use a PPP account generally, the UNIX shell account is 
generally used for support functions, such as mail 
filtering/forwarding).

Does this make sense?  Has anyone already implemented such a system 
(no, I'm not holding my breath on that one).

Cheers.

-- 
NetCruisers:  ftp://ftp.netcom.com/pub/ps/pse/www/pse_home.html
Home of NCUtil, 3rd-party utility links (including Winsock), and FAQs!

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395
 CompuServe: 72210,521           Internet: PSE(_at_)ix(_dot_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>