mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Wip
This commit is contained in:
@@ -204,6 +204,25 @@ class TestOfflineAccount:
|
|||||||
|
|
||||||
|
|
||||||
class TestOnlineAccount:
|
class TestOnlineAccount:
|
||||||
|
def test_one_account_init(self, acfactory):
|
||||||
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
|
wait_successful_IMAP_SMTP_connection(ac1)
|
||||||
|
wait_configuration_progress(ac1, 1000)
|
||||||
|
|
||||||
|
def test_one_account_send(self, acfactory):
|
||||||
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
|
c2 = ac1.create_contact(email=ac1.get_config("addr"))
|
||||||
|
chat = ac1.create_chat_by_contact(c2)
|
||||||
|
assert chat.id >= const.DC_CHAT_ID_LAST_SPECIAL
|
||||||
|
#wait_successful_IMAP_SMTP_connection(ac1)
|
||||||
|
wait_configuration_progress(ac1, 1000)
|
||||||
|
|
||||||
|
msg_out = chat.send_text("message2")
|
||||||
|
# wait for other account to receive
|
||||||
|
ev = ac1._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
|
||||||
|
assert ev[1] == msg_out.id
|
||||||
|
assert 0
|
||||||
|
|
||||||
def test_forward_messages(self, acfactory):
|
def test_forward_messages(self, acfactory):
|
||||||
ac1 = acfactory.get_online_configuring_account()
|
ac1 = acfactory.get_online_configuring_account()
|
||||||
ac2 = acfactory.get_online_configuring_account()
|
ac2 = acfactory.get_online_configuring_account()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ fi
|
|||||||
pushd python
|
pushd python
|
||||||
toxargs="$@"
|
toxargs="$@"
|
||||||
if [ -e liveconfig ]; then
|
if [ -e liveconfig ]; then
|
||||||
toxargs="--liveconfig liveconfig tests/ $@"
|
toxargs="--liveconfig liveconfig $@"
|
||||||
fi
|
fi
|
||||||
tox -- $toxargs
|
tox -- $toxargs
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|||||||
19
src/smtp.rs
19
src/smtp.rs
@@ -48,6 +48,16 @@ impl Smtp {
|
|||||||
|
|
||||||
/// Connect using the provided login params
|
/// Connect using the provided login params
|
||||||
pub fn connect(&mut self, context: &Context, lp: *const dc_loginparam_t) -> usize {
|
pub fn connect(&mut self, context: &Context, lp: *const dc_loginparam_t) -> usize {
|
||||||
|
warn!(context, 0, "SMTP ***************** CONNECT");
|
||||||
|
unsafe {
|
||||||
|
dc_log_event(
|
||||||
|
context,
|
||||||
|
Event::INFO,
|
||||||
|
0,
|
||||||
|
b"SMTP ***************************************************** connect starts" as *const u8 as *const libc::c_char,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if lp.is_null() {
|
if lp.is_null() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -137,6 +147,15 @@ impl Smtp {
|
|||||||
.credentials(creds)
|
.credentials(creds)
|
||||||
.connection_reuse(lettre::smtp::ConnectionReuseParameters::ReuseUnlimited);
|
.connection_reuse(lettre::smtp::ConnectionReuseParameters::ReuseUnlimited);
|
||||||
self.transport = Some(client.transport());
|
self.transport = Some(client.transport());
|
||||||
|
unsafe {
|
||||||
|
dc_log_event(
|
||||||
|
context,
|
||||||
|
Event::SMTP_CONNECTED,
|
||||||
|
0,
|
||||||
|
b"SMTP-LOGIN ok" as *const u8
|
||||||
|
as *const libc::c_char,
|
||||||
|
);
|
||||||
|
}
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user