def start_smtp_service(self, host, port, cert): """ Starts the smtp service. :param host: the hostname of the remove SMTP server. :type host: str :param port: the port of the remote SMTP server :type port: str :param cert: the client certificate for authentication :type cert: str """ # TODO Make the encrypted_only configurable # TODO pick local smtp port in a better way # TODO remove hard-coded port and let leap.mail set # the specific default. self.smtp_connection.qtsigs.connecting_signal.emit() from leap.mail.smtp import setup_smtp_gateway self._smtp_service, self._smtp_port = setup_smtp_gateway( port=2013, userid=self.userid, keymanager=self._keymanager, smtp_host=host, smtp_port=port, smtp_cert=cert, smtp_key=cert, encrypted_only=False)
def _start_smtp_service(self): """ Start the smtp service using the downloaded configurations. """ # TODO Make the encrypted_only configurable # TODO pick local smtp port in a better way # TODO remove hard-coded port and let leap.mail set # the specific default. # TODO handle more than one host and define how to choose hosts = self._smtp_config.get_hosts() hostname = hosts.keys()[0] host = hosts[hostname][self.IP_KEY].encode("utf-8") port = hosts[hostname][self.PORT_KEY] client_cert_path = self._smtp_config.get_client_cert_path( self._provider_config, about_to_download=True) from leap.mail.smtp import setup_smtp_gateway self._smtp_service, self._smtp_port = setup_smtp_gateway( port=2013, userid=self._userid, keymanager=self._keymanager, smtp_host=host, smtp_port=port, smtp_cert=client_cert_path, smtp_key=client_cert_path, encrypted_only=False)
def start(self): self._download_client_certificates() cert_path = self._client_cert_path() email = '%s@%s' % (self._srp_session.user_name, self._provider.domain) self._smtp_service, self._smtp_port = setup_smtp_gateway( port=self.TWISTED_PORT, userid=email, keymanager=self._keymanager, smtp_host=self._hostname.encode('UTF-8'), smtp_port=self._port, smtp_cert=cert_path, smtp_key=cert_path, encrypted_only=False)
def start(self): self._download_client_certificates() cert_path = self._client_cert_path() email = '%s@%s' % (self._srp_session.user_name, self._provider.domain) self._smtp_service, self._smtp_port = setup_smtp_gateway( port=self._twisted_port, userid=email, keymanager=self._keymanager, smtp_host=self._hostname.encode('UTF-8'), smtp_port=self._port, smtp_cert=cert_path, smtp_key=cert_path, encrypted_only=False )
def start(self): self._download_client_certificates() cert_path = self._client_cert_path() email = '%s@%s' % (self.username, self._provider.domain) self._local_smtp_service, self._local_smtp_service_socket = setup_smtp_gateway( port=self.local_smtp_port_number, userid=email, keymanager=self._keymanager, smtp_host=self._remote_hostname.encode('UTF-8'), smtp_port=self._remote_port, smtp_cert=cert_path, smtp_key=cert_path, encrypted_only=False )
def start(self): self._download_client_certificates() cert_path = self._client_cert_path() email = '%s@%s' % (self.username, self._provider.domain) self._local_smtp_service, self._local_smtp_service_socket = setup_smtp_gateway( port=self.local_smtp_port_number, userid=str(email), keymanager=self._keymanager, smtp_host=self._remote_hostname.encode('UTF-8'), smtp_port=self._remote_port, smtp_cert=cert_path, smtp_key=cert_path, encrypted_only=False )
def startInstance(self, keymanager, userid): # TODO automate bootstrapping stuff # TODO consolidate canonical factory user, provider = userid.split('@') host = 'cowbird.cdev.bitmask.net' remote_port = 465 client_cert_path = os.path.expanduser( '~/.config/leap/providers/dev.bitmask.net/' 'keys/client/stmp_%s.pem' % user) service, port = setup_smtp_gateway( port=2013, userid=userid, keymanager=keymanager, smtp_host=host, smtp_port=remote_port, smtp_cert=unicode(client_cert_path), smtp_key=unicode(client_cert_path), encrypted_only=False) self._instances[userid] = service, port