This article introduces a new Melitz-type model of heterogeneous producers with decreasing returns to scale and different productivities. Different to previous models, it describes smallholder producers in rural areas of developing countries in the context of environment and development economics. The model enables a socially sensitive policy analysis considering poverty and distributional effects. In this model, the production input causes a negative environmental externality. External shocks, e.g., caused by climate change, and economic policies affect the producers' endogenous choice between market entry or exit and between simple or advanced technology. In the frst step, various shocks and policies are analyzed theoretically. A novel type of the rebound effect (Jevons paradox) is identifed for the production input that occurs when market entry is incentivized by productivity improvements. In the second step, the model is calibrated by applying it to coffee production in rural Vietnam. The simulation results show that secondary effects of the shocks, such as employment effects, can be substantially larger than the original impact. The support of market entry or of the advanced technology creates adverse distributional effects.