Alexander Krotov
8f7a456a39
Use 0 value for "delete_server_after" default.
...
Now 0 means "never delete", 1 means "delete at once" and other values
indicate the number of seconds after which them message should be
deleted from the server.
Configuration value interpretation is moved into
Context.get_config_delete_server_after() function.
2020-04-01 20:06:27 +03:00
Alexander Krotov
f2aa17c9d0
Resultify MsgId.delete_from_db()
2020-04-01 20:06:27 +03:00
Alexander Krotov
bc06b9e051
Do not send BCC-Self copy if we are going to remove it immediately
2020-04-01 20:06:27 +03:00
Alexander Krotov
2cf9c68040
Implement MsgId.unlink() and use it in DeleteMsgOnImap
...
Currently only trashed or hidden messages are deleted by
DeleteMsgOnImap, so it is safe to remove database records.
It is planned to delete messages on IMAP server after
user-configurable time to cleanup the server even for messages
displayed in chats. For such messages, we unlink them from the
Message-ID, but keep the database record to display them.
2020-04-01 20:06:27 +03:00
Alexander Krotov
4452cab987
Turn Message::Delete_from_db into MsgId method
2020-04-01 20:06:27 +03:00
Alexander Krotov
98bd64621a
Refactor Imap.delete_msg() error handling
...
Mutable UID reference is removed. Instead, ImapActionResult is
returned immediately.
If message has changed and UID does not correspond to expected
message, ImapActionResult::Failed is returned. Temprorary IMAP errors
result in ImapActionResult::RetryLater.
On the job side, ImapActionResult::RetryLater does not result in
immediate job retry anymore. Instead, job is retried with a backoff.
2020-04-01 20:06:27 +03:00
Alexander Krotov
76fc84be37
job: document DeleteMsgOnImap
2020-04-01 20:06:27 +03:00
dignifiedquire
f85b14a7f7
the basics work
2020-03-18 15:11:36 +01:00
dignifiedquire
aa45716ef7
cleanup and setup configure
2020-03-18 00:36:13 +01:00
dignifiedquire
846ef043d5
hook up scheduler with jobs
2020-03-18 00:01:59 +01:00
dignifiedquire
ce5b95f8e5
start setting up new scheduler
2020-03-17 13:48:03 +01:00
dignifiedquire
7140898db9
async file io
2020-03-14 16:26:15 +01:00
dignifiedquire
818e921192
it compiles
2020-03-14 15:17:47 +01:00
dignifiedquire
6ea1d665bb
start making sql async
2020-03-14 15:17:23 +01:00
dignifiedquire
62bfa5157b
async sleep
2020-03-14 15:16:27 +01:00
dignifiedquire
43a8828430
asyncify smtp thread state handling
2020-03-14 15:16:27 +01:00
dignifiedquire
618202cf8b
more async
2020-03-14 15:16:27 +01:00
dignifiedquire
9614a23506
first pass at async job
2020-03-14 15:14:49 +01:00
holger krekel
0ac0eeda34
better naming, less code
2020-02-20 01:30:21 +01:00
holger krekel
4d066b4fd2
refine processing of errors and result handling
2020-02-20 01:30:21 +01:00
Alexander Krotov
840e321dd9
Process Permanent and Transient SMTP errors
2020-02-20 01:30:21 +01:00
holger krekel
d5d662bc41
fix ordering error
2020-02-20 01:30:21 +01:00
holger krekel
0b0ed56901
directly attempt to re-connect if the smtp connection is maybe stale
...
also refactor performing the job-action into own function
2020-02-20 01:30:21 +01:00
bjoern
c8fe81e21d
Merge pull request #1243 from Ampli-fier/master
...
Minor changes in comments
2020-02-09 12:01:31 +01:00
Alexander Krotov
aadeb3b87e
job: do not render messages without recipients
2020-02-08 16:58:55 +01:00
Ampli-fier
b876e49393
Minor changes in comments
2020-02-07 20:01:17 +01:00
Alexander Krotov
a2845f44ab
Turn ChatId-related functions into methods
2020-01-25 22:11:13 +00:00
Alexander Krotov
a3f2088046
Fix the message printed on job success
...
"Cannot be retried" does not make it clear if the job succeeded or failed.
2020-01-20 10:47:32 +01:00
Floris Bruynooghe
186f5553b8
Introduce a ChatId newtype
...
This doesn't try and change the way ChatId is used. It still allows
creating them with 0 and lets some function use a ChatId(0) as error
return.
2020-01-19 23:42:08 +01:00
Alexander Krotov
d8454d9da5
Deduplicate SendMdn and SendMsgToSmtp code
2020-01-20 00:35:11 +03:00
Alexander Krotov
318194a216
Rename Param::MessageId into Param::MsgId
...
MsgId refers to database ID, same as crate::message::MsgId newtype.
2020-01-20 00:35:11 +03:00
Alexander Krotov
763587ffb4
Load only one job at a time
...
As a result of job, other jobs can be added or deleted. To avoid
processing deleted jobs and to process other jobs in the correct order,
we should reload them after performing each job.
However, we don't use "LIMIT 1" in SQL queries, because we want to be
able to skip over invalid jobs, and checking if job is invalid can only
be done in Rust.
2020-01-20 00:35:11 +03:00
Alexander Krotov
11afdb51f3
Log it when MDNs are combined
2020-01-20 00:35:11 +03:00
Alexander Krotov
e4353f4650
Aggregate SendMdn jobs
2020-01-20 00:35:11 +03:00
Alexander Krotov
9d4437a7f5
Make it possible to add X-Additional-Message-IDs to MDNs
2020-01-20 00:35:11 +03:00
Alexander Krotov
93800fd834
Construct list of recipients in SendMdn
...
There is always one recipient for MDNs, so it is easier to only handle
this case.
2020-01-20 00:35:11 +03:00
Alexander Krotov
79bc34ed76
Move check for blocked contact from mimefactory to SendMdn job
2020-01-20 00:35:11 +03:00
Alexander Krotov
b40ad7e87e
Store contact ID in SendMdn job foreign_id
...
This change makes it possible to find all pending MDNs for the contact
with an SQL query.
2020-01-20 00:35:11 +03:00
Alexander Krotov
1ab3fba212
Move check for enabled MDNs from message rendering to MDN job
2020-01-20 00:35:11 +03:00
Alexander Krotov
3cd0bbc0f4
Move foreign_id handling out of mimefactory
2020-01-20 00:35:11 +03:00
Alexander Krotov
a806728e43
Make a new job type for MDN sending
...
Now MDN is generated on every try instead of being stored in a blob.
2020-01-20 00:35:11 +03:00
Alexander Krotov
683037ca69
Remove no-op jobs SendMdnOld and SendMsgToSmtpOld
2020-01-20 00:35:11 +03:00
Alexander Krotov
bd70765b7d
Join recipients_names and recipients_addr into one vector
...
This change ensures on the type level that number of names and addresses
is the same.
2020-01-10 06:42:36 +00:00
Alexander Krotov
25842894d2
Rename job::Try into job::Status
2019-12-28 14:35:14 +00:00
Alexander Krotov
83c98c2d55
Replace unstable try_trait with a job_try! macro
2019-12-28 14:35:14 +00:00
Alexander Krotov
fe2011742d
Job error handling refactoring
2019-12-28 14:35:14 +00:00
B. Petersen
f73ba895af
remove some meanwhile unneeded allow-statements
2019-12-26 16:26:06 +00:00
Alexander Krotov
e203901224
Better logging message for job deletion
...
The logging message printed for successful job completion said that the
job "cannot be retried" even when it does not need to be retried.
2019-12-24 10:47:29 +00:00
Alexander Krotov
76d03f7fd2
Log SMTP connection failure errors
2019-12-23 07:14:11 +01:00
Alexander Krotov
47be879445
fix(job): log all job events in job_perform()
2019-12-21 15:24:30 +00:00