Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am managing a mail server. The mail server is running with multiple domains configured. The problem is authenticated user can use any sender email ID and I need to prevent it. How can I do that?

Example: a sender with email anything@example.com is sending mail with sender email address as anything@yahoo.com

I need to prevent that.

share|improve this question
    
In your example, are both example.com and yahoo.com domains configured for your mail server? Are you talking about the envelope sender or the From: header in the message itself? –  Marie Fischer Nov 12 '11 at 15:27

1 Answer 1

You do this with the configuration optoin

smtpd_sender_login_maps

It requires the user has SASL authenticated.

smtpd_sender_login_maps (default: empty)

Optional lookup table with the SASL login names that own sender
(MAIL FROM) addresses.

Specify zero or more "type:table" lookup tables. With lookups
from indexed files such as DB or DBM, or from networked tables 
such as NIS, LDAP or SQL, the following search operations
are done with a sender address of user@domain:

1) user@domain
    This table lookup is always done and has the highest precedence. 
2) user
    This table lookup is done only when the domain part of 
    the sender address matches $myorigin, $mydestination, 
    $inet_interfaces or $proxy_interfaces. 
3) @domain
    This table lookup is done last and has the lowest precedence. 

In all cases the result of table lookup must be either 
"not found" or a list of SASL login names separated by 
comma and/or whitespace.

Then you add a configuration option along with the above to the smtpd_sender_restrictions optoin such as;

smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch
share|improve this answer
    
Where do i specify the sender addresses? Or it is set automatically? –  Sourav Nov 12 '11 at 16:44
    
Its added as a comma seperated list against the sasl username mappings. –  Matthew Ife Nov 12 '11 at 16:53
    
Hi Mlfe, i am extremely sorry but i am newbie and this is getting hard for me. If you mention step by step to do that i can learn this wonderful solution. –  Sourav Nov 12 '11 at 18:46
    
Finally i got this. Here is the solution: serverfault.com/questions/318334/… –  Sourav Nov 12 '11 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.