Similarly, check and seal around conduits and pipes that penetrate exterior walls. Fill gaps around wall-mounted, exterior light fixtures. Caulk to fill gaps under siding if necessary. Use window screens to exclude flies from soffit and attic vents. As desirable as exclusion may be, it's not always possible to close off every entry point to face and cluster flies.
Insecticides are the next best choice.
Permethrin sprays can be used indoors around exit points to kill flies as they emerge. Permethrin surface sprays or aerosols can be used effectively where large numbers of flies are found clustered in attic spaces. Wait for a day when the attic space is warm and flies are active for the best results. There's a catch, however. Since this behavior is triggered by shortening day length and cooler temperatures, the most effective treatment window is a moving target.