Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stain/mailer
Mass-mailer in Python
https://github.com/stain/mailer
Last synced: 3 months ago
JSON representation
Mass-mailer in Python
- Host: GitHub
- URL: https://github.com/stain/mailer
- Owner: stain
- License: gpl-3.0
- Created: 2014-11-05T14:24:08.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-10T08:49:47.000Z (about 9 years ago)
- Last Synced: 2024-10-16T01:21:13.419Z (3 months ago)
- Language: Python
- Size: 22.5 KB
- Stars: 2
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# mailer.py
Mass-mailer, reading two text files containing email text and
email addresses. Tested with Gmail.Author: Stian Soiland-Reyes
http://orcid.org/0000-0001-9842-9718Source code: https://github.com/stain/mailer
This is not intended for spam purposes, as it:
1. Is too slow for very large volumes (1s sleep pr email)
2. Uses your regular SMTP service
3. Does not support HTML emails or forged From addresses## License: GPL 3
(c) 2009-2015 University of Manchester
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .See [LICENSE.txt](LICENSE.txt) or https://www.gnu.org/licenses/gpl-3.0.html for details.
## Usage
stain@biggie-mint ~/src/mailer $ python mailer.py
Usage: mailer.py email.txt addresses.txtWhere email.txt is the RC822 formatted email (with headers)
and addresses.txt is a list of addresses to email, in the formFirst Last
stain@biggie-mint ~/src/mailer $ ./mailer.py email.txt test-addresses.txt
John Doe 01
02### email.txt
The first argument should be the name of a file containing an RFC822 valid
message, including header lines (minimum `Subject`). Example (from [email.txt](email.txt)):Subject: Example email
You are receiving this email because you registered to be kept informed
about our news. If this is no longer the case, feel free to reply to
this email, and we'll remove you from our subscription list.--
John Doe
example.com
--counter--The `From`, `Date` and `To` headers are added automatically.
The email file MUST be in UTF-8 encoding and should not contain HTML.
It is good practice to include a signature after `-- `.### addresses.txt
The list of addresses to email, line by line.
Example (from [test-addresses.txt](test-addresses.txt)):
John Doe
The name is important, as it will be used in the `To` header.
It is good practice to use say `test-addresses.txt` with
only yourself as recipient, to verify that the email looks as intended.#### Carbon copies
To include a `Cc:`` field, use a `\t`
### Serial numbers
If your email message file contains the string ``--counter--``, it will be
replaced with a counter, as returned when running the script. This is a
hexadecimal number starting from 01, e.g. 01, 02, ...,
09, 0a, 0b, 0c, 0d, 0e, 0f, 10, 11, etc.## Configuration
On first run, `~/.mailer` is created, and must be configured with the
smtp details:[smtp]
host = smtp.gmail.com
port = 587
tls = True
username = [email protected]
password = WrongPassword[email]
sender = [email protected]
from = Dummy User### [smtp]
The `[smtp]` section defines how to connect to the SMTP server for sending emails. The
defaults should work with Google by changing `username` and `password`. You might need to use
Google's [application passwords](https://security.google.com/settings/security/apppasswords)
for this feature.To configure against a different server, also modify `host` and `port`. Note that
most other authenticated SMTP servers require a plain username with
`@example.com`.For a classic local SMTP server that does not require TLS or username/password, remove
`username` and `password` and use simply:[smtp]
host = smtp.example.com
port = 25
tls = False### [email]
This section configures defaults for the outgoing email. The `sender` email
address should be one that is accepted by the outgoing email server, typically
for Gmail this is the same as your username.# Feedback
For any improvements or issues, please use either the
[Github issues](https://github.com/stain/mailer/issues)
or [Github pull requests](https://github.com/stain/mailer/pulls)