17 December, 2010
To meet this objective I have created the program in the file send-attachment.py and the configuration variables in conf.py. By changing the values in conf.py We can send the file containing the desired email addresses (to_addr) pattern (pattern) that We need. Failure to find any file with the pattern entered, the program sends an email to the address (alert) indicated to warn of the problem.
Sending email is done through an authenticated account (from_addr) on the same server SMTP (EMAIL_SERVER). That is why I recommend running the script with secure configuration file with read-only permissions for the user running: chmod 600 conf.py.
Next the files: