How to get pony to set proper envelope sender? - ruby

I'm using Ruby with Pony to send email. I can't seem to get the envelope sender to be changed to what I want; something in Pony or the code underneath it always substitutes the user_name parameter.
Any suggestions for this? I can get a text name like "Network Ops" in front of the email address by using the header parameter, but the actual email address is still incorrect.
Any suggestions?

Never mind -- it is the Gmail SMTP daemon rewriting the sender envelope. I tested against another (Qmail) server and this didn't happen.
Pony is great!

Related

Set email BCC with CURL [duplicate]

I've had this noted down on some of my code for a while:
/**
* Add a BCC.
*
* Note that according to the conventions of the SMTP protocol all
* addresses, including BCC addresses, are included in every email as it
* is sent over the Internet. The BCC addresses are stripped off blind
* copy email only at the destination email server.
*
* #param string $email
* #param string $name
* #return object Email
*/
I don't remember where I got it from (possible source) but that shouldn't be relevant to this question. Basically, whenever I try to send an email with BCCs via SMTP the BCC addresses are not hidden - I've read the whole RFC for the SMTP protocol (a couple years ago) and I don't think I'm missing anything.
The strange thing is, if I send an email with BCCs using the built-in mail() function everything works just right and I've no idea why - I would like to roll my own email sender but I fail to understand this.
Can someone please shed some light into this dark subject?
The BCC addresses are not stripped off at the destination email server. That's not how it works.
How SMTP actually works
The sender will send a list of RCPT TO commands to the SMTP server, one for each receiver email addresses, and this command does not distinguish whether the receiver is a normal To, CC or BCC type receiver.
Soon enough after calling the command that tells the SMTP server who's the sender, who's the server, and everything else, only then the sender will call the DATA command, in which will contain the content of the email - which consist of the email headers and body - the one that are received by email clients. Among these email headers are the usual from address, to address, CC address.
The BCC address is not shown to the receiver, simply because it's not printed out under the DATA command, not because the destination SMTP server stripped them away. The destination SMTP server will just refer to the RCPT TO for the list of email addresses that should receive the email content. It does not really care whether the receiver is in the To, CC or BCC list.
Update (to clarify): BCC email addresses must be listed in the RCPT TO command list, but the BCC header should not be printed under the DATA command.
Quoting a part of the RFC that I think is relevant to your case:
Please note that the mail data includes the memo header items such as Date, Subject, To, Cc, From [2].
Rolling out your own email sender
A couple of years ago, I frankly think, is quite a long time back to assume that you still memorize end-to-end of RFC 821. :)
Very late, but the accepted answer is essentially wrong.
First off, SMTP has nothing to do with BCC. SMTP, as a protocol, is concerned only with a return path (the MAIL request), a list of recipients (the RCPT request), and the data to be transferred (the DATA request). If you want to send an email to somebody via SMTP, then you have to supply their address in a RCPT request, period.
The contents of an email - the DATA, effectively - are specified completely separately, in RFC2822. There's a lot of latitude in how BCC should be handled. The spec gives 3 ways of handling BCC, and in only one of them is the BCC stripped out while preparing the email. If I use Thunderbird as an email client, for example, and point it to an SMTP server, and then look at the message on the line, then I find that the Thunderbird BCC has gone (from the SMTP DATA), and the SMTP connection instead contains a standard RCPT request for the bcc'ed address. So, Thunderbird converts BCC to RCPT, but that's not the only way to do it.
Another place to handle BCC is at the MTA - in other words, whatever SMTP server your mail client is pointed to. Sendmail, for example, searches all of the To, Cc, and Bcc lines in the SMTP DATA, and then constructs an address list from those lines, and then removes the Bcc line. You can persuade Sendmail to keep the Bcc if you want to. If sendmail isn't the destination MTA, then it will connect to another MTA over SMTP, and send the recipient addresses via RCPT. In other words, if sendmail is the destination MTA, and it gets a Bcc, it will strip it out, contrary to Amry's statement.
There's also some confusion in the comments. You can specify RCPT addresses to any domain, not just a list of addresses in the same domain. The MTA has to look up the MX records for the destination domains to work out where to send everything. The google.com and yahoo.com statements are wrong.

Customize OSB Mail alert body content

I am using Mail as alert-destination in OSB. From proxy service I am calling the alert destination and mail is being sent successfully.
However, the mail content is showing the details of service, destination, timestamp, server name etc details.
I just want to have the payload information in the mail body.
Is therey any way to customize the mail body when adding alert action in a proxy service?
Thanks in advance
The Alert action is very basic, and the email destination isn't really designed to be consumed by humans directly.
You're probably better off alerting to a JMS destination, then dequeuing it using a proxy to transform it into exactly what you want, then route to an SMTP Messaging business service to deliver the email (presumably formatted in HTML).

Error when I send email SparkPost

First the "email send" works fine but now It doesn't work anymore and when I print the error this is the text:
ERRORE {"name":"SparkPostError","errors":[{"message":"Message generation rejected","description":"Exceed Sending Limit (sandbox)","code":"1902"}],"statusCode":400}
Anyone can explein me how I'm wroing?
This error says that you have reached the limit of messages sent from sparkpostbox.com and now must register your own sending domain. You can read about how to do that here.
Each new SparkPost account may send a fixed number of messages addressed 'From:' sparkpostbox.com. After that, the idea is that you register your own sending domain and send from that instead.
The sandbox options allows you to send using the #sparkpostbox.com domain. It is currently limited to 50 sends for the lifetime of the account. At this time you should have a verified sending domain to use going forward. If you are looking for information on testing using SparkPost, take a look at this support document: https://support.sparkpost.com/customer/portal/articles/2361300
Source of the answer for your question is there: Error "Fatal SparkPostError: Exceed Sending Limit" when sandbox=true

What can I use as a blank Request URL for Sms?

In order for a number to receive Sms messages, it appears I must enter a value for the Request URL associated with the number. However I do not need to notified of messages in a callback. I'm wondering what value I can put in here that will basically do nothing but still allow me to retrieving messages via the polling mechanism?
Thanks,
Dan
Twilio developer evangelist here.
You can use a URL that responds with an empty <Response> TwiML element. If you don't have a server to host that on, you could use http://twimlets.com. This link ought to do the trick:
http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E&

How to send a SNMP GET request with wrong type using net-snmp?

How could I send a net-snmp GET request, such that:
netsnmp_check_vb_type
will return SNMP_ERR_WRONGTYPE?
You'd need to modify the agent you were talking to so that it would send back that error code for a GET. No agent out there should be doing that for a GET request unless there was a bug in the agent. In other words: you'd have to put a bug in the agent!
I think that's impossible, as wrong type check should only work for SET requests.

Resources