https://github.com/alphabox/spamc
A solid client in Java to communicate with SpamAssassin.
https://github.com/alphabox/spamc
java spam spam-filtering spamassassin spamc
Last synced: 6 months ago
JSON representation
A solid client in Java to communicate with SpamAssassin.
- Host: GitHub
- URL: https://github.com/alphabox/spamc
- Owner: alphabox
- License: apache-2.0
- Created: 2017-08-01T21:01:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T22:17:15.000Z (over 2 years ago)
- Last Synced: 2025-07-14T07:11:11.633Z (about 1 year ago)
- Topics: java, spam, spam-filtering, spamassassin, spamc
- Language: Java
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spamc
## Introduction
spamc is a simple, solid library in Java to communicate with Apache SpamAssassin.
You can send different messages (tipically email) for SpamAssassin to check it is a spam or not.
## Maven dependency
```xml
hu.alphabox
spamc
0.1.2
```
## Building
To make the latest SNAPSHOT jar file, you will need the Apache Maven installed.
Run the following command:
```
mvn clean package
```
## Usage
A simple usage example to send GTUBE message with all available command.
```java
public static void main(String[] args) {
SARequest request = new SARequest();
//GTUBE message string
request.setMessage("XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X");
request.useCompression(false);
SAClient client = new SAClient(InetAddress.getByName("localhost"), 783);
for (SACommand command : SACommand.values()) {
LOGGER.info("Send command: " + command.name());
if (command == SACommand.TELL) {
request.addHeader("Message-class", "spam");
request.addHeader("Set", "local,remote");
}
request.setCommand(command);
client.sendRequest(request);
}
}
```
## License
This project licensed under Apache 2.0 License - see the [LICENSE](LICENSE) file for details