intelligent-smtp-responder | This is an intelligent email-based agent server
kandi X-RAY | intelligent-smtp-responder Summary
kandi X-RAY | intelligent-smtp-responder Summary
intelligent-smtp-responder is a Python library typically used in Telecommunications, Media, Telecom applications. intelligent-smtp-responder has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However intelligent-smtp-responder build file is not available. You can download it from GitHub.
This is an intelligent email-based agent server, written in Python, using state machine logic to handle the SMTP protocol. The server works by responding to email sent to designated inboxes with canned, dynamic, or custom replies. Among the included examples, email sent to nyc-weather@ will be automatically replied with the [current weather forecast for NYC] agents/weather_response_example.py), using data from the National Weather Service website. Email sent to just weather@ will return a report based on the sender’s physical location, automatically determined from the email headers. With the exception of the latter, [more "intelligent" weather responder example] agents/weather_response_example.py#L79), the basic examples do not take account the sender, subject, or email message text, but the server can be extended with natural language processing and other AI techniques to provide more customized auto-replies. This code is loosely based on [Paul Tyma’s] [Mailinator] (in that it does not support the full range of SMTP commands, and instead uses ip traps and timeouts to foil spammers and other scripts or bots, continuing [the work described here] It also forms the basis for the server used by the [TeamWork.io] (and [ReadZap.com] web services.
This is an intelligent email-based agent server, written in Python, using state machine logic to handle the SMTP protocol. The server works by responding to email sent to designated inboxes with canned, dynamic, or custom replies. Among the included examples, email sent to nyc-weather@ will be automatically replied with the [current weather forecast for NYC] agents/weather_response_example.py), using data from the National Weather Service website. Email sent to just weather@ will return a report based on the sender’s physical location, automatically determined from the email headers. With the exception of the latter, [more "intelligent" weather responder example] agents/weather_response_example.py#L79), the basic examples do not take account the sender, subject, or email message text, but the server can be extended with natural language processing and other AI techniques to provide more customized auto-replies. This code is loosely based on [Paul Tyma’s] [Mailinator] (in that it does not support the full range of SMTP commands, and instead uses ip traps and timeouts to foil spammers and other scripts or bots, continuing [the work described here] It also forms the basis for the server used by the [TeamWork.io] (and [ReadZap.com] web services.
Support
Quality
Security
License
Reuse
Support
intelligent-smtp-responder has a low active ecosystem.
It has 13 star(s) with 4 fork(s). There are 3 watchers for this library.
It had no major release in the last 6 months.
intelligent-smtp-responder has no issues reported. There are no pull requests.
It has a neutral sentiment in the developer community.
The latest version of intelligent-smtp-responder is current.
Quality
intelligent-smtp-responder has 0 bugs and 0 code smells.
Security
intelligent-smtp-responder has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
intelligent-smtp-responder code analysis shows 0 unresolved vulnerabilities.
There are 0 security hotspots that need review.
License
intelligent-smtp-responder is licensed under the MIT License. This license is Permissive.
Permissive licenses have the least restrictions, and you can use them in most projects.
Reuse
intelligent-smtp-responder releases are not available. You will need to build from source code and install.
intelligent-smtp-responder has no build file. You will be need to create the build yourself to build the component from source.
Installation instructions, examples and code snippets are available.
intelligent-smtp-responder saves you 316 person hours of effort in developing the same functionality from scratch.
It has 759 lines of code, 58 functions and 17 files.
It has high code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA
kandi has reviewed intelligent-smtp-responder and discovered the below as its top functions. This is intended to give you an instant insight into intelligent-smtp-responder implemented functionality, and help decide if they suit your requirements.
- Run the forecast
- Get data from url
- Gets the location of a given IP address
- Generate url for given ip address
- Send a message through the recipients
- Save attachments
- Delete attachment files
- Clean attachment name
- Parse email content into a dictionary
- Parse attachment part
- Extract a header component from a message object
- Runs the time report
- Extract text from an html string
- Validate an email address
- Check if an email address is a valid email address
- Run the weather service
Get all kandi verified functions for this library.
intelligent-smtp-responder Key Features
No Key Features are available at this moment for intelligent-smtp-responder.
intelligent-smtp-responder Examples and Code Snippets
No Code Snippets are available at this moment for intelligent-smtp-responder.
Community Discussions
No Community Discussions are available at this moment for intelligent-smtp-responder.Refer to stack overflow page for discussions.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install intelligent-smtp-responder
Clone this repo, and make sure you have [pycurl](http://pycurl.sourceforge.net/) and [lxml](http://lxml.de/) installed (using [pip](http://www.pip-installer.org/en/latest/) is recommended):.
Edit the [config.py](config.py) file in this folder and redefine these variables with your server’s domain instead of <tt>example.org</tt>:. Edit the <tt>action_mailboxes</tt> dict in the [config.py](config.py) file. (optional) Edit the <tt>pass_through_mailboxes</tt> list in the [config.py](config.py) file. (optional) For logging, set the <tt>smtp_server_debug variable</tt> to <tt>True</tt>. Redirect port 25 (smtp) traffic. Edit the [run_smtps.sh](run_smtps.sh) file. Start the server as root/sudo using the [run_smtps.sh](run_smtps.sh) file: ```sh sh ./run_smtps.sh.
Edit the [config.py](config.py) file in this folder and redefine these variables with your server’s domain instead of <tt>example.org</tt>:
Edit the <tt>action_mailboxes</tt> dict in the [config.py](config.py) file. Each key is the name of the inbox you want the server to auto-respond to, and the value is the name of the module.class which is instantiated to carry out the request. Each class needs to be implemented or referenced in the [agents](agents) folder. See the [notes there](agents/responders.py#L74) for the class and functional prototype requirements, and also look at the [time](agents/time_response_example.py) and [weather](agents/weather_response_example.py) response examples.
(optional) Edit the <tt>pass_through_mailboxes</tt> list in the [config.py](config.py) file. These are the inboxes which the server ignores, and just passes through to the email address defined by the <tt>pass_through_target</tt> variable.
(optional) For logging, set the <tt>smtp_server_debug variable</tt> to <tt>True</tt> This will record the ip address, timestamp, and all commands up to DATA sent to the server by each client.
Redirect port 25 (smtp) traffic <a href="https://en.wikipedia.org/wiki/IPv4" target="_blank">IPv4</a> servers Run the [set_iptables.sh](set_iptables.sh) script as root or sudo: ``` sh ./set_iptables.sh The default port for redirecting incoming traffic is 8888, but you can change that as necessary. Optionally, create an <tt>/etc/iptables.up.rules</tt> file, so that the redirect takes effect on reboots: ``` iptables-save > /etc/iptables.up.rules vi /etc/network/if-pre-up.d/iptables chmod +x /etc/network/if-pre-up.d/iptables Where the <tt>/etc/network/if-pre-up.d/iptables</tt> file contains: ```sh #!/bin/sh /sbin/iptables-restore < /etc/iptables.up.rules For more details on this option, read: [http://articles.slicehost.com/2011/2/21/introducing-iptables-part-3](http://articles.slicehost.com/2011/2/21/introducing-iptables-part-3) or [https://wiki.debian.org/iptables](https://wiki.debian.org/iptables) You can always undo the iptables setting by running the <tt>unset_iptables.sh</tt> script as root/sudo (remember to remove or edit <tt>/etc/iptables.up.rules</tt> as well, if you chose that option initially). <a href="https://en.wikipedia.org/wiki/IPv6" target="_blank">IPv6</a> servers *If the server you are running this software also accepts IPv6 traffic, then you will need to do the following steps as well, since some email senders, notably Google's [gmail](http://gmail.com), use IPv6 if available.* Run the [set_ip6tables.sh](set_ip6tables.sh) script as root or sudo: ``` sh ./set_ip6tables.sh As with [set_iptables.sh](set_iptables.sh), the default port for redirecting incoming traffic is 8888, but you can change that as necessary. *__Note:__ If you change the port in [set_iptables.sh](set_iptables.sh) it __must__ be the same as the one in the [set_ip6tables.sh](set_ip6tables.sh) script.* As as before, create an <tt>/etc/ip6tables.up.rules</tt> file, so that the redirect takes effect on reboots: ``` ip6tables-save > /etc/ip6tables.up.rules vi /etc/network/if-pre-up.d/iptables And update the <tt>/etc/network/if-pre-up.d/iptables</tt> file to contain a third line, like so: ```sh #!/bin/sh /sbin/iptables-restore < /etc/iptables.up.rules /sbin/ip6tables-restore < /etc/ip6tables.up.rules
Edit the [run_smtps.sh](run_smtps.sh) file. By default, the server runs as user <tt>daemon</tt>, but if your auto-responder agents need access to different resources/user groups, just change the user defined at the end of this line: ```sh su -c "export PYTHONPATH=$PYTHONPATH:$smtps:$smtps/server:$smtps/utils:$smtps/agents; python -c 'import smtp_server; smtp_server.start()' > /tmp/smtp_server_$logfile.log 2>&1" daemon The script is designed to restart in case of an error, and if you'd like to get the log by email when that happens, change the target email address in this line: ```sh mail -s "SMTP server error!" support@example.org < /tmp/smtp_server_$logfile.log Note that logfiles do not over-write each other, so you can remove that line altogether, if you'd rather not get the alert.
Start the server as root/sudo using the [run_smtps.sh](run_smtps.sh) file: ```sh sh ./run_smtps.sh
Edit the [config.py](config.py) file in this folder and redefine these variables with your server’s domain instead of <tt>example.org</tt>:. Edit the <tt>action_mailboxes</tt> dict in the [config.py](config.py) file. (optional) Edit the <tt>pass_through_mailboxes</tt> list in the [config.py](config.py) file. (optional) For logging, set the <tt>smtp_server_debug variable</tt> to <tt>True</tt>. Redirect port 25 (smtp) traffic. Edit the [run_smtps.sh](run_smtps.sh) file. Start the server as root/sudo using the [run_smtps.sh](run_smtps.sh) file: ```sh sh ./run_smtps.sh.
Edit the [config.py](config.py) file in this folder and redefine these variables with your server’s domain instead of <tt>example.org</tt>:
Edit the <tt>action_mailboxes</tt> dict in the [config.py](config.py) file. Each key is the name of the inbox you want the server to auto-respond to, and the value is the name of the module.class which is instantiated to carry out the request. Each class needs to be implemented or referenced in the [agents](agents) folder. See the [notes there](agents/responders.py#L74) for the class and functional prototype requirements, and also look at the [time](agents/time_response_example.py) and [weather](agents/weather_response_example.py) response examples.
(optional) Edit the <tt>pass_through_mailboxes</tt> list in the [config.py](config.py) file. These are the inboxes which the server ignores, and just passes through to the email address defined by the <tt>pass_through_target</tt> variable.
(optional) For logging, set the <tt>smtp_server_debug variable</tt> to <tt>True</tt> This will record the ip address, timestamp, and all commands up to DATA sent to the server by each client.
Redirect port 25 (smtp) traffic <a href="https://en.wikipedia.org/wiki/IPv4" target="_blank">IPv4</a> servers Run the [set_iptables.sh](set_iptables.sh) script as root or sudo: ``` sh ./set_iptables.sh The default port for redirecting incoming traffic is 8888, but you can change that as necessary. Optionally, create an <tt>/etc/iptables.up.rules</tt> file, so that the redirect takes effect on reboots: ``` iptables-save > /etc/iptables.up.rules vi /etc/network/if-pre-up.d/iptables chmod +x /etc/network/if-pre-up.d/iptables Where the <tt>/etc/network/if-pre-up.d/iptables</tt> file contains: ```sh #!/bin/sh /sbin/iptables-restore < /etc/iptables.up.rules For more details on this option, read: [http://articles.slicehost.com/2011/2/21/introducing-iptables-part-3](http://articles.slicehost.com/2011/2/21/introducing-iptables-part-3) or [https://wiki.debian.org/iptables](https://wiki.debian.org/iptables) You can always undo the iptables setting by running the <tt>unset_iptables.sh</tt> script as root/sudo (remember to remove or edit <tt>/etc/iptables.up.rules</tt> as well, if you chose that option initially). <a href="https://en.wikipedia.org/wiki/IPv6" target="_blank">IPv6</a> servers *If the server you are running this software also accepts IPv6 traffic, then you will need to do the following steps as well, since some email senders, notably Google's [gmail](http://gmail.com), use IPv6 if available.* Run the [set_ip6tables.sh](set_ip6tables.sh) script as root or sudo: ``` sh ./set_ip6tables.sh As with [set_iptables.sh](set_iptables.sh), the default port for redirecting incoming traffic is 8888, but you can change that as necessary. *__Note:__ If you change the port in [set_iptables.sh](set_iptables.sh) it __must__ be the same as the one in the [set_ip6tables.sh](set_ip6tables.sh) script.* As as before, create an <tt>/etc/ip6tables.up.rules</tt> file, so that the redirect takes effect on reboots: ``` ip6tables-save > /etc/ip6tables.up.rules vi /etc/network/if-pre-up.d/iptables And update the <tt>/etc/network/if-pre-up.d/iptables</tt> file to contain a third line, like so: ```sh #!/bin/sh /sbin/iptables-restore < /etc/iptables.up.rules /sbin/ip6tables-restore < /etc/ip6tables.up.rules
Edit the [run_smtps.sh](run_smtps.sh) file. By default, the server runs as user <tt>daemon</tt>, but if your auto-responder agents need access to different resources/user groups, just change the user defined at the end of this line: ```sh su -c "export PYTHONPATH=$PYTHONPATH:$smtps:$smtps/server:$smtps/utils:$smtps/agents; python -c 'import smtp_server; smtp_server.start()' > /tmp/smtp_server_$logfile.log 2>&1" daemon The script is designed to restart in case of an error, and if you'd like to get the log by email when that happens, change the target email address in this line: ```sh mail -s "SMTP server error!" support@example.org < /tmp/smtp_server_$logfile.log Note that logfiles do not over-write each other, so you can remove that line altogether, if you'd rather not get the alert.
Start the server as root/sudo using the [run_smtps.sh](run_smtps.sh) file: ```sh sh ./run_smtps.sh
Support
For any new features, suggestions and bugs create an issue on GitHub.
If you have any questions check and ask questions on community page Stack Overflow .
Find more information at:
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page