Score:0

Postfix won't connect to relay SMTP server

pe flag

We have a Debian virtual machine and I want to use postfix and mailutils to send email via a relay SMTP server

Trying to connect to the SMTP server with telnet works.

telnet mail.sch.gr 587
Trying 194.63.239.110...
Connected to mail.sch.gr.
Escape character is '^]'.
220 mail26.sch.gr ESMTP Postfix (Debian/GNU)
AUTH LOGIN
334 VXNlcm5hbWU6
*************
334 UGFzc3dvcmQ6
*************
235 2.7.0 Authentication successful

However, if I try to send an email, the email isn't sent, the mail.log says

(SASL authentication failed; server mail.sch.gr[194.63.239.110] said: 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6)

my main.cf is this:

# 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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

relayhost=[mail.sch.gr]:587
smtp_sasl_mechanism_filter = login
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls=yes

inet_protocols = ipv4

the sasl_passwd is like this:

[mail.sch.gr]:587 [email protected]:password

(obviously user and password are replaced with the actual username and password)

I don't know how to proceed...

Gerrit avatar
cn flag
Any warnings in the /var/log/mail.log? Did you use postmap hash:/etc/postfix/sasl_passwd. Also try mail.sch.gr without the brackets in the sasl_passwd file.
in flag
Did you create a db file from the `sasl_passwd` with the `postmap hash:sasl_passwd` command?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.