Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 10/02/2008, à 10:06

elekaj34

[résolu] Sécuriser Postfix

Bonjour,

Voila sur un serveur dédié, j'ai une install POSTFIX, et je voudrais après analyse des logs empecher certains agissements.

Le LOG, et les commentaire associés

Feb 10 08:13:52 ks353656 postfix/smtpd[21681]: connect from 201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:04 ks353656 postfix/cleanup[21699]: 5D56810400BB: message-id=<20080210071404.5D56810400BB@ks353656.kimsufi.com>
Feb 10 08:14:04 ks353656 postfix/qmgr[23991]: 5D56810400BB: from=<postmaster@ks353656.kimsufi.com>, size=280, nrcpt=1 (queue active)

J'en conclu que l'ip en question tente de se faire passer pour le postmaster ...

Feb 10 08:14:05 ks353656 postfix/smtp[21700]: 5D56810400BB: to=<multitudinousxy5@psych-ai.com>, relay=mail-fwd.mx.g19.rapidsite.net[199.239.254.18]:25, delay=0.96, delays=0.01/0.01/0.57/0.37, dsn=2.0.0, status=deliverable (250 multitudinousxy5@psych-ai.com ok (normal))

... puis demande à  envoyer un message à  multitudinousxy5@psych-ai.com. Comment est ce faisable (cf config plus bas)

Feb 10 08:14:05 ks353656 postfix/qmgr[23991]: 5D56810400BB: removed
Feb 10 08:14:07 ks353656 postfix/smtpd[21681]: 5A9C810400BB: client=201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:10 ks353656 postfix/cleanup[21699]: 5A9C810400BB: message-id=<01c86ba3$d5bf8980$3ca8d4c9@multitudinousxy5>
Feb 10 08:14:10 ks353656 postfix/qmgr[23991]: 5A9C810400BB: from=<multitudinousxy5@psych-ai.com>, size=857, nrcpt=1 (queue active)
Feb 10 08:14:10 ks353656 postfix/virtual[21701]: 5A9C810400BB: to=<xxxx@xxxx.net>, relay=virtual, delay=12, delays=12/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Feb 10 08:14:10 ks353656 postfix/qmgr[23991]: 5A9C810400BB: removed
Feb 10 08:14:14 ks353656 postfix/smtpd[21681]: disconnect from 201-212-168-60.net.prima.net.ar[201.212.168.60]

Dans cette partie, on inverse les roles, le to de tout à  l'heure devient le from ... et hop un spam de plus pour notre ami xxxx@xxxx.net sad

Configuration de postfix (partie liée aux restrictions smtp)

mydestination = ks353656, localhost, localhost.localdomain
mydomain = xxxx.net
myhostname = ks353656.kimsufi.com
mynetworks = 127.0.0.1
inet_interfaces = all
smtpd_sender_restrictions = permit_mynetworks,
        reject_unknown_sender_domain,
        warn_if_reject reject_unverified_sender
smtpd_recipient_restrictions =
   permit_mynetworks,
   reject_non_fqdn_hostname,
   reject_non_fqdn_sender,
   reject_non_fqdn_recipient,
   reject_unauth_destination,
   reject_invalid_hostname
smtpd_client_restrictions =
        reject_unknown_client,
        permit_mynetworks

Comment puis je bloquer ce genre de transactions ?


Note : Le SMTP en question ne sert que pour recevoir les courriers à  destination des domaines qu'il gère (domaines listés dans une table MySQL) et ne sert pas à  l'envoi de courriers (sauf via la fonction php mail() de certains scripts et la commande mail bash pour l'envoi d'etat journaliers)

Note : J'ai testé via plusieurs sites mon SMTP, et il n'est pas considérés comme ouvert.
Cordialement,

Dernière modification par elekaj34 (Le 12/02/2008, à 09:03)


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne

#2 Le 10/02/2008, à 11:16

toniotonio

Re : [résolu] Sécuriser Postfix

fais voir un plus grande partie des logs, pas seulement quelques lignes

de meme fais voir la conf complete: postconf -n


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#3 Le 10/02/2008, à 11:34

B@rtounet

Re : [résolu] Sécuriser Postfix

c'est clair que c'est bizzare ton truc
rien qu'en regardant mynetwork et mydestination, il ne devrait pas pouvoir etre relay

Hors ligne

#4 Le 10/02/2008, à 11:36

CeReAl KiLLeR Du 77

Re : [résolu] Sécuriser Postfix

Je mettrais du sasl pour avoir une authentification.


SuperBox = Serveur (FreeBSD 7.2) (DEAD) | H²O = Serveur (FreeBSD 8.1) | Nephrotique = Desktop (Ubuntu Lucid Lynx 64 bits) | Skizophrene = Laptop (DesktopBSD 1.7/WinXP SP3) | Epileptik = Desktop (Diskless) | WRT54GL 1.1 (Openwrt Backfire 10.3 noyau 2.4) | WRT54GL 1.1 (DDWRT V24 SP1)

Hors ligne

#5 Le 10/02/2008, à 19:55

elekaj34

Re : [résolu] Sécuriser Postfix

Pour les LOGS, j'ai mis uniquement ceux qui se rapporte à  la transaction. Juste avant c'est environ 1/4 plus tà´t, et après environ 5 minutes.
Voilà  les LOGS (même exemple que ce matin, je peux en mettre d'autres si cela fit avancer le scmilblik)

Avant on remarque les LOGS de imap (normal, je relève mes mails de temps à  autres) smile
Après, on remarque le LOGS des statistiques Anvil (normal aussi)
Ensuite, une nouvelle connexion au SMTP ...

Feb 10 08:00:35 ks353656 imapd: Connection, ip=[::ffff:82.224.134.170]
Feb 10 08:00:35 ks353656 imapd: Connection, ip=[::ffff:82.224.134.170]
Feb 10 08:00:36 ks353656 imapd: LOGIN, user=xxxx@xxxx.net, ip=[::ffff:82.224.134.170], protocol=IMAP
Feb 10 08:00:36 ks353656 imapd: LOGIN, user=yyyy@xxxx.net, ip=[::ffff:82.224.134.170], protocol=IMAP
Feb 10 08:13:52 ks353656 postfix/smtpd[21681]: connect from 201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:04 ks353656 postfix/cleanup[21699]: 5D56810400BB: message-id=<20080210071404.5D56810400BB@ks353656.kimsufi.com>
Feb 10 08:14:04 ks353656 postfix/qmgr[23991]: 5D56810400BB: from=<postmaster@ks353656.kimsufi.com>, size=280, nrcpt=1 (queue active)
Feb 10 08:14:05 ks353656 postfix/smtp[21700]: 5D56810400BB: to=<multitudinousxy5@psych-ai.com>, relay=mail-fwd.mx.g19.rapidsite.net[199.239.254.18]:25, delay=0.96, delays=0.01/0.01/0.57/0.37, dsn=2.0.0, status=deliverable (250 multitudinousxy5@psych-ai.com ok (normal))
Feb 10 08:14:05 ks353656 postfix/qmgr[23991]: 5D56810400BB: removed
Feb 10 08:14:07 ks353656 postfix/smtpd[21681]: 5A9C810400BB: client=201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:10 ks353656 postfix/cleanup[21699]: 5A9C810400BB: message-id=<01c86ba3$d5bf8980$3ca8d4c9@multitudinousxy5>
Feb 10 08:14:10 ks353656 postfix/qmgr[23991]: 5A9C810400BB: from=<multitudinousxy5@psych-ai.com>, size=857, nrcpt=1 (queue active)
Feb 10 08:14:10 ks353656 postfix/virtual[21701]: 5A9C810400BB: to=<xxxx@xxxx.net>, relay=virtual, delay=12, delays=12/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Feb 10 08:14:10 ks353656 postfix/qmgr[23991]: 5A9C810400BB: removed
Feb 10 08:14:14 ks353656 postfix/smtpd[21681]: disconnect from 201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:17:34 ks353656 postfix/anvil[21683]: statistics: max connection rate 1/60s for (smtp:201.212.168.60) at Feb 10 08:13:52
Feb 10 08:17:34 ks353656 postfix/anvil[21683]: statistics: max connection count 1 for (smtp:201.212.168.60) at Feb 10 08:13:52
Feb 10 08:17:34 ks353656 postfix/anvil[21683]: statistics: max cache size 1 at Feb 10 08:13:52
Feb 10 08:34:48 ks353656 postfix/smtpd[22543]: connect from 12-208-218-28.client.mchsi.com[12.208.218.28]

Résultat du postconf -n

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
disable_vrfy_command = yes
inet_interfaces = all
mydestination = ks353656, localhost, localhost.localdomain
mydomain = xxxx.net
myhostname = ks353656.kimsufi.com
mynetworks = 127.0.0.1
smtpd_client_restrictions = reject_unknown_client,        permit_mynetworks
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks,   reject_non_fqdn_hostname,   reject_non_fqdn_sender,   reject_non_fqdn_recipient,   reject_unauth_destination,   reject_invalid_hostname
smtpd_sender_restrictions = permit_mynetworks
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf, mysql:/etc/postfix/mysql-virtual_aliases_mailboxes.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000

Pour le SASL, je m'y penche, mais pour l'instant, cela ne fonctionne pas (enfin pas gênant pour moi). Mais j'y pense, si j'impose SASL, la fonction mail de php devra effectuer une authentification SASL ou pas ?
De même, chaque soir j'ai mon script des taches quotidiennes qui m'envoit un rapport via la commande sendmail. Faudra une authentification ?

Merci de votre aide

Elekaj

Dernière modification par elekaj34 (Le 10/02/2008, à 19:56)


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne

#6 Le 10/02/2008, à 20:23

toniotonio

Re : [résolu] Sécuriser Postfix

y a quoi dans le message recu de multitudinousxy5@psych-ai.com  à  8h14m10s ?

au passage dans ton main.cf enleve les lignes:

smtpd_client_restrictions = reject_unknown_client,        permit_mynetworks
smtpd_sender_restrictions = permit_mynetworks

ce sera deja plus propre comme config



ensuite fais voir ton master.cf


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#7 Le 10/02/2008, à 20:23

Uggy

Re : [résolu] Sécuriser Postfix

Il manque toujours des lignes..
Grep sur "5D56810400BB"

Hors ligne

#8 Le 10/02/2008, à 20:36

elekaj34

Re : [résolu] Sécuriser Postfix

Uggy a écrit :

Il manque toujours des lignes..
Grep sur "5D56810400BB"

Voilà  :

ks353656:~# cat /var/log/mail.log | grep "5D56810400BB"
Feb 10 08:14:04 ks353656 postfix/cleanup[21699]: 5D56810400BB: message-id=<20080210071404.5D56810400BB@ks353656.kimsufi.com>
Feb 10 08:14:04 ks353656 postfix/qmgr[23991]: 5D56810400BB: from=<postmaster@ks353656.kimsufi.com>, size=280, nrcpt=1 (queue active)
Feb 10 08:14:05 ks353656 postfix/smtp[21700]: 5D56810400BB: to=<multitudinousxy5@psych-ai.com>, relay=mail-fwd.mx.g19.rapidsite.net[199.239.254.18]:25, delay=0.96, delays=0.01/0.01/0.57/0.37, dsn=2.0.0, status=deliverable (250 multitudinousxy5@psych-ai.com ok (normal))
Feb 10 08:14:05 ks353656 postfix/qmgr[23991]: 5D56810400BB: removed

Il est censé manquer quoi ?


@ tonio:
Du spam, mais vu que je n'ai pas gardé le mail (je l'ai effacé avant lecture des logs), je ne pourrais t'en dire plus.

Voila le master.cf (je n'ai pas supprimé les commentaires)

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_enforce_tls=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

Pour les modifs de main.cf, je les ai faites (et redemarrer postfix bien sur), je vais voir si cela arrange les choses.

Cordialement,

Dernière modification par elekaj34 (Le 10/02/2008, à 20:41)


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne

#9 Le 10/02/2008, à 20:40

toniotonio

Re : [résolu] Sécuriser Postfix

le master.Cf ?


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#10 Le 10/02/2008, à 20:42

elekaj34

Re : [résolu] Sécuriser Postfix

toniotonio a écrit :

le master.Cf ?

arf j'avais oublié la demande du master.cf après avoir envoyé le message, j'ai édité du coup.


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne

#11 Le 10/02/2008, à 20:44

Uggy

Re : [résolu] Sécuriser Postfix

elekaj34 a écrit :

Il est censé manquer quoi ?

Il aurait pu manquer une ligne si c'etait vraiment 201.212.168.60 qui avait envoyé le mail...

(ce que tu suspectait avec ta phrase "J'en conclu que l'ip en question tente de se faire passer pour le postmaster ..." )
Mais ce n'est pas le cas vu ton grep précédent.

Est ce que tu peux faire un autre grep sur "201.212.168.60"

Dernière modification par Uggy (Le 10/02/2008, à 20:47)

Hors ligne

#12 Le 10/02/2008, à 20:47

toniotonio

Re : [résolu] Sécuriser Postfix

il manque effectivement qque chose ici

fais voir tes fichiers de lookup sql ainsi qu'un dump de tables

Dernière modification par toniotonio (Le 10/02/2008, à 20:47)


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#13 Le 10/02/2008, à 21:55

elekaj34

Re : [résolu] Sécuriser Postfix

Le grep

ks353656:~# cat /var/log/mail.log | grep "201.212.168.60"
Feb 10 08:13:52 ks353656 postfix/smtpd[21681]: connect from 201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:07 ks353656 postfix/smtpd[21681]: 5A9C810400BB: client=201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:14 ks353656 postfix/smtpd[21681]: disconnect from 201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:17:34 ks353656 postfix/anvil[21683]: statistics: max connection rate 1/60s for (smtp:201.212.168.60) at Feb 10 08:13:52
Feb 10 08:17:34 ks353656 postfix/anvil[21683]: statistics: max connection count 1 for (smtp:201.212.168.60) at Feb 10 08:13:52

Les lookups

ks353656:~# cat /etc/postfix/mysql-virtual_mailboxes.cf
hosts = 127.0.0.1
user = postfix
password = xxxx
dbname = postfix
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
table = mailbox
where_field = email
additional_conditions = AND actif=1

ks353656:~# cat /etc/postfix/mysql-virtual_mailbox_limit_maps.cf
hosts = 127.0.0.1
user = postfix
password = xxxx
dbname = postfix
select_field = quota
table = mailbox
where_field = email

ks353656:~# cat /etc/postfix/mysql-virtual_domains.cf           
hosts = 127.0.0.1
user = postfix
password = xxxx
dbname = postfix
select_field = 'virtual'
table = domain
where_field = domain
additional_conditions = AND actif=1

ks353656:~# cat /etc/postfix/mysql-virtual_aliases.cf
hosts = 127.0.0.1
user = postfix
password = xxxx
dbname = postfix
select_field = destination
table = alias
where_field = source
additional_conditions = AND actif=1

ks353656:~# cat /etc/postfix/mysql-virtual_aliases_mailboxes.cf
hosts = 127.0.0.1
user = postfix
password = xxxx
dbname = postfix
select_field = email
table = mailbox
where_field = email
additional_conditions = AND actif=1

Et les dumps (domaines et mails masqués)

-- MySQL dump 10.11
--
-- Host: localhost    Database: postfix
-- ------------------------------------------------------
-- Server version       5.0.32-Debian_7etch3-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `alias`
--

DROP TABLE IF EXISTS `alias`;
CREATE TABLE `alias` (
  `source` varchar(255) NOT NULL default '',
  `destination` text NOT NULL,
  `actif` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`source`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Alias Virtuels';

--
-- Dumping data for table `alias`
--

LOCK TABLES `alias` WRITE;
/*!40000 ALTER TABLE `alias` DISABLE KEYS */;
INSERT INTO `alias` VALUES ('postmaster@xxxx.net','tech@xxxx.net',1),('hostmaster@xxxx.net','tech@xxxx.net',1),('abuse@xxxx.net','tech@xxxx.net',1),('webmaster@yyyy.fr','tech@yyyy.fr',1),('hostmaster@yyyy.fr','tech@yyyy.fr',1),('postmaster@yyyy.fr','tech@yyyy.fr',1),('inscription@yyyy.fr','contact@yyyy.fr',1);
/*!40000 ALTER TABLE `alias` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `domain`
--

DROP TABLE IF EXISTS `domain`;
CREATE TABLE `domain` (
  `domain` varchar(255) NOT NULL default '',
  `actif` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`domain`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Domaines Virtuels';

--
-- Dumping data for table `domain`
--

LOCK TABLES `domain` WRITE;
/*!40000 ALTER TABLE `domain` DISABLE KEYS */;
INSERT INTO `domain` VALUES ('xxxx.net',1),('yyyy.fr',1);
/*!40000 ALTER TABLE `domain` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `mailbox`
--

DROP TABLE IF EXISTS `mailbox`;
CREATE TABLE `mailbox` (
  `email` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `quota` int(10) NOT NULL default '0',
  `actif` tinyint(1) NOT NULL default '1',
  `imap` tinyint(1) NOT NULL default '1',
  `pop3` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Boites Emails Virtuelles';

--
-- Dumping data for table `mailbox`
--

LOCK TABLES `mailbox` WRITE;
/*!40000 ALTER TABLE `mailbox` DISABLE KEYS */;
INSERT INTO `mailbox` VALUES ('xxxx@xxxx.net','pass',0,1,1,1),('tech@xxxx.net','pass',0,1,1,1),('yyyy@yyyy.fr','pass',0,1,1,1),('tech@yyyy.fr','pass',0,1,1,1);
/*!40000 ALTER TABLE `mailbox` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2008-02-10 19:40:46

Par contre, je comprend pas trop la suppression des règles de restrictions smtpd.
Je vais confirmer demain après analyse des logs de la nuit.

Cordialement,


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne

#14 Le 10/02/2008, à 22:42

toniotonio

Re : [résolu] Sécuriser Postfix

la suppression des regles ne reglera pas ton pb. C'est juste pour faire plus clean dans la conf.

en revanche je ne vois pas comment tu peux avoir le log que tu indiques...
il doit manquer une info qque part, ou alors j'ai pas vu un truc sad


Tutoriaux Postfix sur www.starbridge.org/spip
Messagerie Dédiée, Relais Mail Antispam/Antivirus, Infogérance 24/7: http://www.eole-its.com

Hors ligne

#15 Le 11/02/2008, à 00:38

Uggy

Re : [résolu] Sécuriser Postfix

Reprenons.. on a:


- Tu recois un mail de 201.212.168.60 pour <xxxx@xxxx.net> qui est délivré...

Feb 10 08:14:07 ks353656 postfix/smtpd[21681]: 5A9C810400BB: client=201-212-168-60.net.prima.net.ar[201.212.168.60]
Feb 10 08:14:10 ks353656 postfix/cleanup[21699]: 5A9C810400BB: message-id=<01c86ba3$d5bf8980$3ca8d4c9@multitudinousxy5>
Feb 10 08:14:10 ks353656 postfix/qmgr[23991]: 5A9C810400BB: from=<multitudinousxy5@psych-ai.com>, size=857, nrcpt=1 (queue active)
Feb 10 08:14:10 ks353656 postfix/virtual[21701]: 5A9C810400BB: to=<xxxx@xxxx.net>, relay=virtual, delay=12, delays=12/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

- Ton système génère un mail pour "@psych-ai.com":

Feb 10 08:14:04 ks353656 postfix/cleanup[21699]: 5D56810400BB: message-id=<20080210071404.5D56810400BB@ks353656.kimsufi.com>
Feb 10 08:14:04 ks353656 postfix/qmgr[23991]: 5D56810400BB: from=<postmaster@ks353656.kimsufi.com>, size=280, nrcpt=1 (queue active)
Feb 10 08:14:05 ks353656 postfix/smtp[21700]: 5D56810400BB: to=<multitudinousxy5@psych-ai.com>, relay=mail-fwd.mx.g19.rapidsite.net[199.239.254.18]:25, delay=0.96, delays=0.01/0.01/0.57/0.37, dsn=2.0.0, status=deliverable (250 multitudinousxy5@psych-ai.com ok (normal))
Feb 10 08:14:05 ks353656 postfix/qmgr[23991]: 5D56810400BB: removed

Pourquoi ton serveur a généré ce mail.. diffcile a dire avec les infos qu'on a

Hors ligne

#16 Le 11/02/2008, à 10:04

elekaj34

Re : [résolu] Sécuriser Postfix

Je suis conscient qu'il y a un truc qui cloche.

Par contre, en guise de test, j'ai repris la config de Postfix avec la configuration comme suit :

mynetworks = 127.0.0.1
smtpd_sender_restrictions = permit_mynetworks
#smtpd_recipient_restrictions =
#   permit_mynetworks,
#   reject_non_fqdn_hostname,
#   reject_non_fqdn_sender,
#   reject_non_fqdn_recipient,
#   reject_unauth_destination,
#   reject_invalid_hostname

# client
#smtpd_client_restrictions =
#        reject_unknown_client,
#        permit_mynetworks

Déjà , ce matin, sans analyser les logs, j'avais beaucoup de spam (3 contre une dizaine habituellement), cela n'est peut être qu'une coà¯ncidence à  confirmer dans les jours qui viennent.
Mais surtout, plus aucun mail envoyés vers l'extérieur
Je n'ai eu aucune ligne du style durant la nuit (sur la nuit d'avant, 6, une dizaine par jour)

Feb 10 08:14:05 ks353656 postfix/smtp[21700]: 5D56810400BB: to=<multitudinousxy5@psych-ai.com>, relay=mail-fwd.mx.g19.rapidsite.net[199.239.254.18]:25, delay=0.96, delays=0.01/0.01/0.57/0.37, dsn=2.0.0, status=deliverable (250 multitudinousxy5@psych-ai.com ok (normal))

Pourquoi ton serveur a généré ce mail.. diffcile a dire avec les infos qu'on a

Je répondrais a priori par une mauvaise config du smtpd_senders_restriction. Cependant je vois pas pourquoi en enlevant reject_unknown_sender_domain et warn_if_reject reject_unverified_sender cela arrange les choses (car on ne match pas permit_mynetworks) ... faudra que je revoie le fonctionnement des restrictions, quelques choses m'échappe.
Il est possible aussi que le problème ai été résolu par suppression de smtpd_recipient_restrictions et/ou smtpd_client_restrictions.

@tonio : Tu ne vois pas pourquoi j'ai ces logs, mais pourtant (hormis adresses mails cachées) ce ceux de mon système !!!

Enfin à  force on y arrivera smile ... d'ailleurs, a verifier, mais je crois tenir le bon bout !!!

Merci pour l'aide

Dernière modification par elekaj34 (Le 11/02/2008, à 10:05)


Alain - Linux Ubuntu 18.04 LTS 64bits
Lumières d'Ici ... et d'Ailleurs

Hors ligne