Email delivery exceptions in Symfony3 - symfony

I have a Symfony project, that is now being tested on live system, and I'm using the delivery_address to prevent sending email to real recipients.
I needed also some exceptions for this, so I have used a very nice delivery_whitelist option (like here).
Right now, the white-listed emails are going both to original target and to delivery_address, but I'd like them to get sent only to the original, white-listed address.
Is that possible in some way?

As #userfuser suggested, here is my slightly altered comment as an answer:
Since your requirement contradicts the semantics of the configuration options, your only option seems to be adding some logic to your mail sending component. I am sure that you will be able to extract the white list and other options programatically so you can build your edge case.

Related

tdlib get notifications settings for (another) user

I'm using tdlib and currently trying to create another user's profile screen like this one:
There is usually a field on this screen called "Notifications" containing information on whether or not notifications for given user are muted and if so then for how long. All other fields seem easy to retrieve, but this one is a head-scratcher for me.
All other field are stored in User entity, but what am I supposed to do with this one? Call createPrivateChat only to get one field (namely notificationSettings)? This seems like overkill to me. Isn't there easiest ways to get this? In this issue sapelkinAV states that "chatID is equals UserId". Is it correct? Even if so it might just be an internal thing that we shouldn't rely on, and I can't find neither proofs nor restrictions on abusing this "feature".
If it is fine, than I could use getNotificationSettings and pass notificationSettingsScopeChat as scope parameter. Would it be the right solution? Any thoughts and advices are appreciated!
Official answer (obtained from TDLib bot):
Your usage of createPrivateChat is absolutely correct. To get correct NotificationSettings you need to get information about the corresponding chat.
So I ended up doing exactly that.
Call createPrivateChat only to get one field (namely notificationSettings)?

Is it possible to read Evernote content without having to authenticate?

What is the easiest, lowest-friction method to read a note programmatically in Evernote? Given that you can share notes by simply generating a unique URL to them, I find it curious that you can't do this programatically as well.
Put another way, I can read notes from my browser without having to authenticate to Evernote. Can I do this programmatically as well? If I have a URL with GUID, can I use this to request the note via code and read it that way?
I attempted to do this -- to use the "Share" URL to read the note. It didn't work, for some reason. When requested programmtically, I was getting 404s for some reason, which makes me think Evernote has some safeguards against using it in this method.
Is there a way to do this -- to read note content via some service without having to authenticate?
Well actually you can. You just need to use the getNote method with an empty string as the first argument (auth token).

Filtering Data in ASP.NET Web Services

I've been using this site for quite a while, usually being able to sort out my questions by browsing through the questions and following tags. However, I've recently come across a question that is rather hard to lookup amongst the great number of questions asked - a question I hope some of you might be able to share your opinion on.
As my problem is a bit hard to fit into a single line, going in the title, I'll try to give a bit more details on the problem I've encountered. So, as the title says I need to filter, or limit, some of the response data my standard ASP.NET Soap-based Web service returns on invoking various web methods. The web service is used to return data used by other systems (a data repository more or less), where the client today is able to specify a few parameters on how the data should be filtered and in return a full-set of data back.
Well, easy enough I thought, just put additional filtering options on the existing web methods which needs a bit more filtered applied, make adjustments on the server-side and we are all set to go - well, unfortunately it turned out to be a bit more tricky then this.
The problem I am facing is that I'm working on a web service running in a production environment, which needs to be extended in such that additional filters can be applied to existing web method being invoked w/o affecting the calls already being made by other systems used by the customer using their client stubs. This is where I am a bit troubled, since I can't seem to find a "right solution" on extending the current web service.
Today, the filter is send as a custom data structure which holds information on which data should filtered, but I am not sure if I can simply just add more information to this data structure w/o breaking code at the clients? One of my co-workers suggested that I could implement a solution where I would extend the web.config on the server-side to hold a section with details on which data should be excluded (filtered out), but I don't find this to be a viable solution long-sighted - and I don't trust customers with such an option since this is likely to go wrong at some point. So the solution I am looking for is a way that I can apply a "second filter" to the data I am requesting from the client so instead of getting a full-set of data back it should only give a fraction, it implemented in such that the filter can be easily modified and it must not affect the current client calls.
Any suggestions on how I should approach this problem?
Thanks!
Kind regards,
E.
A pretty common practice is to create another instance of the application OR use part of the url to signify the version of the endpoint they are connecting to, perhaps the virtual directory is the date. That way old calls will go to the old API and new calls will come in on the new API.
http://api.example.com/dostuff
vs
http://api.example.com/6-7-2011/dostuff

Prevent Gmail Threaded Conversation on Notification emails

This question is the opposite of Header in gmail for thread hinting
I have a system that generates notifications for various things. A lot of these have the same subject line, but different content.
Is there anyway short of adding some kind of unique token in the subject line of forcing the emails to NOT be in the same thread, i.e. show up individually. Changing headers and/or content would be acceptable, but changing the subject line will scare people. Also, not all of the recipients are Google Apps/#gmail.com accounts so I can't use things like "+hash".
If it matters, the application is written in C# and ASP.Net.
Anyone know how to do this?
Google seems to weigh the subject line pretty heavily in their threading heuristic, so there doesn't appear to be much that you, as a sender, can do about it without unique-ifing
the subject lines somehow.
Adding a timestamp to the subject line seems to defeat the threading -- do you think
you could get your users to buy into that?
On the recipient's side, they could use the IMAP interface to bypass gmail's threading. And I hear Google is open to giving users the option to
disable the "conversations" feature -- it's obvious that there are a lot of people
out there who hate it!
You may be in luck now, check out this article - https://gsuiteupdates.googleblog.com/2019/03/threading-changes-in-gmail-conversation-view.html - because of the new requirement to have the mail header reference a previous email message ID, your system generated emails are probably no longer threading if your situation is like mine. Good for you, but that wasn't what I wanted for my use case! Enjoy.

So why should we use POST instead of GET for posting data? [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
How should I choose between GET and POST methods in HTML forms?
When do you use POST and when do you use GET?
Obviously, you should. But apart from doing so to fulfil the HTTP protocol, are there any reasons to do so? Less overhead? Some kind of security thing?
because GET must not alter the state of the server by definition.
see RFC2616 9.1.1 Safe Methods:
9.1.1 Safe Methods
Implementors should be aware that the
software represents the user in their
interactions over the Internet, and
should be careful to allow the user to
be aware of any actions they might
take which may have an unexpected
significance to themselves or others.
In particular, the convention has been
established that the GET and HEAD
methods SHOULD NOT have the
significance of taking an action other
than retrieval. These methods ought to
be considered "safe". This allows user
agents to represent other methods,
such as POST, PUT and DELETE, in a
special way, so that the user is made
aware of the fact that a possibly
unsafe action is being requested.
If you use GET to alter the state of the server then a search engine bot or some link prefetching extension in a web browser can wreak havoc on your site and (for example) delete all user data just by following links to your site.
There is a nice paper by the W3C about this: URIs, Addressability, and the use of HTTP GET and POST.
1.3 Quick Checklist for Choosing HTTP GET or POST
Use GET if:
The interaction is more like a question (i.e., it is a safe operation such as a query, read operation, or lookup).
Use POST if:
The interaction is more like an order, or
The interaction changes the state of the resource in a way that the user would perceive (e.g., a subscription to a service), or
The user be held accountable for the results of the interaction
Because, if you use GET to alter state, Google can delete your stuff.
When do you use POST and when do you use GET?
How should I choose between GET and POST methods in HTML forms?
If you accept GETs to perform write operations then a malicious hacker could inject somewhere links to perform an unauthorized operation. Your user clicks on a link - and something is deleted from a database. Or maybe some amount of money is transferred away from the user's account if he's still logged in to their online banking.
http://superbank.com/TransferMoney?amount=1000&recipient=2342524
Send a malicious email with an embedded image referencing this link, and as soon as the document is opened, something funny has happened behind the scenes.
GET is limited by the length of URL the browser/server can handle. This used to be as short as 256 characters.
There is atleast one situation where you want a GET to change data on the server. That is when a GET returns data, and you need to record which data was given to a user and when it was given.
If you use complex data types then it must be in a POST it cannot be in a GET. For example testing a WCF web service in a browser can only be done when the contract uses simple data types.
Using GET and POST where it is expected helps to keep your program understandable.
When you use POST, you can see the information being "posted" in the address-bar of the web browser. This is [apparently] not the case when you use the GET method.
This article was somewhere on http://www.w3schools.com/ Once I've found the exact page it was on, I'll repost. :-)

Resources