Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnori-zon/mailsenderbot
telegram bot for mailings
https://github.com/gnori-zon/mailsenderbot
docker docker-compose gradle java mail microservices modules postgresql-database rabbitmq send-mail sender springboot telegram-bot
Last synced: 4 days ago
JSON representation
telegram bot for mailings
- Host: GitHub
- URL: https://github.com/gnori-zon/mailsenderbot
- Owner: gnori-zon
- License: mit
- Created: 2023-01-16T18:05:54.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-24T09:40:53.000Z (9 months ago)
- Last Synced: 2024-02-24T10:26:56.094Z (9 months ago)
- Topics: docker, docker-compose, gradle, java, mail, microservices, modules, postgresql-database, rabbitmq, send-mail, sender, springboot, telegram-bot
- Language: Java
- Homepage:
- Size: 90 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MailSenderBot
telegram bot for mailings (spammer)
## About
telegram bot for creating newsletters and their subsequent sending using the user's mail or using the bot's mail. The bot has integration with a database that stores account data (mail and key, encrypted). The database also stores the mailing history of each user. The sample letter contains (header, body text, attachment, recipients and the number of pieces for each recipient).
## Documentation
If you will not use docker, then you need to have a working **RabbitMQ** server with the necessary **queue** and **exchange**. As well as the **postgreSQL** database.
Use gradlew to build. You need to configure 2 yaml files in module **[client-telegram]** and **[send-mail-worker]**. Then use for build two service:```
./gradlew :send-mail-worker:build
```And
```
./gradlew :client-telegram:build
```Subject area
Communication between services
Model content
Document and PhotoSize date types from telegram library
```java
public record Message(
long accountId,
SendMode sendMode,
String title,
String text,
FileData fileData,
List recipients,
int countForRecipient,
LocalDate sentDate
) implements Serializable {}enum SendMode {
ANONYMOUSLY,
CURRENT_MAIL;
}
record FileData(
String id,
String name,
FileType type
) {}
enum FileType {
PHOTO,
DOCUMENT;
}
```Config for client-telegram
```yaml
server:
port: 8080
#telegram
bot:
name:
token:
service:
# (addresses to the tg-api file system)
file-info:
uri: https://api.telegram.org/bot{token}/getFile?file_id={fileId}
file-storage:
uri: https://api.telegram.org/file/bot{token}/{filePath}# database
spring:
datasource:
# (address of database)
url: jdbc:postgresql://localhost:5432/
username:
password:
jpa:
# (schema generation for database)
generate-ddl: true
show-sql: true
hibernate:
# (ddl mode)
ddl-auto: create-drop# rabbitMQ
rabbitmq:
# used default host and port
username: guest
password: guest
# (specifying the name of the queue to be created)
queue-name: send.mail
# (specifying the name of the exchange to be created)
exchange-name: exchange
#for Crypto !keys specified in .yaml(client) and .yaml(worker) must will be equals
cipher:
# (fist 128-bit key)
initVector: F-JaNdRgUjXn2r5u
# (second 128-bit key)
key: hVmYp3s6v9y$B&E)
```Config for send-mail-worker
```yaml
server:
port: 8081
bot:
name:
token:
service:
# (addresses to the tg-api file system)
file-info:
uri: https://api.telegram.org/bot{token}/getFile?file_id={fileId}
file-storage:
uri: https://api.telegram.org/file/bot{token}/{filePath}
# database
spring:
datasource:
# (address of database)
url: jdbc:postgresql://localhost:5432/
username:
password:
jpa:
# (schema generation for database)
generate-ddl: false
show-sql: true
# rabbitMQ
rabbitmq:
addresses: localhost:5672
username: guest
password: guest
# (specifying the name of the queue to be listening)
queue-name: send.mail
# for send-worker
base:
# (specifying mails and keys(keys for app) to them through ' , ' which will be used by the bot for anonymous mailing (ONLY GMAIL))
mails:
keys:
#for Crypto !keys specified in .yaml(client) and .yaml(worker) must will be equals
cipher:
# (fist 128-bit key)
initVector: F-JaNdRgUjXn2r5u
# (second 128-bit key)
key: hVmYp3s6v9y$B&E)
```
## Developers
- [gnori-zon](https://github.com/gnori-zon)