Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 415f98a

Browse files
committed
Github actions fixes.
1 parent f2f0d2e commit 415f98a

File tree

9 files changed

+188
-137
lines changed

9 files changed

+188
-137
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,24 @@ jobs:
5959
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
6060
if: ${{ contains(matrix.host_os, 'windows') }}
6161

62-
- name: Install LLVM and Clang (Linux)
62+
- name: Install protoc, LLVM and Clang (Linux)
6363
if: ${{ contains(matrix.host_os, 'ubuntu') }}
6464
run: |
6565
sudo apt-get update -y
66+
sudo apt-get install protobuf-compiler
6667
sudo wget https://apt.llvm.org/llvm.sh
6768
sudo chmod +x llvm.sh
6869
sudo ./llvm.sh 14 all
6970
71+
- name: Install protoc (MacOs)
72+
if: ${{ contains(matrix.host_os, 'macos') }}
73+
run: |
74+
brew install protobuf
75+
76+
- name: Install protoc (Windows)
77+
if: ${{ contains(matrix.host_os, 'windows') }}
78+
uses: arduino/setup-protoc@v1
79+
7080
- name: Install ARM64 Linux build tools
7181
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
7282
run: |
@@ -99,7 +109,7 @@ jobs:
99109
- name: XCode Version
100110
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
101111
run: |
102-
sudo xcode-select -s /Applications/Xcode_12.4.app &&
112+
sudo xcode-select -s /Applications/Xcode_13.4.app &&
103113
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
104114
105115
- name: ARM64 Windows setup

.github/workflows/test.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
- name: Checkout
3939
uses: actions/checkout@v1
4040

41+
- name: Install protobuf-compiler
42+
run: |
43+
sudo apt-get update -y
44+
sudo apt-get install protobuf-compiler
45+
4146
- name: Install Rust
4247
uses: actions-rs/toolchain@v1
4348
with:
@@ -51,33 +56,3 @@ jobs:
5156
command: test
5257
args: --all
5358

54-
- name: Database Tests
55-
uses: actions-rs/cargo@v1
56-
with:
57-
command: test
58-
args: store_tests --all
59-
60-
- name: JMAP Core Tests
61-
uses: actions-rs/cargo@v1
62-
with:
63-
command: test
64-
args: jmap_core_tests -- --ignored
65-
66-
- name: JMAP Mail Tests
67-
uses: actions-rs/cargo@v1
68-
with:
69-
command: test
70-
args: jmap_mail_tests -- --ignored
71-
72-
- name: Stress Tests
73-
uses: actions-rs/cargo@v1
74-
with:
75-
command: test
76-
args: jmap_stress_tests -- --ignored
77-
78-
- name: Cluster Tests
79-
uses: actions-rs/cargo@v1
80-
with:
81-
command: test
82-
args: cluster_tests -- --ignored
83-

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"
4949
serde = { version = "1.0", features = ["derive"] }
5050
serde_json = "1.0"
5151
num_cpus = "1.15.0"
52+
53+
[target.'cfg(unix)'.dependencies]
5254
privdrop = "0.5.3"
5355

5456
[dev-dependencies]

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ RUN apt-get update && \
55
build-essential \
66
cmake \
77
clang \
8-
curl
8+
curl \
9+
protobuf-compiler
910
ENV RUSTUP_HOME=/opt/rust/rustup \
1011
PATH=/home/root/.cargo/bin:/opt/rust/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1112
RUN curl https://sh.rustup.rs -sSf | \
@@ -21,7 +22,6 @@ FROM chef AS planner
2122
COPY Cargo.toml .
2223
COPY Cargo.lock .
2324
COPY src/ src/
24-
COPY components/ components/
2525
COPY resources/ resources/
2626
RUN cargo chef prepare --recipe-path recipe.json
2727

@@ -31,7 +31,6 @@ RUN cargo chef cook --release --recipe-path recipe.json
3131
COPY Cargo.toml .
3232
COPY Cargo.lock .
3333
COPY src/ src/
34-
COPY components/ components/
3534
COPY resources/ resources/
3635
RUN cargo build --release
3736

README.md

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![](https://img.shields.io/twitter/follow/stalwartlabs?style=flat)](https://twitter.com/stalwartlabs)
88

99
**Stalwart SMTP** is a modern SMTP server developed in Rust with a focus on security, speed, and extensive configurability.
10-
It features built-in DMARC, DKIM, SPF and ARC support for message and sender authentication, strong transport security through DANE, MTA-STS, SMTP TLS reporting and offers great flexibility and customization thanks to its configurable rules and native support for Sieve scripts.
10+
It features built-in DMARC, DKIM, SPF and ARC support for message authentication, strong transport security through DANE, MTA-STS and SMTP TLS reporting, and offers great flexibility and customization thanks to its dynamic configuration rules and native support for Sieve scripts.
1111

1212
Key features:
1313

@@ -24,17 +24,14 @@ Key features:
2424
- Inbound Filtering and Throttling:
2525
- Sieve scripting language with support for all [registered extensions](https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml).
2626
- Filtering, modification and removal of MIME parts or headers.
27-
- DNS block lists (**DNSBL**).
28-
- Greylisting.
29-
- Inbound concurrency and rate limiting.
27+
- DNS block lists (**DNSBL**) & Greylisting.
28+
- Inbound concurrency & rate limiting.
3029
- Integration with external content filtering systems such as SpamAssassin and ClamAV.
3130
- Flexible Queues:
32-
- Unlimited virtual queues.
31+
- Unlimited virtual queues with custom routing rules.
3332
- Delayed delivery with `FUTURERELEASE` and `DELIVERBY` extensions support.
3433
- Priority delivery with `MT-PRIORITY` extension support.
35-
- Quotas.
36-
- Outbound throttling.
37-
- Custom routing rules.
34+
- Outbound throttling & Disk quotas.
3835
- Logging and Reporting:
3936
- Detailed logging of SMTP transactions and events, including delivery attempts, errors, and policy violations.
4037
- Integration with **OpenTelemetry** to enable monitoring, tracing, and performance analysis of SMTP server operations.
@@ -60,7 +57,7 @@ You may also [compile Stalwart SMTP from the source](https://stalw.art/smtp/deve
6057

6158
If you are having problems running Stalwart SMTP, you found a bug or just have a question,
6259
do not hesitate to reach us on [Github Discussions](https://github.com/stalwartlabs/smtp-server/discussions),
63-
[Reddit](https://www.reddit.com/r/stalwartlabs) or [Discord](https://discord.gg/jtgtCNj66U).
60+
[Reddit](https://www.reddit.com/r/stalwartlabs) or [Discord](https://discord.gg/9dXkHzCk).
6461
Additionally you may become a sponsor to obtain priority support from Stalwart Labs Ltd.
6562

6663
## Documentation
@@ -72,45 +69,43 @@ Table of Contents
7269
- [Windows](https://stalw.art/smtp/get-started/windows/)
7370
- [Docker](https://stalw.art/smtp/get-started/docker/)
7471
- Configuration
75-
- Overview
76-
- General
77-
- Listeners
78-
- Rules
79-
- Scripting
80-
- Certificates
81-
- Remote
82-
- Databases
83-
- Lists
84-
- Resolver
85-
- Logging
86-
- Inbound
87-
- Overview
88-
- Connect
89-
- Extensions
90-
- Ehlo
91-
- Authentication
92-
- Mail-From
93-
- Data
94-
- Outbound
95-
- Overview
96-
- Schedule
97-
- Queue strategy
98-
- Throttling
99-
- Quotas
100-
- Authentication
101-
- Overview
102-
- Signatures
103-
- DKIM
104-
- SPF
105-
- ARC
106-
- DMARC
107-
- IpRev
108-
- DNSBL
72+
- [Overview](https://stalw.art/smtp/settings/overview)
73+
- [Configuration Rules](https://stalw.art/smtp/settings/rules)
74+
- [General settings](https://stalw.art/smtp/settings/general)
75+
- [Remote hosts](https://stalw.art/smtp/settings/remote)
76+
- [Databases](https://stalw.art/smtp/settings/database)
77+
- [Local Lists](https://stalw.art/smtp/settings/list)
78+
- [Tracing & Logging](https://stalw.art/smtp/settings/tracing)
79+
- Inbound settings
80+
- [Listeners](https://stalw.art/smtp/inbound/listeners)
81+
- [Sessions](https://stalw.art/smtp/inbound/session)
82+
- [EHLO Stage](https://stalw.art/smtp/inbound/ehlo)
83+
- [MAIL Stage](https://stalw.art/smtp/inbound/mail)
84+
- [RCPT Stage](https://stalw.art/smtp/inbound/rcpt)
85+
- [DATA Stage](https://stalw.art/smtp/inbound/data)
86+
- [AUTH Stage](https://stalw.art/smtp/inbound/auth)
87+
- [DNSBLs](https://stalw.art/smtp/inbound/dnsbl)
88+
- [Sieve Scripting](https://stalw.art/smtp/inbound/sieve)
89+
- [Throttling](https://stalw.art/smtp/inbound/throttle)
90+
- Outbound settings
91+
- [Queues](https://stalw.art/smtp/outbound/queue)
92+
- [Transport & Routing](https://stalw.art/smtp/outbound/transport)
93+
- [TLS Security](https://stalw.art/smtp/outbound/tls)
94+
- [Throttling](https://stalw.art/smtp/outbound/throttle)
95+
- [Quotas](https://stalw.art/smtp/outbound/quota)
96+
- [DNS](https://stalw.art/smtp/outbound/dns)
97+
- Email Authentication
98+
- [DKIM](https://stalw.art/smtp/auth/dkim)
99+
- [SPF](https://stalw.art/smtp/auth/spf)
100+
- [ARC](https://stalw.art/smtp/auth/arc)
101+
- [DMARC](https://stalw.art/smtp/auth/dmarc)
102+
- [Reverse IP](https://stalw.art/smtp/auth/iprev)
103+
- [Report Analysis](https://stalw.art/smtp/auth/analysis)
109104
- Management
110-
- Overview
111-
- Configuration
112-
- Queue
113-
- Reports
105+
- [API](https://stalw.art/smtp/management/api)
106+
- [CLI](https://stalw.art/smtp/management/cli)
107+
- [Queue](https://stalw.art/smtp/management/queue)
108+
- [Reports](https://stalw.art/smtp/management/reports)
114109
- Development
115110
- [Compiling](https://stalw.art/smtp/development/compile/)
116111
- [Tests](https://stalw.art/smtp/development/test/)
@@ -127,7 +122,8 @@ The following major features and enhancements are planned for Stalwart SMTP:
127122

128123
## Testing & Fuzzing
129124

130-
To run the test suite execute:
125+
The base tests perform protocol compliance tests as well as basic functionality testing on different functions across the Stalwart SMTP code base.
126+
To run the base test suite execute:
131127

132128
```bash
133129
cargo test
@@ -137,6 +133,12 @@ To run the fuzz tests please refer to the Stalwart libraries that handle parsing
137133
[mail-parser](https://github.com/stalwartlabs/mail-parser),
138134
[mail-auth](https://github.com/stalwartlabs/mail-auth) and [sieve-rs](https://github.com/stalwartlabs/sieve).
139135

136+
## Funding
137+
138+
Part of the development of this project was funded through the [NGI0 Entrust Fund](https://nlnet.nl/entrust), a fund established by [NLnet](https://nlnet.nl/) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
139+
140+
If you find the project useful you can help by [becoming a sponsor](https://github.com/sponsors/stalwartlabs). Thank you!
141+
140142
## License
141143

142144
Licensed under the terms of the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) as published by

resources/config/config.toml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ data = "10m"
230230
mta-sts = "2m"
231231

232232
[[queue.quota]]
233-
#match = {if = "remote-ip", eq = "10.0.0.1"}
233+
#match = {if = "sender-domain", eq = "foobar.org"}
234234
#key = ["rcpt"]
235235
messages = 100000
236236
size = 10737418240 # 10gb
@@ -402,14 +402,64 @@ nested-includes = 5
402402
duplicate-expiry = "7d"
403403

404404
[sieve.scripts]
405-
#ehlo = ""
405+
# Note: These scripts are included here for demonstration purposes.
406+
# They should not be used in their current form.
407+
connect = '''
408+
require ["variables", "extlists", "reject"];
409+
410+
if string :list "${env.remote_ip}" "list/blocked-ips" {
411+
reject "Your IP '${env.remote_ip}' is not welcomed here.";
412+
}
413+
'''
414+
ehlo = '''
415+
require ["variables", "extlists", "reject"];
416+
417+
if string :list "${env.helo_domain}" "list/blocked-domains" {
418+
reject "551 5.1.1 Your domain '${env.helo_domain}' has been blacklisted.";
419+
}
420+
'''
421+
mail = '''
422+
require ["variables", "envelope", "reject"];
423+
424+
if envelope :localpart :is "from" "known_spammer" {
425+
reject "We do not accept SPAM.";
426+
}
427+
'''
428+
rcpt = '''
429+
require ["variables", "vnd.stalwart.execute", "envelope", "reject"];
430+
431+
set "triplet" "${env.remote_ip}.${envelope.from}.${envelope.to}";
432+
433+
if not execute :query "SELECT EXISTS(SELECT 1 FROM greylist WHERE addr=? LIMIT 1)" ["${triplet}"] {
434+
execute :query "INSERT INTO greylist (addr) VALUES (?)" ["${triplet}"];
435+
reject "422 4.2.2 Greylisted, please try again in a few moments.";
436+
}
437+
'''
438+
data = '''
439+
require ["envelope", "variables", "replace", "mime", "foreverypart", "editheader", "extracttext"];
440+
441+
if envelope :domain :is "to" "foobar.net" {
442+
set "counter" "a";
443+
foreverypart {
444+
if header :mime :contenttype "content-type" "text/html" {
445+
extracttext :upper "text_content";
446+
replace "${text_content}";
447+
}
448+
set :length "part_num" "${counter}";
449+
addheader :last "X-Part-Number" "${part_num}";
450+
set "counter" "${counter}a";
451+
}
452+
}
453+
'''
406454

407455
[management.lookup]
408456
auth = ["list/admin"]
409457

410458
[list]
411459
domains = ["__DOMAIN__"]
412460
admin = ["admin:__ADMIN_PASS__"]
461+
#blocked-ips = ["10.0.0.1"]
462+
#blocked-domains = ["mail.spammer.com"]
413463
#users = "file:///usr/local/stalwart-smtp/etc/users.txt"
414464

415465
[certificate."default"]

0 commit comments

Comments
 (0)