Skip to content

Commit

Permalink
couple of clean up and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDP committed Feb 17, 2021
1 parent 919256c commit 7572554
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
# Anonymous Secure Mail Transfer Protocol (ASMTP)

ASMTP put together pub/sub peer to peer protocol [`poldercast`], blockchain technology
**ASMTP** brings together pub/sub peer to peer protocol [`poldercast`], blockchain technology
from [`keynesis`] and encryption protocol [`noise`] to build a secure and anonymous
network protocol as an alternative to [SMTP] (Simple Mail Transfer Protocol).

ASMTP was written as a tool to initially securely exchange messages with friends and
colleagues. Tools that provides End to End encryptions often keep hidden from their
**ASMTP** was written as a tool to initially securely exchange messages with friends and
colleagues. Other tools that provides End to End encryptions often keep hidden from their
users that they are still collecting metadata (such as who talks to whom and what
time). `Signal` is an interesting messaging tool. However they still requires you
to have a phone number to register on their platform. This is not something I am happy
with too. If the telephone company decides to block `Signal` from sending you
the authentication code you are screwed. They may even intercept that authentication
code to register in our stead. Scary.
time).

ASMTP does not relies on any third party. Just like in the spirit of the old [SMTP],
**ASMTP** does not relies on any third party. Just like in the spirit of the old [SMTP],
messages are relayed from the mail server of the sender to the mail server
of the recipient and it may use an intermediate route to do so. (yes, [SMTP]
used to be decentralized by design until big companies started to offer
_"free"_ email services). However, unlike [SMTP], the sender and the recipient
identifier (email address for [SMTP]) is not known. Also unlike [SMTP] it is
not possible to receive messages from senders that are not "allowed" to.
of the recipient and it may use an intermediate route to do so.

# Deployment

Expand Down
29 changes: 26 additions & 3 deletions asmtp-cli/src/bin/asmtp-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,21 +664,44 @@ async fn sync_new_messages(
.with_context(|| format!("Failed to load messages for {topic}", topic = topic))?;
}

let pb = ProgressBar::new_spinner().with_style(style.spinner.clone());
pb.set_message("waiting for messages...");
pb.enable_steady_tick(style.spinner_interval);

let mut counter: usize = 0;

while let Ok(Some((_peer, message))) =
timeout(std::time::Duration::from_secs(2), connection.next()).await
{
let message = message?;
counter += 1;

if let Some((topic, m)) = message.topic_checked() {
eprintln!(
pb.println(format!(
"incoming message for {topic}",
topic = style.topic.apply_to(topic)
);
topic = style.topic.apply_to(topic),
));

let message = asmtp_storage::Message::open(state.db(), topic)?;
message.insert(m)?;
}
}
pb.finish_and_clear();

if counter > 0 {
eprintln!(
"{prefix} You have no new messages",
prefix = style.dialoguer.success_prefix,
);
} else {
let plural = if counter > 1 { "s" } else { "" };
eprintln!(
"{prefix} You have {count} new message{plural}",
prefix = style.dialoguer.success_prefix,
count = counter,
plural = plural,
);
}

Ok(())
}
Expand Down
8 changes: 2 additions & 6 deletions asmtpd/src/bin/asmtpd-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,10 @@ async fn make_gossip(password: Option<String>, config: PathBuf) -> Result<()> {
password
} else {
dialoguer::Password::new()
.with_confirmation(
"Confirm new password",
"Password mismatched, put your game together",
)
.allow_empty_password(false)
.with_prompt("Enter new password")
.with_prompt("Enter password")
.interact()
.context("Failed to confirm new password")?
.context("Failed gather password")?
};
config.secret.password = Some(password);

Expand Down
3 changes: 2 additions & 1 deletion asmtpd/src/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ network:
heart_beat: { secs: 1, nanos: 0 }

# initial list of known gossips
known_gossips: []
known_gossips:
- "80007353f1e7fb03b2346638b4e2b93f810c84853787970be0844df63cdc9979a01d0221561d561f667d26482dc49b0ef76a32f94aeecb4c01191510ca8ec977bd714545888ad0117fa81a176922927114db64cbc6666d2fa2877207baabe0080489fac7c054335c68fcc90d"

gossiping:
# number of seconds between 2 gossips to a specific node from our size
Expand Down

0 comments on commit 7572554

Please sign in to comment.