I already setup a PPP connection using a modem with SIM868 chipset following the description I found in this link How to access the Internet using GSM / GPRS Modem, to send emails by modem.
Everything works ok , I senr an email using Sendmail and it looks Ok. The problem start when I used the command sudo rfkill block wifi
to disable WIFI and to try on PPP alone. When I tried to send an email I got in /var/log/postfix/mail.log status=deferred and the email doesn't go through. I found a workaround that it is to restart the postfix service and then restart the PPP (using sudo pon rnet
) too, but now every time I switch between PPP and WIFI I have to restart postfix and PPP.
Someone knows what happened? or know a more elegant solution instead of restart both.
Follow my postfix configuration file and the extract of
# 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 (Raspbian)
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 = rpipump.dnsalias.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, xxxxxx.dnsalias.com, raspberrypi, localhost.localdomain, localhost
relayhost = [smtp.gmail.com]:587
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 = ipv4
# Enable authentication using SASL.
smtp_sasl_auth_enable = yes
# Use transport layer security (TLS) encryption.
smtp_tls_security_level = encrypt
# Do not allow anonymous authentication.
smtp_sasl_security_options = noanonymous
# Specify where to find the login information.
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Where to find the certificate authority (CA) certificates.
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
/var/log/mail.log
Jan 29 14:57:18 raspberrypi3 postfix/smtpd[4472]: connect from localhost[127.0.0.1]
Jan 29 14:57:18 raspberrypi3 postfix/smtpd[4472]: B557060047: client=localhost[127.0.0.1]
Jan 29 14:57:18 raspberrypi3 postfix/cleanup[4475]: B557060047: message-id=<[email protected]>
Jan 29 14:57:18 raspberrypi3 postfix/smtpd[4472]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jan 29 14:57:18 raspberrypi3 postfix/qmgr[732]: B557060047: from=<[email protected]>, size=491, nrcpt=1 (queue active)
Jan 29 14:57:18 raspberrypi3 postfix/smtp[4476]: B557060047: to=<[email protected]>, relay=none, delay=0.12, delays=0.05/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service err$