Bonjour,
Après trois jours de galère et d’écumage du web pour comprendre ce qui m’arrive, je bloque toujours donc je viens vous faire part de mon problème. Le souci doit être évident, mais je n’arrive pas à mettre la main dessus……
Le coup à l’air classique: je peux envoyer et recevoir des messages en interne, en recevoir depuis l’extérieur, mais pas en envoyer vers l’extérieur…
Je suis en Stable et elle est mise à jour, tout en auto-hébergement.
J’ai installé un serveur DNS sous bind9 qui fonctionne convenablement je pense. (ip est bonne)
root@dns:/home/lucas# host etboum.org
etboum.org has address 78.238.174.165
et
[code]root@dns:/home/lucas# dig etboum.org
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> etboum.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50630
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;etboum.org. IN A
;; ANSWER SECTION:
etboum.org. 604800 IN A 78.238.174.165
;; AUTHORITY SECTION:
etboum.org. 604800 IN NS dns.etboum.org.
;; ADDITIONAL SECTION:
dns.etboum.org. 604800 IN A 78.238.174.165
;; Query time: 0 msec
;; SERVER: 192.168.0.44#53(192.168.0.44)
;; WHEN: Thu Jul 10 21:03:41 2014
;; MSG SIZE rcvd: 78
[/code]
J’ai installé postfix et dovecot en activant l’authentification et en utilisant sumbission.
Postfix: main.cf:
[code]root@dns:/home/lucas# cat /etc/postfix/main.cf
See /usr/share/postfix/main.cf.dist for a commented, more complete version
Debian specific: Specifying a file name will cause the first
line of that file to be used as the name. The Debian default
is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
appending .domain is the MUA’s job.
append_dot_mydomain = no
Uncomment the next line to generate “delayed mail” warnings
#delay_warning_time = 4h
readme_directory = no
TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/etboum.crt
smtpd_tls_key_file=/etc/ssl/private/etboum.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
Activer l’identification SASL
smtpd_sasl_auth_enable = yes
Utiliser le service d’identification de Dovecot
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
Noter dans les en-tête des messages l’identifiant de l’utilisateur.
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
information on enabling SSL in the smtp client.
myhostname = dns.etboum.org
mydomain = etboum.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =smtp.etboum.org, dns.etboum.org, localhost, localhost.etboum.org, etboum.org
mynetworks = 127.0.0.0/8, [::1]/128
mailbox_command =
mailbox_size_limit = 2000000000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/
root@dns:/home/lucas#
[/code]
postfix: master.cf
[code]root@dns:/home/lucas# cat /etc/postfix/master.cf
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 - - - - smtpd
#smtp inet n - - - 1 postscreen
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
submission inet n - - - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
-o syslog_name=postfix/smtps
-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 - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - 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
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
-o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry 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}
====================================================================
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/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}
root@dns:/home/lucas#
[/code]
Dovecot: 10-master.conf
[code]root@dns:/home/lucas# cat /etc/dovecot/conf.d/10-master.conf
#default_process_limit = 100
#default_client_limit = 1000
Default VSZ (virtual memory size) limit for service processes. This is mainly
intended to catch and kill processes that leak memory before they eat up
everything.
#default_vsz_limit = 256M
Login user is internally used by login processes. This is the most untrusted
user in Dovecot system. It shouldn’t have access to anything at all.
#default_login_user = dovenull
Internal user is used by unprivileged processes. It should be separate from
login user, so that login processes can’t disturb other processes.
#default_internal_user = dovecot
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
#port = 993
#ssl = yes
}
Number of connections to handle before starting a new process. Typically
the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
is faster. <doc/wiki/LoginProcess.txt>
#service_count = 1
Number of processes to always keep waiting for more connections.
#process_min_avail = 0
If you set service_count=0, you probably need to grow this.
#vsz_limit = $default_vsz_limit
}
service pop3-login {
inet_listener pop3 {
#port = 110
}
inet_listener pop3s {
#port = 995
#ssl = yes
}
}
service lmtp {
unix_listener lmtp {
#mode = 0666
}
Create inet listener only if you can’t use the above UNIX socket
#inet_listener lmtp {
# Avoid making LMTP visible for the entire internet
#address =
#port =
#}
}
service imap {
Most of the memory goes to mmap()ing files. You may need to increase this
limit if you have huge mailboxes.
#vsz_limit = $default_vsz_limit
Max. number of IMAP processes (connections)
#process_limit = 1024
}
service pop3 {
Max. number of POP3 processes (connections)
#process_limit = 1024
}
service auth {
auth_socket_path points to this userdb socket by default. It’s typically
used by dovecot-lda, doveadm, possibly imap process, etc. Users that have
full permissions to this socket are able to get a list of all usernames and
get the results of everyone’s userdb lookups.
The default 0666 mode allows anyone to connect to the socket, but the
userdb lookups will succeed only if the userdb returns an “uid” field that
matches the caller process’s UID. Also if caller’s uid or gid matches the
socket’s uid or gid the lookup succeeds. Anything else causes a failure.
To give the caller full permissions to lookup all users, set the mode to
something else than 0666 and Dovecot lets the kernel enforce the
permissions (e.g. 0777 allows everyone full permissions).
unix_listener auth-userdb {
mode = 0666
#user =
#group =
#}
Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user=postfix
group=postfix
}
Auth process is run as this user.
user = $default_internal_user
}
service auth-worker {
Auth worker process is run as root by default, so that it can access
/etc/shadow. If this isn’t necessary, the user should be changed to
$default_internal_user.
#user = root
}
service dict {
If dict proxy is used, mail processes should have access to its socket.
For example: mode=0660, group=vmail and global mail_access_groups=vmail
unix_listener dict {
#mode = 0600
#user =
#group =
}
}
mail_location = maildir:~/Maildir
root@dns:/home/lucas#
[/code]
Le blocage du smtp par la freebox v6 est désactivé, les redirections de ports faites (25 53 110 143 et 587 plus d’autres) et le parefeu bien configuré aussi.
Sous Icedove, je peux m’envoyer un mail de lucas at eboum.org vers lucas at eboum.org (sur la même machine, je suis autohébergé sur mon pc portable perso), je peux en recevoir depuis gmail et hotmail, mais je ne peux pas en envoyer vers l’extérieur.
/var/log/mail.log lors d’un envoi à l’intérieur réussi (étoiles anti-spam):
Jul 10 21:20:30 dns postfix/submission/smtpd[5220]: connect from dns.etboum.org[192.168.0.44]
Jul 10 21:20:30 dns postfix/submission/smtpd[5220]: 9BD8323C00: client=dns.etboum.org[192.168.0.44], sasl_method=PLAIN, sasl_username=lucas
Jul 10 21:20:30 dns postfix/cleanup[5227]: 9BD8323C00: message-id=<53BEE77E.9070908@et*oum.org>
Jul 10 21:20:30 dns postfix/submission/smtpd[5220]: disconnect from dns.etboum.org[192.168.0.44]
Jul 10 21:20:30 dns postfix/qmgr[3320]: 9BD8323C00: from=<l**s@et*oum.org>, size=569, nrcpt=1 (queue active)
Jul 10 21:20:31 dns postfix/local[5228]: 9BD8323C00: to=<l**s@etb*um.org>, relay=local, delay=0.52, delays=0.35/0.08/0/0.09, dsn=2.0.0, status=sent (delivered to maildir)
Jul 10 21:20:31 dns postfix/qmgr[3320]: 9BD8323C00: removed
root@dns:/home/lucas#
/var/log/mail.log lors d’un essai vers un de mes comptes gmail valides:
Jul 10 21:21:06 dns dovecot: imap-login: Login: user=<lucas>, method=PLAIN, rip=192.168.0.44, lip=192.168.0.44, mpid=5235, TLS, session=<rkr7udv9DwDAqAAs>
Jul 10 21:23:50 dns postfix/anvil[5222]: statistics: max connection rate 1/60s for (submission:192.168.0.44) at Jul 10 21:20:30
Jul 10 21:23:50 dns postfix/anvil[5222]: statistics: max connection count 1 for (submission:192.168.0.44) at Jul 10 21:20:30
Jul 10 21:23:50 dns postfix/anvil[5222]: statistics: max cache size 1 at Jul 10 21:20:30
Jul 10 21:25:28 dns postfix/submission/smtpd[5244]: connect from dns.etboum.org[192.168.0.44]
Jul 10 21:25:28 dns postfix/submission/smtpd[5244]: 7F84123C00: client=dns.etboum.org[192.168.0.44], sasl_method=PLAIN, sasl_username=lucas
Jul 10 21:25:28 dns postfix/cleanup[5251]: 7F84123C00: message-id=<53BEE8A8.3040407@etboum.org>
Jul 10 21:25:28 dns postfix/submission/smtpd[5244]: disconnect from dns.etboum.org[192.168.0.44]
Jul 10 21:25:29 dns postfix/qmgr[3320]: 7F84123C00: from=<l**s@et*oum.org>, size=586, nrcpt=1 (queue active)
Jul 10 21:25:59 dns postfix/smtp[5252]: connect to gmail-smtp-in.l.google.com[173.194.66.27]:25: Connection timed out
Jul 10 21:26:29 dns postfix/smtp[5252]: connect to alt1.gmail-smtp-in.l.google.com[173.194.71.27]:25: Connection timed out
Jul 10 21:26:59 dns postfix/smtp[5252]: connect to alt2.gmail-smtp-in.l.google.com[74.125.25.27]:25: Connection timed out
Jul 10 21:27:29 dns postfix/smtp[5252]: connect to alt3.gmail-smtp-in.l.google.com[173.194.64.27]:25: Connection timed out
Jul 10 21:27:59 dns postfix/smtp[5252]: connect to alt4.gmail-smtp-in.l.google.com[74.125.142.27]:25: Connection timed out
Jul 10 21:27:59 dns postfix/smtp[5252]: 7F84123C00: to=<***.***@gmail.com>, relay=none, delay=151, delays=0.66/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[74.125.142.27]:25: Connection timed out)
root@dns:/home/lucas#
D’après ce que j’ai vu sur le web et de ce que j’y comprends, il pourait s’agir d’un souci d’authentification car l’adresse du mail de google ne correspond pas à l’adresse que j’envoie et postfix rejette le mail, le souci, c’est que je ne sais pas régler ce souci, cela excède mon niveau de bidouille…
Si vous avez une solution, je vous en remercie d’avance !
