Check message-ids to save db hits

Since heroku is miserly with it's free plan this avoids looking up
messages if they already exist.