Why does an electron react differently to a virtual photon in the interaction between two electrons and between an electron and a positron? For the interaction between, say an electron and a positron, there correspond many (infinite) Feynman diagrams with well described mathematical expressions for the incoming and outgoing particles and all the vertex factors and virtual particles involved, along with a prescription how to calculate from these the probability amplitude for the two particles scattering. 
I know you can't see the diagrams literally as two moving particles through space and time. Otherwise, the interaction between an electron and a positron would show two outgoing particles having momenta which would be mirror images (mirrored to the vertical which goes through the point of the vertices, when time is the vertical axis) of those in the real Feynman diagram (which you can compare to the second Feynman diagram in the interaction between two electrons) or two incoming particles with zero momentum would be shown as vertical lines.
But let's stick to the first order diagram. It's a very good approximation.
I was wondering, how each particle "knows" (in the interaction between an electron and the positron) which charge the other particle has?
Let's suppose the incoming electron and positron have zero three-momentum $(p_x , p_y , p_z)$ as part of the four-momentum $(\frac E c , p_x , p_y , p_z)$. 
The virtual photon (for which the energy and the three-momentum are independent; i.e, they lie not on their mass shell) at the electron-virtual photon-electron vertex, in order to conserve four-momentum, and thus three-momentum, has an opposite three-momentum to the three-momentum at the positron-virtual photon-electron vertex. Which isn't contradictory because the photons are virtual.
By the way, these two interactions at the vertices happen at the same time due to the horizontal, wavy virtual photon line (time is vertical). The virtual photon isn't emitted or absorbed (or both at the same time). It's just there.
So how does the virtual photon [a real photon (which is, in fact, a virtual photon very close to its mass shell) makes no distinction between + or - charges] let a particle know which electric charge the other particle has? 
Has the coupling strength something to do with it? 
 A: As invited, let me collect my comments here. You are asking for a metaphorical "story", a cartoon of the well-defined math involved. Feynman, in his popular book, Figs 60,61  settles it, but let me parse it out. You might use the boats-on-a-lake popular metaphor, but I personally have trouble visualizing a thrown ball imparting momentum opposite to its direction of travel...
A photon by itself is just a conduit of energy and momentum. In Compton scattering, where just one real photon is involved, the struck and diverted electron has no clue  whether the X-ray came from an atom or an anti-atom! It does exactly the same thing. 
When you scatter electrons off electrons/positrons (you might take the charge labile particle to be a μ+ or μ- to avoid cross diagrams) by exchange of just one virtual photon to lowest order, again, as you can see working out the amplitudes, the answers are the same, except the over-all amplitudes differ by a minus sign, as also reflected by the Coulomb potential you'd calculate in the Born-amplitude soft limit. It is quadratic in the charge, so it will flip sign depending on the source (μ+ or μ-). 
In every diagram, and in any vertex, the very same type of photon couples to positive and negative particles, and energy and momentum are conserved. The only quirk for virtual (internal) photons is that they are not massless states, but who cares?  If you only look at cross sections depending on $e^4$, you should see no difference. (Recall the Rutherford cross section does not read off the sign of the nuclear charge.)
In an elastic-scattering tree diagram the kinematics is completely fixed. If the initial e and the μ are at rest, as in your vision, they can only exchange a virtual photon of zero momentum and zero energy, since the outgoing products cannot conserve energy and not be at rest. Your unsound expectation that the scattering products will move is a reminder of the treachery of misapplied correspondence principles.
Suppose you give them small momenta, and work in the center of momentum, and you focus on scattering at 90° in that frame. You wouldn't expect contrasting comportments, would you? 
A: I really liked the question and got really confused by it! After being confused and thinking about it for a long time, I want to try to give an answer. Please read it as I tried my best to address the question from the asker's point of view!
I don't know if there is much purpose in talking about whether virtual photons are "real" or not. If the formalism works, there is always some interpretation in which its elements are "real". In Feyman's popular book on QED, he really considers the process as being a sum over all paths between initial and final states, with the intermediate particles being "real". In this approach, the amplitude for the virtual photon to propagate from $x$ to $x'$ is just the Green's function for the photon.
Consider the following (very schematic) classical Lagrangian for charged particles $\phi_1$, $\phi_2$ interacting with a photon $A$. Please ignore signs factors of 2, and spacetime structure:
$$ L \sim \dot \phi_1 ^2 + \dot\phi_2^2  \quad + \quad\dot A^2 + k^2 A^2 \quad + \quad e \,A \phi_1 - e\, A \phi_2$$
Notice that I coupled $\phi_1$ and $\phi_2$ to $A$ with opposite signs because they have opposite charge. The equations of motion will be (schematically):
$$\ddot \phi_1 = e\, A,\qquad \ddot \phi_2 = -e\, A,\qquad \ddot A + k^2 A = e\,\phi_1 - e\,\phi_2$$
Solving for $A$ gives, (again schematically):
$$A(x) = e\int_{x'}G_k(x,x')\phi_1(x')-e\int_{x'}G_k(x,x')\phi_2(x')$$
where $G_k$ is the green's function for $A$'s differential equation. Sticking this back into the equation for $\phi_1$ and neglecting self-interactions, we have
$$ \ddot \phi_1 = -e^2 \int_{x'}G_k(x,x')\phi_2(x')$$
We see that $\phi_1$ is driven by $\phi_2$ through the "virtual photon" $G_k$. We also see that it has a minus sign. If $\phi_2$ had the same charge, the driving term would have the opposite sign. This says that attractive and repulsive forces act oppositely to each other. In practice, we usually take $\phi_1$ and $\phi_2$ to be plane wave states, $e^{ipx}$, in which case what we will get is the Fourier transform of the Green's function. The momentum of the virtual photon tells us the momentum transfer and does not depend on the sign of the charges. Only the overall sign of the "virtual photon" (Green's function times the couplings) depends on the sign of the charges.
What's the problem with all of this? The problem is that everyone knows that a scattering amplitude is proportional to the square of the amplitude. So where did the sign go? The truth is, if you scatter a beam of electrons off a proton, you will get the same signal as if you scatter off an anti-proton. Ordinary scattering cannot distinguish between an attractive and a repulsive potential. The reason is that there is no way of knowing if a particle in the beam was moving to the left of the target and got scattered to the right (attractive), or if the particle in the beam was moving to the right of the target and got scattered more to the right (repulsive). The situation is symmetric. (For plane waves, this is even more true because they fill space and so are never to the left or to the right of each other.) In Feynman diagrams, we draw the particles with a non-zero impact parameter, but the particles are really colliding head-on, on average.
To know if an interaction is attractive or repulsive, you actually need the scattering amplitude. In the interaction picture:
$$\mathcal{A}\sim \langle \psi_f |\psi_i(t)\rangle \sim \langle \psi_f |e^{-i\int V dt}|\psi_i(0)\rangle \sim \langle \psi_f |\psi_i(0)\rangle - i\int dt \langle \psi_f |V(t)| \psi_i(0)\rangle\;+\;...$$
When $\langle \psi_f |\psi_i\rangle $ is non-zero (which is must be for a deflection process, i.e. the wave packets must overlap at the origin at $t=0$ in the Schrodinger picture.), then the probability $P\sim |\mathcal{A}|^2$ will have a term proportional to the sign of the Green's function. This must be the term that tells you whether the wave packet gets deflected towards or away from the target. 
A good book on scattering is the book by Taylor.
A: 
First order electron electron scattering at low energy is called , Moller scattering
First order electron positron low energy scattering is called BhaBha scattering.
Different diagrams contribute and different signs enter in front of the integrals.
(I took the diagrams this question, which is different than yours but related.)
A: So people usually respond to questions like this, quite reasonably, by saying that virtual particles aren't "real" and they're just a calculational device for doing perturbation theory. But this doesn't really seem to answer the "spirit" of your question: when an electron and positron interact, clearly there is something that "lets them know" what each other's charge is: an electron brought close to a positron behaves differently to an electron moved close to an electron. Your puzzle is then: if the only thing that defines the interaction between the electrons is a virtual photon, then how do they know each other's charge?
The answer is essentially: it is not just the virtual photon that defines the interaction. The electrons also know what the Hamiltonian is, or, "there's more information in the interaction than just what the virtual photon is carrying around". However you choose to incoporate that into your visualisation of how particles interact is up to you, but it highlights the limitations of visualising electromagnetic interaction as "a photon being spat back and forth" and nothing else. Let's elucidate this claim a bit more clearly with a path integral treatment.
Consider 
\begin{align}
\mathscr{Z}&=\int \mathscr{D}A\exp\left(i\int d^4x\ \frac{1}{4}F_{\mu\nu}F^{\mu\nu} + A_\mu J^\mu \right)\\
&=\int \mathscr{D}A\exp\left(i\int d^4x\ \frac{1}{2}A_\mu\left(\partial^2\eta^{\mu\nu}-\partial^\mu\partial^\nu\right)A_\nu  + A_\mu J^\mu \right)
\end{align}
and not worry too much about subtleties with the $\mathscr{D} A$ to do with gauge-fixing, or the dynamics of the electrons/positrons - we'll just treat the current $J^\mu$ as a classical source, and take the photon propagator to be $ -\eta_{\mu\nu}/p^2$. Our results will be unchanged under a gauge transformation, and we'll step through later how the story is changed when let the electrons be dynamical.
We can do the path integral exactly here, since everything is quadractic in $A_\mu$. The answer is
\begin{align}
\mathscr{Z}=\exp\left(iW[J]\right)
\end{align}
where
\begin{align}
W[J]=\frac{1}{2}\int\frac{d^4k}{(2\pi)^4}J^\mu(k)^*\frac{1}{k^2+i\epsilon}J_\mu(k)
\end{align}
where $J(k)$ is the fourier transform of $J(x)$ and $J^*$ is complex conjugation. The quantity $W[J]$ encodes the "potential energy" of the configuration $J$ in a way we'll make precise at the end. The zeroth component of the current vector is the charge density $J^0(k)=\rho(k)$, and so this expression tells us that the potential energy of two lumps of equal charge density is positive, while it is negative for opposite charges - i.e. the force between two like charges is repulsive and between two opposite charges is negative$^1$! Now,
the propagator factor $1/k^2$ is "a virtual photon" being exchanged between the two currents (more justification for this later), and so in this sketched example we see that it isn't the virtual photon "telling" the two particles what their respective charges are. It tells us that there is a term in the Hamiltonian that couples charges together via a photon, and the structure of QED is such that this term is positive for like charges and negative for opposite charges$^2$. It's simply the fact that a virtual photon exchanged between two like charges mediates a repulsive force, and an attractive one when exchanged between opposite charges. This is the limitation of imagining a force as nothing more than a photon spat back and forth: what that photon does depends on what the Hamiltonian tells it to do, and the Hamiltonian tells it to attract opposite charges and repel like charges. So the situation is "photon + the instructions it gets from the Hamiltonian" rather than just "photon" on its own.
Treating the electron/positron as classical sources and seeing the energy of the interaction you get is actually a perfectly fine argument, but maybe it would be a bit more persuasive to put the electrons in explicitly, and derive the Feynman rules - which is where we're used to seeing virtual photons. If we want to calculate time-ordered correlation functions, say $\langle \text{T}\{\bar{\Psi}(x)\Psi (y)\}\rangle$ we use the path integral:
\begin{align}
\mathscr{Z}&=\int \mathscr{D}A\mathscr{D}\bar{\Psi}\mathscr{D}\Psi \ \bar{\Psi}(x)\Psi (y)\exp\left(i\int d^4x\ \frac{1}{4}F_{\mu\nu}F^{\mu\nu} + i\bar{\Psi}\partial\!\!\!\big/\Psi + e\bar{\Psi}\gamma^\mu\Psi A_\mu \right)\\
&=\int \mathscr{D}A\mathscr{D}\bar{\Psi}\mathscr{D}\Psi \ \bar{\Psi}(x)\Psi (y)\exp\left(i\int d^4x\ \frac{1}{2}A_\mu\left(\partial^2\eta^{\mu\nu}-\partial^\mu\partial^\nu\right)A_\nu +i\bar{\Psi}p\!\!\!\big/\Psi  + e\bar{\Psi}\gamma^\mu\Psi  A_\mu\right)
\end{align}
One way to derive the Feynman rules is to separate the noninteracting piece off, then expand the exponential $\exp(i\int d^4x \mathcal{L}_{int})$. Then we get a series of integrals that look like powers of the fields times Gaussians of those fields (the noninteracting piece up in the exponent still). Integrating these objects term by term give us the Feynman diagrams. Explicitly,
\begin{align}
\mathscr{Z}&=\int \mathscr{D}A\mathscr{D}\bar{\Psi}\mathscr{D}\Psi \ \bar{\Psi}(x)\Psi (y)\sum_{n=0}^\infty\frac{1}{n!}\left(i\int d^4ze\bar{\Psi}\gamma^\mu\Psi A_\mu\right)^n\exp\left(i\int d^4x\ \frac{1}{4}F_{\mu\nu}F^{\mu\nu} + i\bar{\Psi}\partial\!\!\!\big/\Psi \right)
\end{align}
Wick's theorem tells us how to do these integrals (Wick's theorem is basically just a fancy way to tell us how to do integrals that look like powers times Gaussians). A generic term in this series looks something like
\begin{align}
\bar{\Psi}(x)\Psi (y)\left(i\int d^4we\bar{\Psi}(w)\gamma^\mu\Psi (w)A_\mu(w)\right)\left(i\int d^4ze\bar{\Psi}(z)\gamma^\nu\Psi (z) A_\nu(z)\right)
\end{align}
times the Gaussian. Wick's theorem then says to do this integral we "contract" each $A_\mu(x)$ with other terms like $A_\nu(y)$, which gives us a factor $-i\eta_{\mu\nu}/(k^2+i\epsilon)$, and contract fermion operators similarly, picking up fermion propagators. We then integrate over the positions $w$ and $z$, and obtain the value of that term in the series - this is a Feynman diagram. "Virtual photons" refer to the objects that come from contracting photon fields $A_\mu(x)A_\nu(y)$, and are represented by wavy lines in Feynman diagrams. This is why we claimed earlier that the $\eta_{\mu\nu}/(k^2+i\epsilon)$ term earlier plays the same role that the virtual photons play in the perturbation series.
Now, the way we calculate scattering amplitudes is through the LSZ prescription, which says to calculate correlation functions then amputate the external lines i.e. take factors that you got from contracting the terms like $\bar{\Psi}(x)\Psi (y)$ with each other, and then replace them with some factor (just a constant if the field is a scalar, some spinors if the field is an electron, polarisation structure if the field is a photon etc).
So how do we relate the packaging of this story - in terms of scattering/correlators - to the question of whether the interaction is repulsive or attractive? Well if you calculate the leading contribution to $e^+e^-\rightarrow e^+e^-$ scattering, and consider the nonrelativistic limit, you get something that basically looks exactly what we considered before
\begin{align}
e^2j^\mu(p)\frac{\eta_{\mu\nu}}{k^2+i\epsilon}j^\nu(p')\sim\frac{e^2}{|p-p'|} \times \text{stuff}
\end{align}
where we won't be bothered explicitly writing what the $js$ are. Note the $\frac{\eta_{\mu\nu}}{k^2+i\epsilon}$ is the virtual photon line, and the $js$ come from the initial and final states of the electron/positron. But the leading contribution to the scattering amplitude in nonrelativistic quantum mechanics is given by the Born rule, which says basically
\begin{align}
T_{p'p}=-\tilde{V}(q)(2\pi)\delta (E_f-E_i)
\end{align}
where $T_{pp'}$ is the matrix element of the scattering matrix. So by comparison we see $\tilde{V}(p-p')=-e^2/|p-p'|$ i.e. an attractive Coulomb interaction$^3$.
The upshot is that virtual photons come from insertions of photon propagators, and as we saw in both examples they don't carry any information about the charges of the fermions. The attraction/repulsion came from the electron-photon vertex i.e. the factor of $\pm e$ due to the current operator i.e. what the Hamiltonian says a photon is supposed to do when it links up to a fermion. The Hamiltonian says like charges repel and opposite charges attract, and the virtual photon is told what to do by the Hamiltonian.
The final point I should return to is my earlier assertion that $W[J]$ somehow reflects the energy associated to the configuration $J$. Observe if we just take the source to be static, then $e^{iW[J]}=\langle 0| e^{-iHT} |0\rangle =e^{-iET}$ where $E$ is the energy of the two sources acting on each other. If you take the above expression for $W$ in real space, and let the sources be static then do the time integral you'll get $E>0$, which is what we were after$^4$.
$^1$In fact, if you fourier transform this back to real space, you'll find this expression equals the Coulomb interaction.
$^2$Incidentally you can run this exact same story through with gravity and discover that gravity is attractive! Without worrying too much about the exact form of the lagrangian for gravity, requiring the propagator be traceless, transverse and gauge invariant allows you to fix its structure on general grounds to be
\begin{align}
G_{\mu\nu,\lambda,\sigma}=\frac{\eta_{\mu\lambda}\eta_{\nu\sigma}+\eta_{\mu\sigma}\eta_{\nu\lambda}-\tfrac{2}{3}\eta_{\mu\nu}\eta_{\lambda\sigma}}{k^2+i\epsilon}
\end{align}
where again we've made the easiest gauge choice. Rather than couple to a vector current $J^\mu$, the graviton couples to a tensor current i.e. the energy momentum tensor $T^{\mu\nu}$, and two lumps of energy/mass pop up in the $T^{00}$ component of the energy momentum tensor. Running the same story through for $W[T]$ you'll find that like masses attract.
$^3$See for instance the discussion on page 125 of Peskin and Schroeder.
$^4$This entire story is run through (probably more clearly than I did) in Zee's cute book "Quantum Field Theory in a Nutshell", in one of the early chapters.
A: There is no virtual photon as a physical entity here. Not only is it neither absorbed nor emitted, it doesn't exist as anything physical. It is literally just a line in the Feynman diagram. It represents a "fictitious" intermediate state that is distinct from the actual state of the system at any time, as I argue in this answer on the relation between virtual particles and intermediate states. The virtual photon cannot be what "communicates" the charge of the particles to each other because it is absent in a non-perturbative description (or even in a perturbative description that doesn't draw the diagrams, hence doesn't give us the wiggly line to imbue with the photon ontology).
In a rather embarrassing turn of events, we do not know the space of states for an arbitrary interacting quantum field theory. By Haag's theorem, it is inequivalent to the free space of states in which the particles we like to talk of live. The "electrons", the "positrons", the "photons", they live in the limit of the theory in which they are so far apart that they can effectively be described as not interacting. Interacting spaces are complicated - sometimes they look like the free space, but with different masses, and sometimes they might not be like a Fock space at all, see this answer by yuggib. Nevertheless, QFT is able to predict the outcome of interactions as long as that outcome is effectively described as free again - hence the focus on scattering: A scattering is a type of interaction where a bunch of free particles meet, do something, and then a bunch of possibly different particles come out again, rapidly separating.
So the question of "how" the interacting particles know each others' charges is complicated by the fact that we do not even have a good description of the state of the particles when they're interacting. There might not even be any recognizable "particle" subentities in the interacting state, akin to how it is difficult/impossible/fraught with perils to talk about the state of a single particle in ordinary QM when it is part of an entangled state of multiple particles.
The time evolution in quantum theories, and in particular quantum field theories, is a black box formally specified by the Lagrangian (or Hamiltonian) of the theory. This suffices to compute astoundingly accurate predictions of the outcomes of scattering-like interactions, and this is far less limited than one might think at first glance (cf. e.g. QFT applications in condensed matter theory as opposed to high-energy experiments). But this black box gives us no human-readable interpretation, no story of "how" the interaction happens. 
Maybe this is a deficiency in our theory, a sign that we can still do better. But maybe it's a sign of a deficiency in nature itself - there is no compelling reason that nature in the quantum regime should behave in ways that can be captured by our intuitions and natural language that were shaped in a world that prima facie looks wholly classical.
