3
@6^
                 @   s0   d dl Z d dlmZmZmZ G dd deZdS )    N)
SpiderFootSpiderFootPluginSpiderFootEventc               @   sB   e Zd ZdZdZi Zi Ze fddZdd Z	dd Z
d	d
 ZdS )sfp_emailformatzgEmailFormat:Footprint,Investigate,Passive:Search Engines::Look up e-mail addresses on email-format.com.Nc             C   s8   || _ | j | _x"t|j D ]}|| | j|< qW d S )N)sftempStorageresultslistkeysopts)selfsfcuserOptsopt r   :/var/www/spiderfoot.crq.systems/modules/sfp_emailformat.pysetup!   s    
zsfp_emailformat.setupc             C   s   ddgS )NINTERNET_NAMEDOMAIN_NAMEr   )r   r   r   r   watchedEvents)   s    zsfp_emailformat.watchedEventsc             C   s   dgS )N	EMAILADDRr   )r   r   r   r   producedEvents/   s    zsfp_emailformat.producedEventsc             C   s  |j }|j}|j}|| jkr d S d| j|< | jjd| d |  | jjd| d | jd | jd d}|d	 d krxd S | jj|d	 }x|D ]}d
}|j	 j
dd }	| j j|	ddds| jjd|  qtjd|r| jjd|  q| jjd|  t||| j|}
| j|
 qW d S )NTzReceived event, z, from zhttps://www.email-format.com/d//_fetchtimeout
_useragent)timeout	useragentcontentr   @   )includeChildrenincludeParentszSkipped address: z^[0-9a-f]{8}\.[0-9]{7}@zFound e-mail address: )	eventTypemoduledatar   r   debugfetchUrlr   parseEmailslowersplit	getTargetmatchesrematchinfor   __name__notifyListeners)r   event	eventNamesrcModuleName	eventDataresemailsemailevttypemailDomevtr   r   r   handleEvent3   s0    

&
zsfp_emailformat.handleEvent)r/   
__module____qualname____doc__r   r   optdescsdictr   r   r   r;   r   r   r   r   r      s   r   )r,   sflibr   r   r   r   r   r   r   r   <module>   s   