xct's notes
Search…
Mail

Imap

Login

1
a login <username>@<domain> <password>
Copied!

List mailboxes

1
a LIST "" "*"
Copied!

Select mailbox

1
a SELECT <mailboxname>
Copied!

Search messages:

1
a UID SEARCH ALL`
Copied!

Read Messages

1
a UID FETCH <ID> (BODY[1.1])
2
BODY.PEEK[]
3
UID FETCH <uid> (BODY[1])
Copied!

Connect to pop3:

1
openssl s_client -connect <ip>:<port> -crlf
Copied!

Send Mail from CLI:

1
sendEmail -t <rcptAddr> -f <senderAddr> -s <mailSrvAddr> -u "Some Subject" -m "Some Content"
Copied!
Append Files with "-a <filename>", example of html mail with appended file:
1
sendemail -s <target>:25 -f [email protected] -t [email protected] -o message-content-type=html -m "<html><head><title>Issue</title></head><body></body></html>" -a important.docx
Copied!

Send Mails from Bash

1
cat emails.txt | while read u ; do swaks --to $u --from <> --header "Subject: <>" --body "<>" --server <> ; done
Copied!
We can also attach files with swaks using "--attach".
Last modified 9mo ago
Copy link