# Sendmail - do something with all messages from IP



## ondra_knezour (Feb 15, 2014)

I would like to put all messages coming from given IP address to some place regardless their desired destination and stop all further processing of such messages. 

We are testing new ERP system, I want to put some actual data there and I don't want to send messages about two years old issues to our customers. On the other hand, this system has little strange messaging system, so I don't want to do any message rewrite on that server to see what actually goes out to the wild. Server is configured with ssmtp which pass all messages to our mail server. Here I want to put those messages to shared IMAP folder to see what is going on.

What I have
	
	



```
# sendmail -d0.1
Version 8.14.5
 Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8
                MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS
                PIPELINING SASLv2 SCANF STARTTLS TCPWRAPPERS USERDB
                USE_LDAP_INIT XDEBUG
```
 with mimedefang-2.74

What I am doing now with aliases and what I want to mimic with some rule by IP address
	
	



```
# < /etc/mail/aliases grep -i lda
alias_name: "|HOME=/home/mailnull /usr/local/libexec/dovecot/dovecot-lda -m IMAP/share_folder"
```

So question is, how to pass all messages coming from given IP to Dovecot LDA and don't send them to their desired recipients. Googling on various combinations of sendmail from to ip address and so on didn't help, those are too generic keywords. Some advice here anybody?


----------

