Device for preventing the transmission of infections in automated or robotic milking machines, consisting of a milk container (3), a partition (3a), inlet hoses (2) and (2a), outlet hoses (4) and (5), wherein the partition (3a) divides the milk container (3) into two unconnected halves (3b) and (3c), whereby the milk from one pair of milking cups (1a) enters through inlet hoses (2) into one half (3b) of the milk container (3) and leaves it through an outlet hose (4) to a tank (6), and the milk from the other pair of milking cups (1b) enters through inlet hoses (2a) into the other half (3c) of the milk container (3) and leaves it through an outlet hose (5) to a tank (6).