The cargo transport represents the largest share of logistics costs in most companies. Consequently, companies are investing in tracking and tracing systems aiming to improve services, reduce costs and ensure the safety in cargo transportation. To play a part in this area, we propose in this article SafeTrack, a model for logistics management based on geofencing algorithms and radio-frequency technology. In this approach, the focus is on dealing with delivery management. The main scientific contribution of SafeTrack is automatic delivery management. Besides dealing with deliveries without user interaction, we provide a mechanism to detect inconsistencies at real-time. Furthermore, the model monitors detours in planned routes and deals with alarms notifications using mobile devices. To provide that features, we employed Geofence concept with two solutions that enable to detect, in real-time, the occurrence of detours in planned routes. We also created a component, named SafeDuino, to control loads delivery and pickups. The decision on the occurrence of inconsistencies during the logistics flow is performed through the fusion of context information, obtained from SafeDuino and a mobile device, using radio-frequency technology. We built a complete and functional prototype, which was evaluated in a controlled environment, testing several conditions. The test scenario was executed twenty times, showing that the proposed model is capable to identify all inconsistencies along the travels. We concluded that SafeTrack improves logistics operation, optimizing decision-making, avoiding losses during the logistics flow, and also allowing companies to remain competitive in the market.