Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: Ubuntu - Postfix a relay na google.com  (Přečteno 8483 krát)

Kony.cz

  • Aktivní člen
  • *
  • Příspěvků: 289
Ubuntu - Postfix a relay na google.com
« kdy: 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
Kód: [Vybrat]
# 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
Kód: [Vybrat]
smtp.google.com login:heslo

Kony.cz

  • Aktivní člen
  • *
  • Příspěvků: 289
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #1 kdy: 17 Listopadu 2016, 20:07:30 »
kdyz to mam bez relay tak mi to hlasi tohle

Kód: [Vybrat]
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

Kód: [Vybrat]
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 :

Kód: [Vybrat]
# 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

Kód: [Vybrat]
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)
« Poslední změna: 17 Listopadu 2016, 21:07:36 od Kony.cz »

Petr Merlin Vaněček

  • Moderátor
  • Závislák
  • ***
  • Příspěvků: 5057
    • Lomítkáři
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #2 kdy: 18 Listopadu 2016, 10:51:23 »
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
Kód: [Vybrat]
postmulti: fatal: relayhost parameter setting must not contain multiple values

Neměla by tam místo mezery být dvojtečka?
Stiskni CTRL + W ...
80% mozku tvoří kapalina ... u některých brzdová

Kony.cz

  • Aktivní člen
  • *
  • Příspěvků: 289
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #3 kdy: 22 Listopadu 2016, 16:36:53 »
tak uz fakt nevim.... chtel bych to vyresit bez relayserveru, ale uz nevim kde presne hledat chybu...

tohle mam nastaveni bez relay
Kód: [Vybrat]

# 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 :

Kód: [Vybrat]
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)
« Poslední změna: 22 Listopadu 2016, 16:40:27 od Kony.cz »

Petr Merlin Vaněček

  • Moderátor
  • Závislák
  • ***
  • Příspěvků: 5057
    • Lomítkáři
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #4 kdy: 22 Listopadu 2016, 21:02:57 »
A nemáš blokovaný port 25 ?
Stiskni CTRL + W ...
80% mozku tvoří kapalina ... u některých brzdová

Kony.cz

  • Aktivní člen
  • *
  • Příspěvků: 289
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #5 kdy: 22 Listopadu 2016, 21:07:53 »
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

Petr Merlin Vaněček

  • Moderátor
  • Závislák
  • ***
  • Příspěvků: 5057
    • Lomítkáři
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #6 kdy: 22 Listopadu 2016, 21:11:39 »
No vzhledem k aktuálnímu výpadku google, bych to nechal na zítra :)
Stiskni CTRL + W ...
80% mozku tvoří kapalina ... u některých brzdová

Kony.cz

  • Aktivní člen
  • *
  • Příspěvků: 289
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #7 kdy: 22 Listopadu 2016, 21:28:38 »
no zkousel jsem i vcera a taky nic.... takze uz vazne nevim

marshall1727

  • Aktivní člen
  • *
  • Příspěvků: 307
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #8 kdy: 18 Ledna 2017, 13:46:40 »
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)
--
koupil jsem si nový server a ladím ho. proto to zde spamuju. (2xXeon5110; IntelServerBoard S5000PSL; 2x2x1GbECC;4xRaptor150G)

Armus69

  • Aktivní člen
  • *
  • Příspěvků: 297
    • http://www.netlancers.cz
Re:Ubuntu - Postfix a relay na google.com
« Odpověď #9 kdy: 24 Ledna 2017, 18:06:21 »
určitě Vám google povolí relay domén co nemá v administraci? Spíše otázka, osobně bych o tom pochyboval.
jabber:  Armus69@jabber.cz

 

Provoz zaštiťuje spolek OpenAlt.