http://epydoc.sourceforge.net/stdlib/public/email.Utils-module.html
getaddresses(fieldvalues) Return a list of (REALNAME, EMAIL) for each fieldvalue.
http://mirrors.ccs.neu.edu/Python/pub/old-www/doc/current/lib/node589.html
<class 'geximon.exim.QueueManager'> ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', '_quit', '_synch', '_thread', 'addRecipients', 'bg_processing', 'bin_dir', 'callback', 'checkOutput', 'deliverMessages', 'do_update', 'editSender', 'exim_binary', 'freezeMessages', 'getConfiguration', 'getEximOutput', 'getMessageBody', 'getMessageHeaders', 'getMessageLog', 'giveUpMessages', 'markAllDelivered', 'queue_length', 'removeMessages', 'runQueue', 'schedule_update', 'stop', 'thawMessages', 'use_sudo']
http://lists.edgewall.com/archive/trac/2004-July/000474.html
Daragh Fitzpatrick wrote:
> I tried to do this in the code, but broke something else, and the ticket
> returns a 404. I don't have the setup to debug it.
>
> This is what I want to do in Notify.py:
>
> Original:
> def get_email_addresses(self, txt):
> import email.Utils
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> return filter(lambda x: x.find('@') > -1, emails)
>
> --
>
> Proposed change:
> def get_email_addresses(self, txt):
> import email.Utils
> domain = self.env.get_config('notification', 'default_domain',
> 'localhost')
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> emails_with_domain = []
> for e in emails:
> if e.count('@') == 0:
> emails_with_domain.append(e + '@' + domain)
> else:
> emails_with_domain.append(e)
> return filter(lambda x: x.find('@') > -1, emails_with_domain)
>
> --
>
> Why won't it work? Is the filter really recessary?
>
It's probably not a good idea to always append default_domain
to user names, that would only work for setups where all users
have email addresses with the same domain name. For example
that's not the case for projects.edgewall.com.
Cap Petschulat's suggestion is probably the way to go...
/ Jonas
| /Ablauf /Adressen /Ausbau /Etikette /NachArbeiten /Pflege-der-Daten /email /smtplib /tuning |
Linux/Internet/Mail/Schleuder/email (last modified 2008-11-04 07:00:06)