Page 1 sur 2
[Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : lun. 13 juin 2011, 21:42
par shom
Je suis le créateur de ce topic
http://forums.archlinux.fr/topic8455.html mais pour clarifier les choses j'en ai refait un

Voilà ! J'ai essayer de créer un serveur SMTP et IMAP avec le tuto sur le wiki
https://wiki.archlinux.org/index.php/Postfix_Tutorial et j'ai aussi coniguré un DNS chez Dyndns en choisissant un MX Hostname mais maintenant voilà où j'en suis :
- Mon client arrive a se connecter a mon serveur IMAP mais ne recoit que les messages locaux
- Il trouve le serveur SMTP et s'y connecte mais n'arrive pas a envoyer de messages
Et voici mon /etc/var/log/mail.log
Code : Tout sélectionner
Jun 13 23:04:32 localhost postgrey[873]: Process Backgrounded
Jun 13 23:04:32 localhost postgrey[873]: 2011/06/13-23:04:32 postgrey (type Net::Server::Multiplex) starting! pid(873)
Jun 13 23:04:32 localhost postgrey[873]: Using default listen value of 128
Jun 13 23:04:32 localhost postgrey[873]: Binding to TCP port 10030 on host 127.0.0.1
Jun 13 23:04:32 localhost postgrey[873]: Setting gid to "314 314"
Jun 13 23:04:32 localhost postgrey[873]: Setting uid to "314"
Jun 13 23:04:33 localhost dovecot: master: Dovecot v2.0.13 starting up (core dumps disabled)
Jun 13 23:04:35 localhost postfix/postfix-script[993]: starting the Postfix mail system
Jun 13 23:04:35 localhost postfix/master[994]: daemon started -- version 2.8.3, configuration /etc/postfix
Merci d'avance

Re: [Serveur SMTP IMAP] Postfix non accesible (en cours)
Publié : mar. 14 juin 2011, 00:46
par shom
Et j'arrive a envoyer des messages en local avec
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 01:19
par shom
Voici mon /etc/postfix/main.cf
Code : Tout sélectionner
# Paths
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
# Domain settings
myhostname = <DNS>
myorigin = <MX Hostname>
mydestination = $myhostname, localhost.$mydomain, localhost
# Timeout settings and other limits
delay_warning_time = 4h
unknown_local_recipient_reject_code = 450
minimal_backoff_time = 300s
maximal_backoff_time = 1200s
maximal_queue_lifetime = 1d
bounce_queue_lifetime = 1d
smtp_helo_timeout = 60s
smtpd_soft_error_limit = 3
smtpd_hard_error_limit = 12
# SMTP settings
smtpd_tls_cert_file=/etc/ssl/certs/mail.crt
smtpd_tls_key_file=/etc/ssl/private/mail.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache
smtpd_tls_loglevel = 1
smtpd_sasl_auth_enable = yes
#smtp_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
check_policy_service inet:127.0.0.1:10030
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_sasl_security_options = noanonymous
# SASL
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
# Network settings
inet_interfaces = all
inet_protocols = ipv4
mynetworks = 192.168.1.1/24, 127.0.0.0/8
relayhost =
# Email and mailbox settings
alias_maps = hash:/etc/postfix/aliases
alias_database = $alias_maps
home_mailbox = Maildir/
virtual_alias_domains = shom.org
virtual_alias_maps = hash:/etc/postfix/virtual
mailbox_size_limit = 0
# Misc
smtpd_banner = $myhostname ESMTP
biff = no
append_dot_mydomain = no
debug_peer_level = 2
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/man
sample_directory = /etc/postfix/sample
readme_directory = no
recipient_delimiter = +
Et mon /etc/postfix/master.cf
Code : Tout sélectionner
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#smtp inet n - n - 1 postscreen
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#smtp inet n - n - 1 postscreen
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
#smtp inet n - n - 1 postscreen
#smtpd pass - - n - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - n - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 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/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 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/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 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/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# 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/local/sbin/bsmtp -f $sender $nexthop $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}
Jetez-y un petit coup d'oeil s'iouplez !

Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 12:25
par widapit
dans le '/etc/postfix/main.cf'
ne serait-ce pas ça qui te limite au local ??
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 12:29
par shom
Merci de ta réponse !
C'est possible, dans ce cas là, que dois-je mettre ?
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 12:35
par benjarobin
La sortie de netstat -taupe pourrait aider aussi
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 12:39
par shom
Voici netstat -taupe
Code : Tout sélectionner
tcp 0 0 *:smtp *:* LISTEN root 11876 2936/master
tcp 0 0 *:imaps *:* LISTEN root 7370 885/dovecot
tcp 0 0 *:commplex-main *:* LISTEN root 6913 657/sshd
tcp 0 0 localhost.localdo:10030 *:* LISTEN root 7323 860/postgrey --daem
tcp 0 0 *:imap *:* LISTEN root 7368 885/dovecot
tcp 0 0 localhost.localdoma:783 *:* LISTEN root 7108 741/spamd.pid
tcp 0 0 shom.lan:commplex-main shom-System-Produ:51264 ESTABLISHED root 12285 3036/0
tcp 0 0 *:imaps *:* LISTEN root 7371 885/dovecot
tcp 0 0 *:commplex-main *:* LISTEN root 6915 657/sshd
tcp 0 0 *:imap *:* LISTEN root 7369 885/dovecot
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 13:09
par widapit
bon, on est bien d'accord que ça marche en local....
comment te connectes-tu depuis l'extérieur ? pour éviter les erreur dues éventuellement à la conf de dyndns, que se passe-t-il lorsque tu envoies à 'user@ton_IP_publique' ??
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 13:19
par shom
Quand j'envoie un mail sur le serveur vers le serveur avec "mail user@Ip_publique"
Tout est normal dans mon mail.log sauf CA
Code : Tout sélectionner
Jun 14 13:46:53 localhost postfix/trivial-rewrite[3939]: warning: do not list domain <MX Hostname> in BOTH mydestination and virtual_alias_domains
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 14:01
par FoolEcho
Je ne peux pas trop aider pour ça, mais ça doit être lié à ça:
http://postfix.traduc.org/index.php/pos ... estination (je te recommande la lecture de ce site en général, c'est la traduction de la doc de postfix).
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 17:17
par shom
J'ai commenté virtual_alias_domains
Je n'ai plus de message d'erreur dans mon mail.log mais toujours "Host unreachable"...
Merci

Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 18:06
par widapit
question stupide: as-tu bien ouvert les ports au niveau de ta box ?
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mar. 14 juin 2011, 21:24
par shom
Oui, les ports 25 (SMTP) et 143 (IMAP) UDP et TCP sont redirigés vers mon serveur.
Une idée ? Merci encore !
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mer. 15 juin 2011, 12:31
par tuxce
Normalement, avec une box, si tu fais les tests en local, l'hôte pointe vers ta box, même avec les ports ouverts, tu n'accèdes pas à ta machine, il te faut déclarer dans le /etc/hosts ton nom de domaine vers le 127.0.0.1
Ceci dit, je comprends pas comment tu peux te connecter à ton smtp en spécifiant le nom de domaine et en étant en local (la box à un serveur smtp ?) (pareil pour imap)
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mer. 15 juin 2011, 14:57
par shom
Oui.. Effectivement .. C'est bizarre ..Merci de votre aide !
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : mer. 15 juin 2011, 15:26
par tuxce
En fait je m'attendais à un retour, mais j'ai peut être mal formulé

Tu as modifié ton /etc/hosts ?
Sinon, en dehors des clients, un
Tu te connectes à ton smtp ? Si c'est le cas, tu devrais avoir un:
Sinon, je pense qu'essayer de débugguer tout en même temps, tout le monde s'y perd et surtout chacun suit une piste, tu devrais y aller pas à pas, par exemple, déjà, un postfix simple, sans authentification, et un essai avec telnet qui te donnera plus d'infos.
Par exemple, le
shom a écrit :Je n'ai plus de message d'erreur dans mon mail.log mais toujours "Host unreachable"...
J'ai peut être raté un truc, mais c'est la première fois que tu en parles et vu que tu parles d'IP juste avant, je vois pas trop le lien.
ou
shom a écrit :- Mon client arrive a se connecter a mon serveur IMAP mais ne recoit que les messages locaux
Tu veux dire quoi par "locaux" ?
Enfin bref, y aller service par service et s'assurer qu'il fonctionne éviterait de se plonger dans 50 fichiers de configuration en même temps.
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : jeu. 16 juin 2011, 23:03
par shom
Oui, je te l'accorde, c'est le foutoir :p
Alors, un Telnet server 25 me dit qu'il ne trouve pas le serveur ... Mais en utilisant un autre main.cf trouvé sur internet j'avais eu
mais je ne l'avais pas gardé car quand je me connecter depuis mon client j'avais le meme probleme qu'avec l'autre main.cf "Host unreachable" ...
Ensuite quand je parlais des messages locaux, je voulais dire les messages envoyé depuis le serveur avec la commande
Voilà ou j'en suis ... Pas de serveur SMTP qui peut être trouvé et un serveur IMAP qui permet de lire les messages qui sont envoyés depuis le serveur. Du coup quand j'envoie un message depuis une boite Gmail ou autre vers mon serveur, je reçois un message comme quoi il n'a pas pu trouver le destinataire ..
Merci encore

Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : ven. 17 juin 2011, 00:29
par tuxce
Du coup, on va oublier le serveur imap, car s'il n'y a que les messages envoyés en local qui sont relayés, je vois pas comment il peut t'en sortir d'autre ... en gros il semble fonctionner.
Pour en revenir au serveur smtp, tu n'as pas précisé si tu as rajouté le nom de ton serveur (avec le nom de domaine) dans le /etc/hosts
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : ven. 17 juin 2011, 13:27
par widapit
oui, effectivement, c'est bien de préciser... parceque
shom a écrit :Et j'arrive a envoyer des messages en local avec
je pensais que ca marchait depuis n'importe quel poste situé sur le réseau local !
Re: [Serveur SMTP IMAP] Postfix non accesible (déprime..)
Publié : sam. 18 juin 2011, 00:43
par shom
Euh.. Non je n'ai pas configurer mon hosts
Il faut que je mette
?