Rename sort_recipients to deliver_message, remove unused imports
This commit is contained in:
parent
b627fde510
commit
5ffbbec5f0
|
@ -19,30 +19,12 @@
|
||||||
# along with gpg-mailgate source code. If not, see <http://www.gnu.org/licenses/>.
|
# along with gpg-mailgate source code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
from configparser import RawConfigParser
|
|
||||||
from email.mime.base import MIMEBase
|
|
||||||
from email.mime.multipart import MIMEMultipart
|
|
||||||
import copy
|
|
||||||
import email
|
import email
|
||||||
import email.message
|
|
||||||
import email.utils
|
|
||||||
import GnuPG
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import smtplib
|
|
||||||
import sys
|
import sys
|
||||||
import syslog
|
|
||||||
import traceback
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
# imports for S/MIME
|
|
||||||
from M2Crypto import BIO, Rand, SMIME, X509
|
|
||||||
from email.mime.message import MIMEMessage
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import lacre
|
import lacre
|
||||||
import lacre.text as text
|
|
||||||
import lacre.config as conf
|
import lacre.config as conf
|
||||||
import lacre.mailgate as mailgate
|
import lacre.mailgate as mailgate
|
||||||
|
|
||||||
|
@ -65,7 +47,7 @@ from_addr = raw_message['From']
|
||||||
to_addrs = sys.argv[1:]
|
to_addrs = sys.argv[1:]
|
||||||
|
|
||||||
# Let's start
|
# Let's start
|
||||||
mailgate.sort_recipients(raw_message, from_addr, to_addrs)
|
mailgate.deliver_message(raw_message, from_addr, to_addrs)
|
||||||
(elapsed_s, process_t) = mailgate.exec_time_info(start)
|
(elapsed_s, process_t) = mailgate.exec_time_info(start)
|
||||||
|
|
||||||
LOG.info("Elapsed-time: {elapsed:.2f}s; Process-time: {process:.4f}s".format(elapsed=elapsed_s, process=process_t))
|
LOG.info("Elapsed-time: {elapsed:.2f}s; Process-time: {process:.4f}s".format(elapsed=elapsed_s, process=process_t))
|
||||||
|
|
|
@ -394,7 +394,7 @@ def send_msg( message, recipients ):
|
||||||
else:
|
else:
|
||||||
LOG.info("No recipient found")
|
LOG.info("No recipient found")
|
||||||
|
|
||||||
def sort_recipients( raw_message, from_address, to_addrs ):
|
def deliver_message( raw_message, from_address, to_addrs ):
|
||||||
global LOG
|
global LOG
|
||||||
global from_addr
|
global from_addr
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue