Menu

#1 match_recipients() utility function

open
None
5
2004-06-09
2004-06-09
Greg Ward
No

From an elspy-users post by Andrew Kuchling:

I've found the following function handy for checking if
a given recipient is
present in the envelope-to. Perhaps it's a candidate
for the elspy library?

Examples:
To reject all mail which is addressed to
spamtrap@example.com.

if match_recipients(info.recipients_list,
'spamtrap', 'example.com'):
raise RejectMessage("Spam not wanted here")

To allow only 'barb' and 'amk' local parts:

info.recipients_list =
match_recipients(info.recipients_list,
['barb', 'amk'],
'example.com')

--amk

Discussion

  • Greg Ward

    Greg Ward - 2004-06-09
     
  • Greg Ward

    Greg Ward - 2004-06-09

    Logged In: YES
    user_id=14422

    Superficial reactions:
    * can't this be done in an ACL?
    * is a regex really needed?

     
  • Greg Ward

    Greg Ward - 2004-06-09
    • assigned_to: nobody --> gward
     

Log in to post a comment.