Fórum Ubuntu CZ/SK
Ostatní => Ubuntu Server => Téma založeno: Kony.cz 17 Listopadu 2016, 16:01:54
-
Hoj, potreboval bych nastavit postfix aby preposilal maily pres smtp server googlu.. uz si stim hraju nekolik hodin a porad to nemuzu rozchodit..
/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 (Ubuntu)
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/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server.fun-net.sk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server.fun-net.sk, localhost.fun-net.sk, , localhost
relayhost = smtp.google.com 465
mynetworks = 192.168.1.0/24, 172.16.10.0/24, 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
/etc/postfix/sasl_password
smtp.google.com login:heslo
-
kdyz to mam bez relay tak mi to hlasi tohle
root@server:~# grep 6F20D140D48 /var/log/mail.log
Nov 17 20:03:58 server postfix/smtpd[22182]: 6F20D140D48: client=localhost[::1]
Nov 17 20:04:04 server postfix/cleanup[22191]: 6F20D140D48: message-id=<20161117190358.6F20D140D48@server.fun-net.sk>
Nov 17 20:04:04 server postfix/qmgr[22170]: 6F20D140D48: from=<akv7v@seznam.cz>, size=320, nrcpt=1 (queue active)
Nov 17 20:04:05 server postfix/smtp[22192]: 6F20D140D48: to=<root@server.fun-server.sk>, relay=none, delay=25, delays=25/0.02/0.2/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=server.fun-server.sk type=AAAA: Host not found)
Nov 17 20:04:05 server postfix/bounce[22193]: 6F20D140D48: sender non-delivery notification: 3B7A8140D4A
Nov 17 20:04:05 server postfix/qmgr[22170]: 6F20D140D48: removed
a v druhym pripade
root@server:~# grep 8D853140D4C /var/log/mail.log
Nov 17 20:06:10 server postfix/smtpd[22243]: 8D853140D4C: client=localhost[::1]
Nov 17 20:06:14 server postfix/cleanup[22249]: 8D853140D4C: message-id=<20161117190610.8D853140D4C@server.fun-net.sk>
Nov 17 20:06:14 server postfix/qmgr[22170]: 8D853140D4C: from=<akv7v@seznam.cz>, size=316, nrcpt=1 (queue active)
Nov 17 20:06:14 server postfix/smtp[22254]: 8D853140D4C: to=<konecnyj@seznam.cz>, relay=none, delay=13, delays=13/0.02/0.19/0, dsn=4.4.1, status=deferred (connect to mx2.seznam.cz[77.75.78.32]:25: Connection refused)
ted jsem udelal dalsi zmeny....
a....
pri tomot nastaveni :
# 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 (Ubuntu)
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/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
#relayhost = [smtp.gmail.com]:587
#relayhost = [smtp.seznam.cz]:465
#smtp_use_tls = yes
#smtp_sasl_auth_enable = yes
#smtp_sasl_security_options =
#smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
myhostname = fun-net.sk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server.fun-net.sk, localhost.fun-net.sk, , localhost
mynetworks = 192.168.1.0/24, 172.16.10.0/24, 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
root@server:~# grep 1542C140D62 /var/log/mail.log
Nov 17 21:05:41 server postfix/smtpd[25055]: 1542C140D62: client=localhost[127.0.0.1]
Nov 17 21:05:45 server postfix/cleanup[25072]: 1542C140D62: message-id=<20161117200541.1542C140D62@fun-net.sk>
Nov 17 21:05:45 server postfix/qmgr[25032]: 1542C140D62: from=<akv7v@seznam.cz>, size=296, nrcpt=1 (queue active)
Nov 17 21:05:45 server postfix/smtp[25044]: 1542C140D62: to=<konecnyj@seznam.cz>, relay=none, delay=13, delays=13/0/0.12/0, dsn=4.4.1, status=deferred (connect to mx2.seznam.cz[77.75.78.32]:25: Connection refused)
-
Nejsem si moc jist parametrem toho portu u relayhost
Vlastně jsem to nenašel ani v dokumentaci http://www.postfix.org/postconf.5.html#relayhost
Dokonce to při restartu vyhazuje chyby
postmulti: fatal: relayhost parameter setting must not contain multiple values
Neměla by tam místo mezery být dvojtečka?
-
tak uz fakt nevim.... chtel bych to vyresit bez relayserveru, ale uz nevim kde presne hledat chybu...
tohle mam nastaveni bez relay
# 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 (Ubuntu)
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/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
#relayhost = smtp.gmail.com:587
#relayhost = [smtp.seznam.cz]:465
#smtp_use_tls = yes
#smtp_sasl_auth_enable = yes
#smtp_sasl_security_options =
#smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
myhostname = fun-net.sk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server.fun-net.sk, localhost.fun-net.sk, , localhost
mynetworks = 192.168.1.0/24, 172.16.10.0/24, 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
a pri odeslani mailu mi to pise :
Nov 22 16:38:33 server postfix/smtpd[26326]: 3B9F01405A1: client=localhost[127.0.0.1]
Nov 22 16:38:37 server postfix/cleanup[26333]: 3B9F01405A1: message-id=<20161122153833.3B9F01405A1@fun-net.sk>
Nov 22 16:38:37 server postfix/qmgr[26311]: 3B9F01405A1: from=<akv7v@seznam.cz>, size=296, nrcpt=1 (queue active)
Nov 22 16:39:37 server postfix/smtp[26334]: 3B9F01405A1: to=<konecnyj@seznam.cz>, relay=none, delay=71, delays=11/0.02/60/0, dsn=4.4.1, status=deferred (connect to mx2.seznam.cz[77.75.76.32]:25: Connection timed out)
-
A nemáš blokovaný port 25 ?
-
uz jsem na to prisel... tvrdili na antiku.sk ze neblokujou a potom jsem jim vyslal traceroute o tom ze to konci u nich, tak znich vylezlo ze blokuji.... tak tedka resim jak to nasmeovat na google.mail ucet
-
No vzhledem k aktuálnímu výpadku google, bych to nechal na zítra :)
-
no zkousel jsem i vcera a taky nic.... takze uz vazne nevim
-
Jak jste dopadl? Povedlo se?
(Ptám se protože mi přijde zajímavé, že by se smtp googlu k něčemu takovému nechal použít)
-
určitě Vám google povolí relay domén co nemá v administraci? Spíše otázka, osobně bych o tom pochyboval.