Compare commits

..

No commits in common. "7d7bc5b28e26a3de40c050f76a79190a7be7f105" and "76e25393d0ba15ae7553bebab54432d30011f9be" have entirely different histories.

4 changed files with 0 additions and 10 deletions

0
mastodon_email_bridge/__init__.py Executable file → Normal file
View file

View file

@ -51,7 +51,6 @@ class MastodonEmailBridge:
)
self._init_log()
self.last_translation_response = None
self.last_smtp_connection = None
self._get_sent_posts()
if 'templates_folder' in self.config:
templates_folder=self.config['templates_folder']
@ -189,8 +188,6 @@ class MastodonEmailBridge:
def send_mail(self, data):
'''Send an email with the post composed'''
if time.time() - self.last_smtp_connection < 1:
time.sleep(1)
sender = self._str_template(self.config['sender'], data)
recipient = self._str_template(self.config['recipient'], data)
msg = MIMEMultipart('alternative')
@ -238,7 +235,6 @@ class MastodonEmailBridge:
self._log.debug("Sending email for post with id '%s'...", data['id'])
conn.sendmail(sender, recipient, msg.as_string())
conn.quit()
self.last_smtp_connection = time.time()
self._log.debug("Adding entry to database...")
cur = self.sqlite.cursor()
res = cur.execute("SELECT id FROM sent_items WHERE id = ?", [(data['id'])])
@ -474,12 +470,6 @@ class MastodonEmailBridge:
default='en',
help='Language destination for the translations'
)
@click.option(
'--connections-per-second',
'-c',
default=1,
help='Maximun number of SMTP connections per second'
)
@click.option('--log-file', '-l', help="File to store all debug messages.")
# @click.option("--dummy","-n", is_flag=True,

0
setup.py Executable file → Normal file
View file

0
wrapper.sh Executable file → Normal file
View file