Posts Tagged ‘smtp’

Postfix SMTP relay broken, MX host not found.

Yesterday, all outgoing emails started to accumulate in the Postfix queue with this error:

Jun 29 13:35:02 intranet postfix/smtp[15330]: 88AE28C839: to=, relay=none, delay=8921, delays=8897/4/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=myprovider.isp.hosting type=MX: Host not found, try again)

First thing I did, nslookup and dig tests, yep the host can be found, although there is no MX record. Could it be that Postfix absolutely requires the MX record?

As it turns out: no. What actually happened is that I changed DNS settings for this server. I went into /etc/resolv.conf and updated the settings, as a new DNS server was installed and replaced and agin one.

What I didn’t know is that Postfix keeps a cached copy of this resolv.conf in a mini-chroot jail located in /var/spool/postfix/etc/resolv.conf

That file had the old DNS server settings! I changed it for the correct servers, and issued

postfix reload
postqueue -p

Voilà!

Changing the FROM address in Google Apps mail / Gmail

After searching a bit for this, I thought I’d share the solution.

I have mail automatically forwarded from other email addresses (at other domains) to a Google Apps email address. The problem is, even though I set my IMAP client (Thunderbird) to say “From: otheraddress@otherdomain.com”, Google automatically rewrites that to my Google Apps address when I use their SMTP server.

This is actually a good feature, it prevents spam by making it impossible to send an email *from* google’s servers while pretending you’re joe@fbi.gov.

Google have worked an elegant solution to this. In the user’s gmail/google apps account settings, under “Accounts”, you can add addresses for “Send Mail As:”. Google will send an email with a code to any address you with to impersonate, and clicking the link or typing back the code will activate that address. You can then make one of them the default one, which will be used for emails sent via SMTP from your regular email clients.