How do I send sms to a specific SMSC? - kannel

On one server I have setup kannel with opensmppbox and everything works. On another server I have configred a SMSC for the opensmppbox and also a fake smsc. When I try and send message to opensmppbox (curl "http://localhost:13013/cgi-bin/sendsms?smsc=opensmppbox1&username=simple&password=simple123&from=100&to=2121&text=tere") message is sent but it is sent to the fake smsc not the opensmppbox smsc.
If I had to guess my config is flawed but because my experience with kannel is very limited I can't figure out what's wrong.
Here's the config:
group = core
admin-port = 13000
admin-password = test
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "127.0.0.1"
smsbox-port = 13001
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
dlr-storage = internal
log-file = "/var/log/kannel/mingiinfo.log"
log-level = 0
group = smsbox
smsbox-id = mysmsbox
bearerbox-host = localhost
sendsms-port = 13013
log-file = "/var/log/kannel/mingi2info.log"
log-level = 0
group = sendsms-user
username = simple
password = simple123
group = smsc
smsc = fake
smsc-id = FAKE
port = 10000
log-level = 0
group = smsc
smsc = smpp
smsc-id = opensmppbox1
allowed-prefix = "00"
host = test.server.com
port = 2346
smsc-username = "test"
smsc-password = testpw
system-type = "mysmsbox"
dest-addr-ton = 1
dest-addr-npi = 1
source-addr-ton = 5
source-addr-npi = 1
keepalive = 30
log-file = "/var/log/kannel/smsc_server2.log"
log-level = 0
interface-version = 34
validityperiod = 720
transceiver-mode = true
unified-prefix = "-,00"
group = smsbox-route
smsbox-id = mysmsbox
smsc-id = opensmppbox1
group = sms-service
keyword = default
text = "hi how are you"
accepted-smsc = opensmppbox1
So my question is what do I have to change/fix in order to send a message to my opensmppbox that's running on the other server?

TO force SMSC just add it to your URL API like &smsc=opensmppbox1
Check below link for your case
curl "http://localhost:13013/cgi-bin/sendsms?smsc=opensmppbox1&username=simple&password=simple123&from=100&to=2121&text=tere&smsc=opensmppbox1"

Related

Persisting all the samples into InfluxDB with JMeter-InfluxDB-Writer 1.1

I have setup Jmeter with InfluxDB and Grafana, and adding "JMeter-InfluxDB-Writer 1.1" as mentioned in the documentation link "https://grafana.net/dashboards/1152".
With this, I am seeing some of the samples are missing (shows 8/10 samples for some of the api's) when queried in the InfluxDB although Jmeter Summary report shows 10/10 samples run for all the api's.
Also attaching my infuxDB.conf for any inputs. Please help
infuxDB.conf -
reporting-disabled = false
bind-address = ":8088"
[meta]
dir = "C:\\Users\\Administrator\\.influxdb\\meta"
retention-autocreate = true
logging-enabled = true
[data]
dir = "C:\\Users\\Administrator\\.influxdb\\data"
wal-dir = "C:\\Users\\Administrator\\.influxdb\\wal"
query-log-enabled = true
cache-max-memory-size = 1073741824
cache-snapshot-memory-size = 26214400
cache-snapshot-write-cold-duration = "10m0s"
compact-full-write-cold-duration = "4h0m0s"
max-series-per-database = 1000000
max-values-per-tag = 100000
trace-logging-enabled = false
[coordinator]
write-timeout = "10s"
max-concurrent-queries = 0
query-timeout = "0s"
log-queries-after = "0s"
max-select-point = 0
max-select-series = 0
max-select-buckets = 0
[retention]
enabled = true
check-interval = "30m0s"
[shard-precreation]
enabled = true
check-interval = "10m0s"
advance-period = "30m0s"
[admin]
enabled = true
bind-address = ":8083"
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
[monitor]
store-enabled = true
store-database = "_internal"
store-interval = "10s"
[subscriber]
enabled = true
http-timeout = "60s"
insecure-skip-verify = false
ca-certs = ""
write-concurrency = 40
write-buffer-size = 1000
[http]
enabled = true
bind-address = ":443"
auth-enabled = false
log-enabled = true
write-tracing = false
pprof-enabled = true
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
https-private-key = ""
max-row-limit = 10000
max-connection-limit = 0
shared-secret = ""
realm = "InfluxDB"
unix-socket-enabled = false
bind-socket = "/var/run/influxdb.sock"
[[graphite]]
enabled = true
bind-address = ":2003"
database = "jmeter"
retention-policy = ""
protocol = "tcp"
batch-size = 5000
batch-pending = 100
batch-timeout = "60s"
consistency-level = "one"
separator = "."
udp-read-buffer = 0
[[collectd]]
enabled = false
bind-address = ":25826"
database = "collectd"
retention-policy = ""
batch-size = 5000
batch-pending = 10
batch-timeout = "10s"
read-buffer = 0
typesdb = "/usr/share/collectd/types.db"
security-level = "none"
auth-file = "/etc/collectd/auth_file"
[[opentsdb]]
enabled = false
bind-address = ":4242"
database = "opentsdb"
retention-policy = ""
consistency-level = "one"
tls-enabled = false
certificate = "/etc/ssl/influxdb.pem"
batch-size = 1000
batch-pending = 5
batch-timeout = "1s"
log-point-errors = truea
[[udp]]
enabled = false
bind-address = ":8089"
database = "udp"
retention-policy = ""
batch-size = 5000
batch-pending = 10
read-buffer = 0
batch-timeout = "1s"
precision = ""
[continuous_queries]
log-enabled = true
enabled = true
run-interval = "1s"
It seems there is a pagination and its probably set up to show only 8 lines in a page. The other two sample data could be in the page 2.

Can not send mail using smtp.gmail.com, port 587 from vbs script

I am trying to send a mail using a vbs script but it doesn't work. I am using server smtp.gmail.com and port 587. The weir thing is that this works when I change the port to 25. Below is the code I am using:
SMTPMail "to", "cc", "TEST", "TEST"
Function SMTPMail(ByVal sTo, ByVal sCc, ByVal sSubject, ByVal sBody)
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Dim objMessage
set objMessage = CreateObject("CDO.Message")
objMessage.Subject = sSubject
objMessage.Sender = "sender"
objMessage.From = "from"
objMessage.To = sTo
objMessage.CC = sCc
objMessage.TextBody = sBody
'==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
'Your password on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update()
objMessage.Send()
End Function
Thank you in advance.
Gmail users can access their account on the official website or by using first-party or third-party apps and services instead. A first party app is for instance Google's official Gmail app for Android, while Thunderbird and the mail client app of Windows 8 are third-party apps.
Google announced back in April 2014 that it would improve the sign-in security of its services and affect any application sending usernames and passwords to the company.
The company suggested to switch to OAuth 2.0 back then but did not enforce it up until now.
If you open the new less secure apps page under security settings on Google, you will notice that Google has disabled access by default.
Note: You see the page only if you are not using Google Apps or have enabled two-factor authentication for the account.
You can flip the switch here to enable less secure applications again so that access is regained.
Another thing the port used is 465 and not 587
So you can try out this vbscript that works for me using the port 465
EmailSubject = "Sending Email by CDO"
EmailBody = "This is the body of a message sent via" & vbCRLF & _
"a CDO.Message object using SMTP authentication ,with port 465."
Const EmailFrom = "self#gmail.com"
Const EmailFromName = "My Very Own Name"
Const EmailTo = "someone#destination.com"
Const SMTPServer = "smtp.gmail.com"
Const SMTPLogon = "self#gmail.com"
Const SMTPPassword = "gMaIlPaSsWoRd"
Const SMTPSSL = True
Const SMTPPort = 465
Const cdoSendUsingPickup = 1 'Send message using local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using SMTP over TCP/IP networking.
Const cdoAnonymous = 0 ' No authentication
Const cdoBasic = 1 ' BASIC clear text authentication
Const cdoNTLM = 2 ' NTLM, Microsoft proprietary authentication
' First, create the message
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = EmailSubject
objMessage.From = """" & EmailFromName & """ <" & EmailFrom & ">"
objMessage.To = EmailTo
objMessage.TextBody = EmailBody
' Second, configure the server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPLogon
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'Now send the message!
On Error Resume Next
objMessage.Send
If Err.Number <> 0 Then
MsgBox Err.Description,16,"Error Sending Mail"
Else
MsgBox "Mail was successfully sent !",64,"Information"
End If

Using CDO.Message in VBscript - can't send binary attachment

Sending an email with a text file attached, this works (test email is received):
Set emailObj = CreateObject("CDO.Message")
emailObj.From = "sender#domain.tld"
emailObj.To = "recipient#domain.tld"
emailObj.Subject = "File attached"
emailObj.TextBody = "Please have a look at the attached file. Thanks."
emailObj.AddAttachment "d:\temp\test.txt"
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server.webhost.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sender#domain.tld"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "top_secret"
emailConfig.Fields.Update
emailObj.Send
If err.number = 0 then Msgbox "Your file has been sent. Someone will respond as soon as possible."
But when I try to send a binary file, this does NOT work (test email message is not received):
Set emailObj = CreateObject("CDO.Message")
emailObj.From = "sender#domain.tld"
emailObj.To = "recipient#domain.tld"
emailObj.Subject = "File attached"
emailObj.TextBody = "Please have a look at the attached file. Thanks."
emailObj.AddAttachment "d:\temp\test.rtf"
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "server.webhost.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sender#domain.tld"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "top_secret"
emailConfig.Fields.Update
emailObj.Send
If err.number = 0 then Msgbox "Your file has been sent. Someone will respond as soon as possible."
What do I need to add/change to be able to attach a binary file?

Configurating the postfix on mavericks mac os doesnt work

In the last month I tried to get my Mac to send e-mails. I did everything but at the end when I send the email through the terminal I don't receive it in my Gmail account. Also tried it with gmx but no luck either. Please any tips
Output of postconf -n
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
dovecot_destination_recipient_limit = 1
html_directory = /usr/share/doc/postfix/html
imap_submit_cred_file = –
inet_interfaces = loopback-only
inet_protocols = all
mail_owner = _postfix
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 10485760
mydomain_fallback = localhost
mynetworks = 127.0.0.0/8, [::1]/128
newaliases_path = /usr/bin/newaliases
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost = [smtp.gmx.com]:25
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = _postdrop
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_tls_loglevel = 1
smtp_tls_security_level = encrypt
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated permit
smtpd_tls_ciphers = medium
smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

Set the webclient hostname in openerp 6.1 all in one Win7 installation

System:
Win7 Home,
Open ERP 6.1 all in one
How to set the integrated Webclient Hostname from localhost:8069 to 127.0.0.1:8069 ?
I need to access the machine for development purposes from the internet.
In Version 6.0 I could find the hostname parameter for the webclient in the file openerp-web.cfg.
But in Version 6.1 the webclient is embed in the core and there is no openerp-web.cfg.
openerp-server.conf
[options]
without_demo = False
smtp_port = 25
db_template = template0
db_password = XXXXXX
xmlrpcs = True
xmlrpcs_interface =
syslog = False
logrotate = True
xmlrpcs_port = 8071
test_report_directory = False
list_db = True
timezone = False
xmlrpc_interface =
test_file = False
cache_timeout = 100000
smtp_password = False
secure_pkey_file = server.pkey
xmlrpc_port = 8069
log_level = info
xmlrpc = True
test_disable = False
admin_passwd = XXXXX
assert_exit_level = error
smtp_server = localhost
static_http_url_prefix = None
unaccent = False
test_commit = False
proxy_mode = False
demo = {}
db_host = localhost
login_message = False
import_partial =
pidfile = False
db_maxconn = 64
osv_memory_count_limit = False
reportgz = False
osv_memory_age_limit = 1.0
netrpc_port = 8070
db_port = 5432
virtual_memory_reset = 671088640
db_name = False
debug_mode = False
netrpc = True
secure_cert_file = server.cert
logfile = C:\Program Files (x86)\OpenERP 6.1-1\server\openerp-server.log
csv_internal_sep = ,
virtual_memory_limit = 805306368
pg_path = C:\Program Files (x86)\OpenERP 6.1-1\PostgreSQL\bin
static_http_enable = False
cpu_time_limit = 60
translate_modules = ['all']
smtp_ssl = False
server_wide_modules = None
netrpc_interface =
smtp_user = False
log_handler = [':INFO']
db_user = XXXXX
dbfilter = .*
max_cron_threads = 4
email_from = False
addons_path = C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons
static_http_document_root = None
xmlrpc_interface = my_ip
xmlrpc_port = my_port
no need to change anything on openerp :
1- create a dyndns account ( i use no-ip.com) ,if ur router is configurable to use dynamic dns then ok,else u need to install a client for that on the machine that hosts openerp.
once is that done, u can connect to http://xxx.np-ip.org:8069

Resources