I would like to send mail from my debian box to my personal gmail account.
When I try to send emails, I receive an error from Google. This is what I can read in /var/log/exim4/mainlog
:
2023-04-13 21:31:41 1pn2fV-0032Fu-IA <= [email protected] U=roberto P=local S=409
2023-04-13 21:31:41 1pn2fV-0032Fu-IA H=gmail-smtp-in.l.google.com [2a00:1450:4013:c03::1a] Network is unreachable
2023-04-13 21:31:42 1pn2fV-0032Fu-IA ** [email protected] R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [108.177.126.27] X=TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256 CV=yes DN="CN=mx.google.com": SMTP error from remote mail server after pipelined end of data: 550-5.7.26 This mail is unauthenticated, which poses a security risk to the\n550-5.7.26 sender and Gmail users, and has been blocked. The sender must\n550-5.7.26 authenticate with at least one of SPF or DKIM. For this message,\n550-5.7.26 DKIM checks did not pass and SPF check for [pioneer.zar.it] did not\n550-5.7.26 pass with ip: [79.20.203.164]. The sender should visit\n550-5.7.26 https://support.google.com/mail/answer/81126#authentication for\n550 5.7.26 instructions on setting up authentication. p5-20020aa7d305000000b005066ca2f63fsi2195148edq.197 - gsmtp
2023-04-13 21:31:42 1pn2fW-0032Fy-P6 <= <> R=1pn2fV-0032Fu-IA U=Debian-exim P=local S=2980
2023-04-13 21:31:42 1pn2fV-0032Fu-IA Completed
2023-04-13 21:31:42 1pn2fW-0032Fy-P6 => roberto <[email protected]> R=local_user T=mail_spool
2023-04-13 21:31:42 1pn2fW-0032Fy-P6 Completed
The "pioneer.zar.it" domain is a local unregistered domain. How can I set SPF or DKIM if that domain doesn't exist?
My OS is Debian 11, and my update-exim4.conf.conf
is:
dc_eximconfig_configtype='internet'
dc_other_hostnames='pioneer.zar.it'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
[edit] Thanks to @user1686, I found a solution: my system is sending mail as a smarthost, so I changed the first line in update-exim4.conf.conf
as follows:
dc_eximconfig_configtype='smarthost'
Besides, I don't own the zar.it
domain (I used it because I thought that it wasn't registered), so I changed the second line as follows:
dc_other_hostnames=''
And now I am able to send emails.