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.

While looking at my mail queue I noticed the server was attempting to send back a bounce email, presumably to a spammer. Reading the error, I noticed that it was revealing the expanded value of a virtual alias. Is there any way to hide this address and keep it transparent?

I have my aliases set up as local@myhost.tld email@destination.tld in the alias file, and here is the mail content:

This is the mail system at host myhost.tld.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<email@destination.tld> (expanded from <local@myhost.tld>): host
    gmail-smtp-in.l.google.com[74.125.95.27] said: 552-5.7.0 Our system
    detected an illegal attachment on your message. Please 552-5.7.0 visit
    http://mail.google.com/support/bin/answer.py?answer=6590 to 552 5.7.0
    review our attachment guidelines. 37si2240042ibi.37 (in reply to end of
    DATA command)
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

Do not solve this problem. Solve the original problem.

There is no need to relay Spam. This is what you are doing here. You accept any mail and then forward all mails to a Google account. Google's Spam filter jumps in and rejects the mail. So please think of replacing this strange mail setup. If you want to store any mail in Googlemail because it is convenient, then please use Google-Apps and move the MX of myhost.tld to Google's server farm. If it is a per user setting to forward mails to Google, then you have to filter for Spam and only forward the clean ones.

In general you should never bounce Spam mails. The bounces do not reach the correct person as 99.999% of all sender addresses are forged.

share|improve this answer
    
Thanks, but I had already considered both those options when determining to do the mail relay and neither of them are a clear solution. As much as I'd like to straight up use Google Apps, it won't work, and there's no way I can catch spam as well as Google, so some things will get through and this will still happen. –  Andrew Koester May 19 '11 at 15:58
    
Then in this rare case you can safely ignore this. The recipient of the bounce message will ignore your mail. He has never sent a mail to you or your Google address. And he is not interested in writing a second (first) mail to email@destination.tld or local@myhost.tld. –  mailq May 19 '11 at 23:19
    
You may not be able to catch spam as well as Google, but you can do a simple Amavisd install and block the attachment types listed at the url in the error. Trying to hide the addresses in your backscatter spam is not the answer either. –  slillibri May 20 '11 at 0:18
    
It may not be what I want to hear, but this is most likely still the proper course of action. –  Andrew Koester May 23 '11 at 14:32
add comment

There is a better solution I will only sketch shortly.

For relaying mails to Google create a new transport and a corresponding service in master.cf. In the options of this particular smtp service set the -o bounce_service_name=discard. This should discard any bounce mail from Google. This will stop backscatter but if Google temporarily defers mail it won't be affected and retried later.

share|improve this answer
add comment

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.