Pas très facile de poser une question sur un point d'ignorance,
alors je plante le décor, en espérant que ceux qui connaissent, puissent éclairer ma lanterne.
J'essaie de bien cerner par quel chemin les messages SMTP port 25 entrent dans la tuyauterie de postfix
Code : Tout sélectionner
# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2023-05-08 09:56:54 UTC; 11min ago
Process: 998 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Process: 1037 ExecReload=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 998 (code=exited, status=0/SUCCESS)
CPU: 3ms
May 08 09:56:54 server.dezix.virt systemd[1]: Starting Postfix Mail Transport Agent...
May 08 09:56:54 server.dezix.virt systemd[1]: Finished Postfix Mail Transport Agent.
May 08 09:56:55 server.dezix.virt systemd[1]: Reloading Postfix Mail Transport Agent.
May 08 09:56:55 server.dezix.virt systemd[1]: Reloaded Postfix Mail Transport Agent.
Là une 1ère interrogation Ici on a : Main PID: 998
or
pgrep postfix ou ps -fp 998 ont une sortie vide,
pourtant la suite montre une certaine activité.
Idem pour PID = 1037 (vide)
Code : Tout sélectionner
# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 440/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 440/dovecot
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 456/sshd: /usr/sbin
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 997/master
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 440/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 440/dovecot
tcp6 0 0 :::110 :::* LISTEN 440/dovecot
tcp6 0 0 :::143 :::* LISTEN 440/dovecot
tcp6 0 0 :::22 :::* LISTEN 456/sshd: /usr/sbin
tcp6 0 0 :::25 :::* LISTEN 997/master
tcp6 0 0 :::993 :::* LISTEN 440/dovecot
tcp6 0 0 :::995 :::* LISTEN 440/dovecot
udp 0 0 0.0.0.0:68 0.0.0.0:* 403/dhclient
Code : Tout sélectionner
# ps -fp 997
UID PID PPID C STIME TTY TIME CMD
root 997 1 0 09:56 ? 00:00:00 /usr/lib/postfix/sbin/master -w
# lsof -p 997 | grep private
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 997 root 29u unix 0x00000000be139025 0t0 12272 private/tlsmgr type=STREAM
master 997 root 32u unix 0x00000000f9e78867 0t0 12275 private/rewrite type=STREAM
master 997 root 35u unix 0x000000006f4e8d4d 0t0 12278 private/bounce type=STREAM
master 997 root 38u unix 0x000000002618ff5a 0t0 12281 private/defer type=STREAM
master 997 root 41u unix 0x000000007ed8b92d 0t0 12284 private/trace type=STREAM
master 997 root 44u unix 0x000000005fda1e67 0t0 12287 private/verify type=STREAM
master 997 root 50u unix 0x0000000005ba89df 0t0 12293 private/proxymap type=STREAM
master 997 root 53u unix 0x000000004e85f1d4 0t0 12296 private/proxywrite type=STREAM
master 997 root 56u unix 0x00000000353471b0 0t0 12299 private/smtp type=STREAM
master 997 root 59u unix 0x000000000553a8ff 0t0 12302 private/relay type=STREAM
master 997 root 65u unix 0x00000000c0a4ef0c 0t0 12308 private/error type=STREAM
master 997 root 68u unix 0x0000000038a0f919 0t0 12311 private/retry type=STREAM
master 997 root 71u unix 0x000000001b87e442 0t0 12314 private/discard type=STREAM
master 997 root 74u unix 0x00000000735c671d 0t0 12317 private/local type=STREAM
master 997 root 77u unix 0x00000000102e76ba 0t0 12320 private/virtual type=STREAM
master 997 root 80u unix 0x000000009441452a 0t0 12323 private/lmtp type=STREAM
master 997 root 83u unix 0x000000000bd76b7c 0t0 12326 private/anvil type=STREAM
master 997 root 86u unix 0x000000006fae3e07 0t0 12329 private/scache type=STREAM
master 997 root 92u unix 0x0000000092256638 0t0 12335 private/maildrop type=STREAM
master 997 root 95u unix 0x00000000f269840f 0t0 12338 private/uucp type=STREAM
master 997 root 98u unix 0x000000006ee0195e 0t0 12341 private/ifmail type=STREAM
master 997 root 101u unix 0x0000000034d3fa2e 0t0 12344 private/bsmtp type=STREAM
master 997 root 104u unix 0x00000000c690c608 0t0 12347 private/scalemail-backend type=STREAM
master 997 root 107u unix 0x0000000086dabe31 0t0 12350 private/mailman type=STREAM
# lsof -p 997 | grep -i tcp
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
....
master 997 root 13u IPv4 12257 0t0 TCP *:smtp (LISTEN)
master 997 root 14u IPv6 12258 0t0 TCP *:smtp (LISTEN)
Ce que je comprends de cela :
root exécute : /usr/lib/postfix/sbin/master avec le PID = 997
ce processus a des sous-processus pour créer/utiliser des sockets UNIX et TCP
Pour les sockets UNIX
(que je comprends comme une sorte de conduite permettant la communication de données entre processus)
p.ex : /usr/lib/postfix/sbin/anvil permet la création de : /var/spool/postfix/private/anvil
Code : Tout sélectionner
# stat /var/spool/postfix/private/anvil
File: /var/spool/postfix/private/anvil
Size: 0 Blocks: 0 IO Block: 4096 socket
Device: 801h/2049d Inode: 262547 Links: 1
Access: (0666/srw-rw-rw-) Uid: ( 106/ postfix) Gid: ( 114/ postfix)
Pour les sockets TCP,
je suppose que c'est le noyau qui fournit les prises (IPv4/6) à /usr/lib/postfix/sbin/smtpd
pour écouter sur le port 25,
mais je ne vois pas où cela existe sur le système ???
Apparemment, 2 sockets (1 par version du protocole IP) peuvent écouter sur le même port 25 ... ou pas ?
Je ne souhaite pas approfondir trop,
mais juste cerner globalement ce qui se passe à l'étage du dessous...
... si c'est possible ?
Merci.