Electrical machine, preferably a rotary current generator, with a housing, a rotor which is mounted in the housing so as to be rotatable with at least one fan arranged in the housing, with a rectifier component whose positive and negative diodes are arranged at a positive and negative heat sink, respectively, the positive heat sink and negative heat sink being electrically insulated from one another by an insulating plate and fastened to a front area of an end shield of the machine so as to be sandwiched together with a circuit board for diode connections, wherein waste heat of the rectifier component is to be carried off from an upper heat sink via a heat-conducting contact of a lower heat sink at the end shield on the one hand and, on the other hand, by at least one sucked in cooling air flow of a fan in that the upper heat sink is provided in an area of its inner circumference with a plurality of cooling air openings arranged next to one another to allow the cooling air flow to pass through axially, axial cooling fins (39) are formed at the heat sink (27) at least some of the cooling air openings (38) of the upper heat sink (27), rectifier component whose positive and negative diodes are arranged at a positive and negative heat sink, respectively, the positive heat sink and negative heat sink being electrically insulated from one another by an insulating plate and fastened to a front area of an end shield of the machine so as to be sandwiched together with a circuit board for diode connections, wherein waste heat of the rectifier component is to be carried off from an upper heat sink via a heat-conducting contact of a lower heat sink at an end shield on the one hand and, on the other hand, by at least one cooling air flow of a fan of the machine in that this upper heat sink is provided with a plurality of cooling air openings arranged next to one another at the inner circumference to allow the cooling air flow to pass through axially, axial cooling fins (39) are formed at the upper heat sink (27) at least at some of the cooling air openings (38) of the upper heat sink (27), there is a distance betwen the upper heat sink (27) and the circuit board (30), which distance forms an air gap (41) for a radial cooling air flow (25a) from the outer circumference of the upper heat sink (27) to some of its cooling air openings (38a) at the inner circumferential area, and circumferentially extending cooling fins (39) formed at the plurality of cooling air openings (38) alternate with cooling fins (39a) formed at other cooling air openings (38a) only at the inner circumference of the heat sink (27), so that the radial cooling air flow (25a) can arrive without hindrance at the fan (24) through the other cooling air openings (38a), the circuit board (30) is covered by a protective cap (34) which is provided with openings (35) to allow the cooling air flow (25) to enter and covers radially oriented connections (33a, 33b) of the circuit board (30) for the negative diode (31) and for winding ends (17a) of the machine with a collar (43), and the protective cap (34) is provided with a shaped out portion (44) in which is inserted an anti-interference capacitor (45) of the machine which is to be electrically connected with the end shield of the machine via connection conductors (46) which are integrated in the protective cap (34) on the one side and, on the other side, communicates with a main connection (positive terminal 37) of the rectifier component (26).