chore: Improve email anti-spam compliance and update server docs

- Add proper email headers: X-Mailer, X-Priority, Precedence, List-Unsubscribe
- Improve HTML template with XHTML doctype for better compatibility
- Add compliance footer with unsubscribe link and address
- Remove accented characters from email template (spam trigger)
- Update CREDENCIAIS_SERVIDOR.md with:
  - Current service versions (PHP 8.4.15, Nginx 1.29.4, etc)
  - DNS anti-spam status (SPF , DMARC , DKIM ⚠️ pending)
  - DKIM key for DNS publication
  - Cron job documentation
  - New API endpoints (/preferences)
This commit is contained in:
marcoitaloesp-ai 2025-12-17 10:04:44 +00:00 committed by GitHub
parent 19dcdce262
commit 135dc56eb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 174 additions and 77 deletions

View File

@ -2,7 +2,7 @@
> **⚠️ DOCUMENTO CONFIDENCIAL - NÃO COMPARTILHAR** > **⚠️ DOCUMENTO CONFIDENCIAL - NÃO COMPARTILHAR**
> >
> Última atualização: 07 de Dezembro de 2025 > Última atualização: 17 de Dezembro de 2025
--- ---
@ -10,14 +10,14 @@
| Campo | Valor | | Campo | Valor |
|-------|-------| |-------|-------|
| **Host** | `213.165.93.60` | | **Host** | \`213.165.93.60\` |
| **Usuário** | `root` | | **Usuário** | \`root\` |
| **Senha** | `Master9354` | | **Senha** | \`Master9354\` |
| **Porta** | `22` | | **Porta** | \`22\` |
```bash \`\`\`bash
ssh root@213.165.93.60 sshpass -p 'Master9354' ssh -o StrictHostKeyChecking=no root@213.165.93.60
``` \`\`\`
--- ---
@ -35,15 +35,15 @@ ssh root@213.165.93.60
| URL | Descrição | Usuário | Senha | | URL | Descrição | Usuário | Senha |
|-----|-----------|---------|-------| |-----|-----------|---------|-------|
| https://phpmyadmin.cnxifly.com | phpMyAdmin (Banco de Dados) | `root` | `M@ster9354` | | https://phpmyadmin.cnxifly.com | phpMyAdmin (Banco de Dados) | \`root\` | \`M@ster9354\` |
| https://mail.cnxifly.com | PostfixAdmin (Admin Email) | `admin@cnxifly.com` | `M@ster9354` | | https://mail.cnxifly.com | PostfixAdmin (Admin Email) | \`admin@cnxifly.com\` | \`M@ster9354\` |
| https://webmail.cnxifly.com | Roundcube (Webmail) | `marco@cnxifly.com` | `M@ster9354` | | https://webmail.cnxifly.com | Roundcube (Webmail) | \`marco@cnxifly.com\` | \`M@ster9354\` |
### WEBMoney App (Login Sistema) ### WEBMoney App (Login Sistema)
| URL | Usuário | Senha | Descrição | | URL | Usuário | Senha | Descrição |
|-----|---------|-------|-----------| |-----|---------|-------|-----------|
| https://webmoney.cnxifly.com | `marco@cnxifly.com` | `M@ster9354` | Administrador | | https://webmoney.cnxifly.com | \`marco@cnxifly.com\` | \`M@ster9354\` | Administrador |
--- ---
@ -53,49 +53,59 @@ ssh root@213.165.93.60
| Campo | Valor | | Campo | Valor |
|-------|-------| |-------|-------|
| **Host** | `localhost` ou `127.0.0.1` | | **Host** | \`localhost\` ou \`127.0.0.1\` |
| **Porta** | `3306` | | **Porta** | \`3306\` |
| **Usuário** | `root` | | **Usuário** | \`root\` |
| **Senha** | `M@ster9354` | | **Senha** | \`M@ster9354\` |
```bash \`\`\`bash
mysql -u root -p'M@ster9354' mysql -u root -p'M@ster9354'
``` # ou via SSH:
sshpass -p 'Master9354' ssh root@213.165.93.60 "mysql -u webmoney -p'M@ster9354' webmoney -e 'QUERY'"
\`\`\`
### Databases e Usuários ### Databases e Usuários
| Database | Usuário | Senha | Descrição | | Database | Usuário | Senha | Descrição |
|----------|---------|-------|-----------| |----------|---------|-------|-----------|
| `webmoney` | `webmoney` | `M@ster9354` | Aplicação principal | | \`webmoney\` | \`webmoney\` | \`M@ster9354\` | Aplicação principal |
| `postfixadmin` | `postfixadmin` | `M@ster9354` | Gerenciamento de emails | | \`postfixadmin\` | \`postfixadmin\` | \`M@ster9354\` | Gerenciamento de emails |
| `roundcube` | `roundcube` | `M@ster9354` | Webmail | | \`roundcube\` | \`roundcube\` | \`M@ster9354\` | Webmail |
| `phpmyadmin` | `phpmyadmin` | `M@ster9354` | Controle phpMyAdmin | | \`phpmyadmin\` | \`phpmyadmin\` | \`M@ster9354\` | Controle phpMyAdmin |
--- ---
## 📧 SERVIDOR DE EMAIL ## 📧 SERVIDOR DE EMAIL
### Versões dos Serviços de Email
| Serviço | Versão |
|---------|--------|
| Postfix | 3.8.6 |
| Dovecot | 2.3.21 |
| OpenDKIM | 2.11.0 |
### Configuração SMTP/IMAP ### Configuração SMTP/IMAP
| Campo | Valor | | Campo | Valor |
|-------|-------| |-------|-------|
| **Servidor** | `mail.cnxifly.com` | | **Servidor** | \`mail.cnxifly.com\` |
| **SMTP Porta** | `587` (STARTTLS) | | **SMTP Porta** | \`587\` (STARTTLS) |
| **SMTPS Porta** | `465` (SSL/TLS) | | **SMTPS Porta** | \`465\` (SSL/TLS) |
| **IMAP Porta** | `993` (SSL/TLS) | | **IMAP Porta** | \`993\` (SSL/TLS) |
| **Autenticação** | Necessária | | **Autenticação** | Necessária |
### Contas de Email ### Contas de Email
| Email | Senha | Descrição | | Email | Senha | Descrição |
|-------|-------|-----------| |-------|-------|-----------|
| `admin@cnxifly.com` | `M@ster9354` | Administrador PostfixAdmin | | \`admin@cnxifly.com\` | \`M@ster9354\` | Administrador PostfixAdmin |
| `marco@cnxifly.com` | `M@ster9354` | Email pessoal Marco | | \`marco@cnxifly.com\` | \`M@ster9354\` | Email pessoal Marco |
| `no-reply@cnxifly.com` | `M@ster9354` | Notificações do sistema | | \`no-reply@cnxifly.com\` | \`M@ster9354\` | Notificações do sistema |
### Configuração Cliente de Email ### Configuração Cliente de Email
``` \`\`\`
Servidor de entrada (IMAP): Servidor de entrada (IMAP):
Host: mail.cnxifly.com Host: mail.cnxifly.com
Porta: 993 Porta: 993
@ -105,33 +115,75 @@ Servidor de saída (SMTP):
Host: mail.cnxifly.com Host: mail.cnxifly.com
Porta: 587 Porta: 587
Segurança: STARTTLS Segurança: STARTTLS
``` \`\`\`
---
## 🛡️ CONFIGURAÇÕES ANTI-SPAM (DNS)
### Registros DNS para Entrega de Email
| Tipo | Nome | Valor | Status |
|------|------|-------|--------|
| **SPF** | \`cnxifly.com\` | \`v=spf1 mx a ip4:213.165.93.60 -all\` | ✅ OK |
| **DMARC** | \`_dmarc.cnxifly.com\` | \`v=DMARC1; p=quarantine; ...\` | ✅ OK |
| **DKIM** | \`mail._domainkey.cnxifly.com\` | (chave RSA 2048-bit) | ⚠️ **PENDENTE** |
| **PTR/rDNS** | \`213.165.93.60\` | \`mail.cnxifly.com\` | ✅ OK |
### ⚠️ AÇÃO NECESSÁRIA: Adicionar DKIM no DNS
A chave DKIM existe no servidor mas **NÃO está publicada no DNS**. Adicionar o seguinte registro TXT:
\`\`\`
Nome: mail._domainkey.cnxifly.com
Tipo: TXT
Valor: v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1A8I6ZHyZ0PYdOjB2BSQbH8q6WOJ2dO2zHiIn/bolAGl5ITo5hfn3Zv2fpHBMzcWbDITugSQFuQ3XJeF6oBNdWVvBqnEvI8pCJWzzhZ8Oj9rU+mEPOhIcmmDU6kHCTOFWFxgxbLd2es34rmts06xpF7nI4mWuJq8VVtkrqT0UkZNjjZrNO9KXfdTzV3pP0IEZA+KJlYqVDwnALL62z6GT9xAQi2eytoRSXbTzGDC4+kNXE3v2zMB5+CY9CbH3LZ7SFoJUQJCTf43zc4ea+nWsE/Y2DR5ky2hSwOh7FRJ2nXV07N2VlLu9LekZl08q9G49mwEY6ORT0aShL7RYsNTKQIDAQAB
\`\`\`
### Verificação Anti-Spam
\`\`\`bash
# Testar SPF
dig +short TXT cnxifly.com | grep spf
# Testar DMARC
dig +short TXT _dmarc.cnxifly.com
# Testar DKIM (após adicionar no DNS)
dig +short TXT mail._domainkey.cnxifly.com
# Testar rDNS
dig +short -x 213.165.93.60
# Verificar assinatura DKIM
opendkim-testkey -d cnxifly.com -s mail -vvv
\`\`\`
--- ---
## 🔧 API ENDPOINTS ## 🔧 API ENDPOINTS
### Base URL ### Base URL
``` \`\`\`
https://webmoney.cnxifly.com/api https://webmoney.cnxifly.com/api
``` \`\`\`
### Endpoints Disponíveis ### Endpoints Disponíveis
| Método | Endpoint | Descrição | | Método | Endpoint | Descrição |
|--------|----------|-----------| |--------|----------|-----------|
| `POST` | `/api/login` | Autenticação | | \`POST\` | \`/api/login\` | Autenticação |
| `POST` | `/api/register` | Registro de usuário | | \`POST\` | \`/api/register\` | Registro de usuário |
| `POST` | `/api/logout` | Logout | | \`POST\` | \`/api/logout\` | Logout |
| `GET` | `/api/me` | Dados do usuário autenticado | | \`GET\` | \`/api/me\` | Dados do usuário autenticado |
| `GET` | `/api/user` | Informações do usuário | | \`GET\` | \`/api/preferences\` | Preferências do usuário |
| `GET` | `/api/email/anti-spam-info` | Informações anti-spam | | \`PUT\` | \`/api/preferences\` | Atualizar preferências |
| `POST` | `/api/email/send-test` | Enviar email de teste | | \`POST\` | \`/api/preferences/test-notification\` | Testar notificação |
### Health Check ### Health Check
``` \`\`\`
GET https://cnxifly.com/up GET https://cnxifly.com/up
``` \`\`\`
--- ---
@ -140,42 +192,67 @@ GET https://cnxifly.com/up
| Campo | Valor | | Campo | Valor |
|-------|-------| |-------|-------|
| **Emissor** | Let's Encrypt | | **Emissor** | Let's Encrypt |
| **Início** | 07 de Dezembro de 2025 |
| **Válido até** | 07 de Março de 2026 | | **Válido até** | 07 de Março de 2026 |
| **Domínios cobertos** | cnxifly.com, www, mail, webmail, phpmyadmin, webmoney | | **Domínios cobertos** | cnxifly.com, www, mail, webmail, phpmyadmin, webmoney |
| **Renovação** | Automática via Certbot |
--- ---
## 📁 ESTRUTURA DE DIRETÓRIOS ## 📁 ESTRUTURA DE DIRETÓRIOS
``` \`\`\`
/var/www/webmoney/ /var/www/webmoney/
├── backend/ # Laravel API ├── backend/ # Laravel API (PHP 8.4)
├── frontend/ # Vue/React App │ └── storage/logs/ # Logs do Laravel
└── public/ # Arquivos públicos └── frontend/
└── dist/ # React build (Nginx root)
/var/www/postfixadmin/ # PostfixAdmin /var/www/postfixadmin/ # PostfixAdmin
/var/www/roundcube/ # Roundcube Webmail /var/www/roundcube/ # Roundcube Webmail
/var/www/phpmyadmin/ # phpMyAdmin /var/www/phpmyadmin/ # phpMyAdmin
``` \`\`\`
--- ---
## 🔄 SERVIÇOS DO SISTEMA ## 🔄 SERVIÇOS DO SISTEMA
| Serviço | Comando de Status | ### Versões
|---------|-------------------|
| Nginx | `systemctl status nginx` | | Serviço | Versão |
| PHP-FPM | `systemctl status php8.4-fpm` | |---------|--------|
| MariaDB | `systemctl status mariadb` | | Nginx | 1.29.4 |
| Redis | `systemctl status redis-server` | | PHP-FPM | 8.4.15 |
| Postfix | `systemctl status postfix` | | MariaDB | 11.4.9 |
| Dovecot | `systemctl status dovecot` | | Redis | 7.0.15 |
| OpenDKIM | `systemctl status opendkim` | | Postfix | 3.8.6 |
| Dovecot | 2.3.21 |
| OpenDKIM | 2.11.0 |
### Comandos de Status
| Serviço | Comando |
|---------|---------|
| Nginx | \`systemctl status nginx\` |
| PHP-FPM | \`systemctl status php8.4-fpm\` |
| MariaDB | \`systemctl status mariadb\` |
| Redis | \`systemctl status redis-server\` |
| Postfix | \`systemctl status postfix\` |
| Dovecot | \`systemctl status dovecot\` |
| OpenDKIM | \`systemctl status opendkim\` |
### Reiniciar Todos os Serviços ### Reiniciar Todos os Serviços
```bash \`\`\`bash
systemctl restart nginx php8.4-fpm mariadb redis-server postfix dovecot opendkim systemctl restart nginx php8.4-fpm mariadb redis-server postfix dovecot opendkim
``` \`\`\`
---
## ⏰ CRON JOBS
| Cron | Comando | Descrição |
|------|---------|-----------|
| \`* * * * *\` | \`cd /var/www/webmoney/backend && php artisan schedule:run\` | Laravel Scheduler |
--- ---
@ -184,21 +261,24 @@ systemctl restart nginx php8.4-fpm mariadb redis-server postfix dovecot opendkim
1. **Backup**: Realizar backup regular do banco de dados e arquivos 1. **Backup**: Realizar backup regular do banco de dados e arquivos
2. **SSL**: Certificado renova automaticamente via Certbot 2. **SSL**: Certificado renova automaticamente via Certbot
3. **Firewall**: UFW ativo com portas 22, 25, 80, 143, 443, 465, 587, 993 3. **Firewall**: UFW ativo com portas 22, 25, 80, 143, 443, 465, 587, 993
4. **Logs**: 4. **DKIM**: ⚠️ Chave existe no servidor mas falta registro DNS
- Nginx: `/var/log/nginx/` 5. **Logs**:
- PHP: `/var/log/php8.4-fpm.log` - Nginx: \`/var/log/nginx/\`
- Mail: `/var/log/mail.log` - PHP: \`/var/log/php8.4-fpm.log\`
- Laravel: `/var/www/webmoney/backend/storage/logs/` - Mail: \`/var/log/mail.log\`
- Laravel: \`/var/www/webmoney/backend/storage/logs/\`
--- ---
## 🆘 SUPORTE ## 🆘 SUPORTE
Em caso de problemas, verificar: Em caso de problemas, verificar:
1. Status dos serviços: `systemctl status [serviço]` 1. Status dos serviços: \`systemctl status [serviço]\`
2. Logs de erro: `tail -f /var/log/nginx/error.log` 2. Logs de erro: \`tail -f /var/log/nginx/error.log\`
3. Conectividade: `curl -I https://cnxifly.com` 3. Logs Laravel: \`tail -f /var/www/webmoney/backend/storage/logs/laravel.log\`
4. Logs de email: \`tail -f /var/log/mail.log\`
5. Conectividade: \`curl -I https://cnxifly.com\`
--- ---
> **Gerado automaticamente em 07/12/2025** > **Gerado automaticamente em 17/12/2025**

View File

@ -109,7 +109,11 @@ public function headers(): Headers
{ {
return new Headers( return new Headers(
text: [ text: [
'List-Unsubscribe' => '<mailto:support@cnxifly.com?subject=unsubscribe>', 'X-Mailer' => 'WEBMoney/1.44.5',
'X-Priority' => '3',
'X-Auto-Response-Suppress' => 'OOF, AutoReply',
'Precedence' => 'bulk',
'List-Unsubscribe' => '<https://webmoney.cnxifly.com/preferences>, <mailto:no-reply@cnxifly.com?subject=unsubscribe>',
'List-Unsubscribe-Post' => 'List-Unsubscribe=One-Click', 'List-Unsubscribe-Post' => 'List-Unsubscribe=One-Click',
], ],
); );

View File

@ -1,10 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt-BR"> <html xmlns="http://www.w3.org/1999/xhtml" lang="pt-BR">
<head> <head>
<meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alerta de Pagamentos</title> <meta name="x-apple-disable-message-reformatting" />
<style> <meta name="format-detection" content="telephone=no, date=no, address=no, email=no" />
<title>WEBMoney - Alerta de Pagamentos</title>
<!--[if mso]>
<style type="text/css">
body, table, td {font-family: Arial, Helvetica, sans-serif !important;}
</style>
<![endif]-->
<style type="text/css">
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6; line-height: 1.6;
@ -366,9 +373,15 @@
</div> </div>
<div class="footer"> <div class="footer">
<p>Este email foi enviado automaticamente pelo sistema WEBMoney.</p> <p>Este email foi enviado automaticamente pelo sistema WEBMoney para {{ $userName }}.</p>
<p>Para desativar estas notificações, acesse <a href="https://webmoney.cnxifly.com/preferences">Preferências</a>.</p> <p>Voce recebe esta mensagem porque ativou as notificacoes de pagamentos.</p>
<p style="margin-top: 15px;">© {{ date('Y') }} WEBMoney - ConneXiFly</p> <p>Para desativar estas notificacoes, acesse <a href="https://webmoney.cnxifly.com/preferences" style="color: #3b82f6;">Preferencias</a>.</p>
<p style="margin-top: 15px; font-size: 11px; color: #94a3b8;">
WEBMoney - ConneXiFly<br />
Servico de gestao financeira pessoal<br />
Madrid, Espanha
</p>
<p style="font-size: 11px; color: #94a3b8;">&copy; {{ date('Y') }} WEBMoney - Todos os direitos reservados</p>
</div> </div>
</div> </div>
</body> </body>