Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to automatically send an email to a mailing-list.

The machine running sendmail is example.org, which is a standard Ubuntu with Postfix. The recipient is foo@example.org which is a Google Apps-managed mail address. The email is never received.

I've tried to send an email to a gmail.com address and it works, so I'm guessing sendmail doesn't even bother to contact example.org MX record (which resolves to Google) because the local domain is example.org (registered as such in /etc/hosts).

Is my guess right? How can I force sendmail to actually send the mail?

Here is what the mail server tells me (confirming that it's sending the mail locally).

$ cat /var/mail/foo
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host xxx.

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

<foo@example.org>: unknown user: "foo"
share|improve this question
1  
This should be migrated to ServerFault, and then closed as a duplicate of this ServerFault question that already has answers and this ServerFault question that has more answers. –  JdeBP Jun 2 '11 at 16:04
add comment

1 Answer

up vote 1 down vote accepted

It sounds like you have postfix configured to accept mail for example.org, but you actually want that mail sent somewhere else.

You should modify your postfix config (main.cf), checking the 'mydestination' parameter. This is the list of domain names that postfix considers itself the final destination for.

I'm also assuming that the MX record for example.org is correctly set to the relevant google apps servers.

I'm also assuming that it is postfix your are using.

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.