check if any connection first
This commit is contained in:
parent
7d7bc5b28e
commit
aa09425424
1 changed files with 3 additions and 2 deletions
|
@ -189,8 +189,9 @@ 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)
|
||||
if self.last_smtp_connection:
|
||||
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')
|
||||
|
|
Loading…
Reference in a new issue