I am getting an error when testing sendgrid in command shell…
server3 postfix/trivial-rewrite[15407]: warning: hash:/etc/postfix/relayhost_map lookup error for “user@server3..com.au”
server3 postfix/trivial-rewrite[15407]: warning: sender_dependent_relayhost_maps lookup failure
server3 postfix/error[17434]: B62708488F: to=recipient@gmail.com, relay=none, delay=0.24, delays=0.2/0.02/0/0.02, dsn=4.3.0, status=deferred (address resolver failure)
Now if i look at this and try to apply some logic to it, i believe that the problem is there is no relayhost_map for my user@server3..com.au
?
The thing is, is the relay map missing for the server, or for the user? I seem to get the same error no matter which user i am testing with (i have tried 3 of them that are active)
So in virtualmin, how do i create a relayhost_map and what information is needed in such a map?
I have tried to perform the test email via sendgrid using both my root and google cloud users…both result in the same error (with different usernames obvously).
see my /etc/postfix/main.cf below…
# 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
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.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = server3..com.au
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server3..com.au, localhost..com.au, , localhost
mynetworks = 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
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_map
smtp_sender_dependent_authentication = yes
relayhost = [smtp.sendgrid.net]:2525
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
header_size_limit = 4096000
smtp_sasl_security_options = noanonymous