i need to send an email using post session command,
i used the below and it says it cant file the email id , can someone help me in figuring out where am i going wrong
uuencode $PMTargetFileDir/tgt_i914_carrier_amount_balancing.txt|$$EMAIL_IDS -m -s "Attached is the i914 report file generated while processing the ESI Weekly load" email#removed
Related
Iam looking to use this pkg to send emails in my django app:
https://github.com/sklarsa/django-sendgrid-v5
and I see the field: SENDGRID_ECHO_TO_STDOUT and the description says:
will echo to stdout or any other file-like object that is passed to the backend via the stream kwarg.
I literally do not get what this means. My understanding was that if I set this to True, the email WONT be delivered but will be saved as a file and will output 1 in the terminal ?
However when I see this:https://simpleit.rocks/python/django/adding-email-to-django-the-easiest-way/
I think the guy manages to send emails even when this flag is set to True? Is that correct?
Sorry if this is a daft quetsion - I just do not understand this flag.
Should the flag be set to True or False in production?
I am building a C++ application which purpose is, among other thing, to receive SNMP traps. For this I am using SNMP ++ library version V3.3 (https://agentpp.com/download.html C++ APIs SNMP++ 3.4.9).
I was expecting for traps using no authentication to be discarded/dropped if configuration was requesting some form of authentication but it does not seem to be the case.
To confirm this behavior I used the provided receive_trap example available in the consoleExamples directory. I commented every call to
usm->add_usm_user(...)
except for the one with "MD5" as security name :
usm->add_usm_user("MD5",
SNMP_AUTHPROTOCOL_HMACMD5, SNMP_PRIVPROTOCOL_NONE,
"MD5UserAuthPassword", "");
I then sent a trap (matching the "MD5" security name) to the application using net-snmp :
snmptrap -v 3 -e 0x090807060504030200 -u MD5 -Z 1,1 -l noAuthNoPriv localhost:10162 '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456
Since the application only registered User Security Model requires an MD5 password I would have though the trap would have been refused/dropped/discarded, but it was not :
Trying to register for traps on port 10162.
Waiting for traps/informs...
press return to stop
reason: -7
msg: SNMP++: Received SNMP Notification (trap or inform)
from: 127.0.0.1/45338
ID: 1.3.6.1.4.1.8072.2.3.0.1
Type:167
Oid: 1.3.6.1.4.1.8072.2.3.2.1
Val: 123456
To make sure there was no "default" UserSecurityModel used instead I then commented the remaining
usm->add_usm_user("MD5",
SNMP_AUTHPROTOCOL_HMACMD5, SNMP_PRIVPROTOCOL_NONE,
"MD5UserAuthPassword", "");
and sent my trap again using the same command. This time nothing happened :
Trying to register for traps on port 10162.
Waiting for traps/informs...
press return to stop
V3 is around 18k lines of RFC so it is completely possible I missed or misunderstood something but I would expect to be able to specify which security level I am expecting and drop everything which does not match. What am I missing ?
EDIT Additional testing with SNMPD
I have done some test with SNMPD and I somehow still get similar result.
I have created a user :
net-snmp-create-v3-user -ro -A STrP#SSWRD -a SHA -X STr0ngP#SSWRD -x AES snmpadmin
Then I am trying with authPriv key :
snmpwalk -v3 -a SHA -A STrP#SSWRD -x AES -X STr0ngP#SSWRD -l authPriv -u snmpadmin localhost
The request is accepted
with authNoPriv :
snmpwalk -v3 -a SHA -A STrP#SSWRD -x AES -l AuthNoPriv -u snmpadmin localhost
The request is accepted
with noAuthNoPriv :
snmpwalk -v3 -a SHA -A STrP#SSWRD -x AES -X STr0ngP#SSWR2D -l noauthnoPriv -u snmpadmin localhost
The request is rejected.
As I understand the authNoPriv must be rejected, but is accepted, this is incorrect from what I have read in the RFC and the cisco snmpv3 resume
Disclaimer I am not expert so take the following with a pinch of salt.
I cannot say for the library you are using but regarding the SNMP v3 flow:
In SNMPv3 exchanges, the USM is responsible for validation only on the SNMP authoritative engine side, the authoritative role depending of the kind of message.
Agent authoritative for : GET / SET / TRAP
Receiver authoritative for : INFORM
The RFC 3414 describes the reception of message in section 3.2 :
If the information about the user indicates that it does not
support the securityLevel requested by the caller, then the
usmStatsUnsupportedSecLevels counter is incremented and an error
indication (unsupportedSecurityLevel) together with the OID and value
of the incremented counter is returned to the calling module.
If the securityLevel specifies that the message is to be
authenticated, then the message is authenticated according to the
user’s authentication protocol. To do so a call is made to the
authentication module that implements the user’s authentication
protocol according to the abstract service primitive
So in the step 6, the securityLevel is the one from the message. This means the TRAP is accepted by the USM layer on the receiver side even if the authentication is not provided.
It is then the task of the user of the TRAP to decide if the message must be interpreted or not.
Edit: It seems that when sending via cron, sendmail isn't using the 'from' domain set in the config, and so the message is being rejected by SES as an unverified domain. So the question is now, why isn't sendmail using these settings in the config when running from cron?
This is a bigger issue than this question, but this part seems to sum it up completely.
I have a number of ec2 instances. These use sendmail to relay messages through SES.
There are a number of bash scripts on these servers that email reports when the script has completed.
If I manually run one of these scripts, the email successfully sends. However, if run by cron, I see "dsn=5.0.0, stat=Service unavailable" in the maillog.
Sendmail is accepting the message, but relaying it through SES generates this error.
I know the environment is different between cron and an interactive user, but I can't see how just a part of this sending process could fail in this case.
Any suggestions would be much appreciated. Please let me know if any more info would be helpful.
Thanks
I've been a reader for a while. Usually deal with stuff on my own but today I need a hint.
So I've been tasked to run an email campaign at my new job (100k audience) with minimal budget spent and very short notice (tomorrow). I leaned toward AWS (Amazon Web Services) because Amazon SES (Simple Email Service) is very cheap and you only pay what you use.
tried to use AWS SDK on command line. I made a tiny script to read the adresses file (.txt) line by line and execute a send mail command
#! /bin/bash
file='./test-list.txt'
from='sender#domain.com'
for line in $(<$file)
do
#send mail
aws ses send-templated-email --source=$from --destination=$line --template 'test' --template-data ""
done
Script returned the error message :
Error parsing parameter '--destination': Expected: '=', received: '#' for input:
To:recipient#domain.com
Now I'm not the bash king, but I've tried different parameter formulations and nothing got me rid of the error.
each line from the input file is a correct email address, and this looks like a parsing issue, but I don't get it.
any ideas ? It would help a ton :)
You need to use the correct format for destination from https://docs.aws.amazon.com/cli/latest/reference/ses/send-templated-email.html#options
Example using send-email:
aws ses send-email --from "example.com" --destination "ToAddresses=${line}" --text "hello world!" --subject "test"
Example like the one given:
aws ses send-templated-email --source $from --destination "ToAddresses=${line}" --template "test" --template-data ""
I ran into an issue where my mail server only accepts 100 connections to the server every 5 minutes. My current code loops over my database, calling cfmail for each person on the list. I suppose the problem is im opening a new connection each time I use cfmail?
<CFLOOP QUERY="Customer" >
<!---send mail to Admin ----->
<cfmail to = "#cstEmail#"
from = "#FORM.fromAddressEmail#"
subject = "#FORM.subjectEmail#"
server = "#var.mailserver#"
port= "#var.mailport#"
username="#var.mailuser#"
password="#var.mailpass#"
failto="#var.failEmail#
type="html"
>
What I ran into was only 100 mails were being sent at a time, the rest were sent to cf's undelivered folder. I would send them to spool and again 100 would get through..
Now, I've read in older versions of cf there is a checkbox in cf administrator to "maintain connection" -Im running cf9 and dont see this option.
Would using cfmail's query attribute, force cfmail to only connect to the mail server once to send all the emails?
<cfmail query="Customer"
from = "#FORM.fromAddressEmail#"
to = "#cstEmail#"
subject = "#FORM.subjectEmail#">
Im not even sure how to test this without sending a couple hundred emails. Any thoughts if this is a viable solution to the problem?
Thanks for your help!
Biscotti
I ended up compromising by using a scheduled task to move the files every 5 minutes back over to the Spool dir from the Undelivr dir. Im not thrilled with this solution, but it works.
Thanks to Russ's Respooler extension. http://cfrespooler.riaforge.org/
By using the above code to call the QUERY within CFMAIL I only succeeded in speeding up the client side process. The mail server still rejected the mail after the 100th connection - leading me to determine there is no server side benefit to this method over simply looping CFMAIL like in my first example. I seems the only answer is to run the code within the enterprise edition of the cf environment, one that has the "maintain connection" feature enabled.