wvdial NO CARRIER error - raspberry-pi

I've been trying to connect Huawei E3131 to my Raspberry pi.
So far I've installed ppp, usb_modeswitch and wvdial. Here is my wvdial.conf partially generated by wvdialconf and partially changed by myself:
[Dialer Defaults]
Modem = /dev/modem
Username = { }
Password = { }
Baud = 9600
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = ATX3
Carrier Check = no
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *+88690xxxxxxx#
New PPPD = yes
In the end the output I get looks like that:
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0
ATQ0 V1 E1 S0=0
OK
--> Sending: ATX3
ATX3
OK
--> Modem initialized.
--> Sending: ATDT*+88690xxxxxxx#
--> Waiting for carrier.
ATDT*+88690xxxxxxx#
NO CARRIER
--> No Carrier! Trying again.
--> Sending: ATDT*+88690xxxxxxx#
--> Waiting for carrier.
ATDT*+88690xxxxxxx#
NO CARRIER
--> No Carrier! Trying again.
The simcard in the dongle is from Chunghwa Telecom (Taiwan) if that is any help.

Ok, apparently you don't need to change the basic *99# to your phone number. So the final config file looks like
[Dialer Defaults]
Modem = /dev/modem
Username = { }
Password = { }
Baud = 9600
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = ATX3
Carrier Check = no
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
New PPPD = yes
run it with sudo for creation of ppp and everything works fine. Also you may run wvdialconf to generate the config file with suitable commands. However parameteres are not affected by it, except Baud. Hope someone will find it useful.

Related

trouble with EXIM passing e-mails

I am having trouble with EXIM passing e-mails. Domains are fictitious, but work better than using "example" to me.
Expected -> device -> relay#insurance.savewiththelizard.com -> payingtoomuch.com
Happening -> device -> relay#insurance.savewiththelizard.com -> vanishes
I found this Magento/exim emails not arriving, sent to and from own domain , but that nor the second answer has resolved my issue.
I have payingtoomuch.com e-mail hosted at GSuite. I have payingtoomuch.com website hosted at insurance.savewiththelizard.com .
When I use relay#insurance.savewiththelizard.com , it will pass to domains that are not hosted locally. Example: I am able to send an e-mail using relay#insurance.savewiththelizard.com to gmail.com, outlook.com, thiscompany.com, but I am not able to send e-mail to payingtoomuch.com . There are no errors when sending the e-mails.
On VestaCP, DNS nor MAIL are installed for payingtoomuch.com on insurance.savewiththelizard.com .
payingtoomuch.com
A = 33.33.33.1 [fictitious]
WWW = 33.33.33.1 [fictitious]
MX = aspmx.l.google.com
insurance.savewiththelizard.com SMTP
A = 33.33.33.1 [fictitious]
MX = 33.33.33.1 [fictitious]
2020-05-07 19:45:53 1jRwFF-0001mO-Ic <= relay#insurance.savewiththelizard.com H=(SERVER218) [X] P=esmtpsa X=TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256 CV=no A=dovecot_plain:relay#insurance.savewiththelizard.com S=28773
2020-05-07 19:45:54 1jRwFF-0001mO-Ic => doctor#payingtoomuch.com R=dnslookup T=remote_smtp H=aspmx.l.google.com [172.217.197.26] X=TLS1.2:ECDHE_ECDSA_AES_128_GCM_SHA256:128 CV=yes C="250 2.0.0 OK 1588898754 138si4849187qkm.228 - gsmtp"
2
2020-05-07 07:03:37 1Wfk3-0001eA-FF <= relay#insurance.savewiththelizard.com H=(EXTRA) [X] P=esmtpsa X=TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256 CV=no A=dovecot_plain:relay#insurance.savewiththelizard.com S=38927
2020-05-07 07:03:38 1Wfk3-0001eA-FF => accounting#payingtoomuch.com R=dnslookup T=remote_smtp H=aspmx.l.google.com [209.85.144.27] X=TLS1.2:ECDHE_ECDSA_AES_128_GCM_SHA256:128 CV=yes C="250 2.0.0 OK 1588853018 z5si2008827qtb.399 - gsmtp"
2020-05-07 07:03:38 1Wfk3-0001eA-FF Completed
2
The e-mails are not in Junk E-Mail, Spam, etc.
I thought one of these may solve the issue, but it has not.
routetotpay:
driver = manualroute
route_list = payingtoomuch.com
transport = remote_smtp
smart_route:
driver = manualroute
route_list = payingtoomuch.com
transport = remote_smtp
exim4.conf.template file
line:
domainlist local_domains = dsearch;/etc/exim4/domains/
convert to:
domainlist local_domains = !payingtoomuch.com : dsearch;/etc/exim4/domains/
restart exim:
service exim4 restart

Postfix Error Recipient address rejected: unverified address: mail transport unavailable when its With Ciphermail

i'm setting up a mail server [postfix] which with use Ciphermail as RelayHost.
With the setup i'm able to send mail to external domain but when i'm replying from external domain i'm getting following error.
ciphermail [relay host] main.cf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = djigzo:[127.0.0.1]:10025
djigzo_after_filter_message_size_limit = 512000000
djigzo_before_filter_message_size_limit = 10240000
djigzo_mailbox_size_limit = 512000000
djigzo_mydestination = localhost, svitsolutions.in, mx1.svitsolutions.in
djigzo_myhostname = mx1.svitsolutions.in
djigzo_mynetworks = 103.246.45.0/24, 192.168.15.0/24, 192.168.15.52/32
djigzo_parent_domain_matches_subdomains = relay_domains
djigzo_rbl_clients =
djigzo_reject_unverified_recipient = reject
djigzo_relay_domains = svitsolutions.in
djigzo_relay_transport_host = mail.svitsolutions.in
djigzo_relay_transport_host_mx_lookup =
djigzo_relay_transport_host_port = 25
djigzo_relayhost =
djigzo_relayhost_mx_lookup = mx
djigzo_relayhost_port = 25
djigzo_smtp_helo_name = mail.svitsolutions.in
djigzo_unverified_recipient_reject_code = 450
local_recipient_maps =
local_transport = $mydestination
mail_name = mx1.svitsolutions.in
mailbox_size_limit = ${djigzo_mailbox_size_limit}
message_size_limit = ${djigzo_after_filter_message_size_limit}
mydestination = ${djigzo_mydestination}, mail.svitsolutions.in, svitsolutions.in
myhostname = ${djigzo_myhostname}
mynetworks = 127.0.0.0/8, [::1]/128, ${djigzo_mynetworks}
parent_domain_matches_subdomains = ${djigzo_parent_domain_matches_subdomains}
queue_minfree = 768000000
recipient_delimiter = +
relay_domains = ${djigzo_relay_domains}
relay_transport = relay${djigzo_relay_transport_host?:${djigzo_relay_transport_host_mx_lookup:[}${djigzo_relay_transport_host}${djigzo_relay_transport_host_mx_lookup:]}:${djigzo_relay_transport_host_port}}
relayhost = ${djigzo_relayhost_mx_lookup:${djigzo_relayhost?[}}${djigzo_relayhost}${djigzo_relayhost_mx_lookup:${djigzo_relayhost?]}}${djigzo_relayhost?:${djigzo_relayhost_port}}
smtp_helo_name = ${djigzo_smtp_helo_name?$djigzo_smtp_helo_name}${djigzo_smtp_helo_name:${myhostname}}
smtpd_authorized_xforward_hosts = 127.0.0.1/32, 192.168.15.52/32
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_discard_ehlo_keywords = silent-discard, dsn, etrn
smtpd_etrn_restrictions = reject
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination ${djigzo_rbl_clients} ${djigzo_reject_unverified_recipient? reject_unverified_recipient}
unverified_recipient_reject_code = ${djigzo_unverified_recipient_reject_code}
When im removing the relay host [ciphermail] from architecture i'm able to receive mail from external domain.
please suggest the answer.
It looks like you have enabled "Reject unverified recipient". The 450 error message reports that the recipient address cannot be verified. The default Postfix configuration for CipherMail is that Postfix will function as a store and forward server and no local mailboxes. However you have configured mydestination (indirectly by setting djigzo_mydestination) to locally handle mail for svitsolutions.in but you also configured relay_domains (indirectly by setting djigzo_relay_domains) to svitsolutions.in.
With the current config, email sent to svitsolutions.in will be handled by the local transport (which will then store the email locally). However in the default Postfix master.cf config, the local transport is disabled because in the default config, email should not be locally stored. Because the local transport is not available, the recipient verification will fail.
If you want to store email locally you should re-enable the local transport (see main.cf and master.cf) and make sure that a local user is available. If you do not want to store mail locally on the system but only act as a relaying server, set djigzo_mydestination and mydestination to an empty value.

Sniffing client to server socket communication

I was developing an IoT application with a BBB and a Quectel GSM modem to send data over internet.
I configured the modem on the debian OS with PPP. Then with something similar to this example I stablished communication between my server and my client. Data was trivial, I send just a simple "Close!", and receive a simple "OK!". Sniffing the serial port, I was expecting something simpler, but here is what I saw:
BBB >> GSM modem
ATZ
ATQ0 V1 E1 S0=0 &C1 &D2
AT+CGDCONT=1,"IP","internet.comcel.com.co"
ATD*99***1#
~}#!}!}!} }4}"}&} } } } }%}&"}'}"}(}"0~~}#!}!}"} }4}"}&} }*} } }%}&"}'}"}(}"}>~~}#!}$}!} }(}#}$#,~~}#!}"}"} }.}"}&} }*} } }'}"}(}"P~! "?~xx/2~!-/~!
!~!
j~!
_3~~!E<##_
_-7`99
}3BT~~!E<##^
_-7`99
}3D~!E4##e
_-7`:l5s
}3FGcE~!E:##^
_-7`:l5d
}3FGcEClose!=~~!E4##c
_-7`#l5
}3HcEh$~!E4##b
_-7`#l5
}3HcE~!E4##a
_-7`#l8
}3IycG~!E4##`
_-7`#l8}1
}3Iyc~!E4##_
_-7`Al9
}3I|c%~~!E4##^
_-7`#l9}1
}3Sc
!~~! "=~~!E4##\
_-7`#l9}1
}3cws~
Modem >> BBB
+CFUN: 1
+CPIN: READY
ATZ
OK
ATQ0 V1 E1 S0=0 &C1 &D2
OK
AT+CGDCONT=1,"IP","internet.comcel.com.co"
OK
ATD*99***1#
CONNECT
~}#!}!}!} }2}"}&} }*} } }#}$#}'}"}(}"U~~}#!}#}!} }*}"}&} }*} } lP~~}#!}"}"} }4}"}&} }*} } }%}&gHT}'}"}(}"Q~~}#!}!}!} }2}"}&} }*} } }#}$#}'}"}(}"U~~}#!}!}"} }.}"}&} }*} } }'}"}(}"~~!
H~~!
k~~!xx/~~!
-0~~!
xP`~~!
xP~~!E<#1-7
xPyCdOq x
d/2mQ~~!E<#1-7
xPyCdOq _x
d0N2~~!E4"#1Bw-7
xPzCdUrN
d0ev ~~!E7##1Bs-7
xPzCdUrd
d0eOK!3~~!E4$#1Bu-7
xP}]CdU}1rN
d0e~
I'm familiar with those AT commands, the "Close!" is there, and on the other side the "OK! is there too, but I didn't expect all those strange characters. I must say that I'm not very familiar with low level development for the TCP/IP network model, but I've always thought that sockets communication was the lowest layer (not counting physical layers).
What am I missing and where can I find more info related to this topic?
Thank you.

Docker + Exim + Dovecot. Relay not permitted

Trying to configure Exim mail server using this article. I can use this server inside my local network but when I try to use it from internet I taking some errors. Ports 10000-20000 translate to server machine. Everything I doing inside the docker image of CentOS 7. Host machine with CentOS 7 too.
Abbreviations:
test_domain.tk - my test domain
test1, test2 - test users
test#external.com - test external email
123.456.789.876 - my external ip (I have router with NAT)
10.0.7.30 - docker's tunnel
Starting docker with command: docker run -d --name mail -h test_domain.tk -p 10025:25 -p 10587:587 -p 10465:465 -p 10143:143 -p 10993:993 mail/server:localwork start_server
start_server:
#!/bin/bash -e
/usr/sbin/dovecot && /usr/sbin/exim -v -bdf -q30m
/etc/exim/exim.conf:
primary_hostname = test_domain.tk
domainlist local_domains = # : localhost : test_domain.tk
domainlist relay_to_domains =
hostlist relay_from_hosts =
acl_smtp_mail = acl_check_mail
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_mime = acl_check_mime
av_scanner = clamd:/var/run/clamd.exim/clamd.sock
tls_advertise_hosts = *
tls_certificate = /etc/ssl/default.crt
tls_privatekey = /etc/ssl/default.key
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465
allow_domain_literals
never_users = root
auth_advertise_hosts = *
rfc1413_hosts = *
rfc1413_query_timeout = 5s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d
begin acl
acl_check_mail:
deny condition = ${if eq{$sender_helo_name}{} {1}}
message = Nice boys say HELO first
warn condition = ${if eq{$sender_host_name}{} {1}}
set acl_m_greylistreasons = Host $sender_host_address lacks reverse DNS\n$acl_m_greylistreasons
accept
acl_check_rcpt:
accept hosts = :
control = dkim_disable_verify
deny message = Restricted characters in address
domains = +local_domains
local_parts = ^[.] : ^.*[#%!/|]
deny message = Restricted characters in address
domains = !+local_domains
local_parts = ^[./|] : ^.*[#%!] : ^.*/\\.\\./
accept local_parts = postmaster
domains = +local_domains
require verify = sender
accept hosts = +relay_from_hosts
control = submission
control = dkim_disable_verify
accept authenticated = *
control = submission
control = dkim_disable_verify
require message = relay not permitted
domains = +local_domains : +relay_to_domains
require verify = recipient
accept
acl_check_data:
warn condition = ${if !def:h_Message-ID: {1}}
set acl_m_greylistreasons = Message lacks Message-Id: header. Consult RFC2822.\n$acl_m_greylistreasons
accept
acl_check_mime:
deny message = Blacklisted file extension detected
condition = ${if match \
{${lc:$mime_filename}} \
{\N(\.exe|\.pif|\.bat|\.scr|\.lnk|\.com)$\N} \
{1}{0}}
accept
begin routers
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
# if ipv6-enabled then instead use:
# ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
no_more
system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
# user = exim
file_transport = address_file
pipe_transport = address_pipe
userforward:
driver = redirect
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
file = $home/.forward
allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
procmail:
driver = accept
check_local_user
require_files = ${local_part}:+${home}/.procmailrc:/usr/bin/procmail
transport = procmail
no_verify
localuser:
driver = accept
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
transport = local_delivery
cannot_route_message = Unknown user
begin transports
remote_smtp:
driver = smtp
remote_msa:
driver = smtp
port = 587
hosts_require_auth = *
procmail:
driver = pipe
command = "/usr/bin/procmail -d $local_part"
return_path_add
delivery_date_add
envelope_to_add
user = $local_part
initgroups
return_output
local_delivery:
driver = appendfile
directory = $home/Maildir
maildir_format
maildir_use_size_file
delivery_date_add
envelope_to_add
return_path_add
address_pipe:
driver = pipe
return_output
address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
address_reply:
driver = autoreply
begin retry
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
begin rewrite
begin authenticators
dovecot_login:
driver = dovecot
public_name = LOGIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
dovecot_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
exim log:
8 LOG: MAIN
8 exim 4.84 daemon started: pid=8, -q30m, listening for SMTP on port 25 (IPv6 and IPv4) port 587 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)
16 LOG: host_lookup_failed MAIN
16 no host name found for IP address 123.456.789.876
16 LOG: MAIN REJECT
16 H=([10.0.7.30]) [123.456.789.876] X=SSLv3:DHE-RSA-AES128-SHA:128 F=<test1#test_domain.tk> rejected RCPT <test#external.com>: relay not permitted
16 LOG: lost_incoming_connection MAIN
16 unexpected disconnection while reading SMTP command from ([10.0.7.30]) [123.456.789.876]
When I try to connect from internet I got timeout error in mail client and empty logs in Exim. It's probably problem of work with router. How to make it works?
Ask me if you need more data. Thanks in advance.
You have your docker internal ports (for example 10025) mapped to standard smtp ports (for example 25), but you have exim listening on the standard ports instead of the mapped internal ports. Configure exim to listen on 10025, 10465, 10587 and see if the behavior changes.
It seems there's an issue with reverse DNS lookup according to this ancient post. Try disabling host_lookup and see if that works:
host_lookup = 0.0.0.0/0
If it does you'll have to fix your DNS settings to map the right domain to your host.

Postfix, Centos, DoveCot, Google Mail Relay

im setting up a Postfix/Dovecot mailserver on CENTOS, i came send and recieve emails fine using webmail, i can also pull emails from the server using googles settings no problem, however when i attempt to send email from google using the email address from the mailserver not my gmail i get a 554 relay access denied error
output of postconf -n
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
disable_vrfy_command = yes
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
local_recipient_maps =
mailbox_size_limit = 0
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination = $mydomain
myhostname = mail.mainewarmers.com
mynetworks = 127.0.0.0/8, <site IP>, [::1]/128, 209.85.216.43
mynetworks_style = host
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
smtp_helo_timeout = 60s
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client
blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 450
virtual_alias_maps = hash:/etc/postfix/virtual\
telnet to port 25 works just fine, as does
openssl s_client -connect mail.mainewarmers.com:25 -starttls smtp
however, whenever i attempt to send an email to an external email address using my google account
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the relay mail.mainewarmers.com by mail.mainewarmers.com. [54.164.102.132].
The error that the other server returned was:
554 5.7.1 : Relay access denied
maillog gives me this
Nov 7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: NOQUEUE: reject: RCPT from mail-qg0-f43.google.com[209.85.192.43]: 554 5.7.1 <a#mail>: Relay access denied; from=<bhanscom#mainewarmers.$
Nov 7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: disconnect from mail-qg0-f43.google.com[209.85.192.43]
i have gone over my postconf and setup for the last 5 hours, i dont see anything wrong can someone point me in the correct direction? thanks a bunch!
fixed it,
used dig and ns to find the ips google uses to send mai, added those to mynetworks.
works like a charm finally after all day