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.

I'm using Jetpack on Wordpress, and it wasn't working. I was getting the following error:

Diagnostic-Code: X-Postfix; unknown user: "jake"

--60FD1138CAD.1354039466/example.com Content-Description: Undelivered Message

(example.com substituted for our domain)

We set up a test mail function, and that wasn't sending either. We changed the email to an outside email and it worked. Any thoughts why it won't send to an email that is at the same domain? Or why it sends to some emails but not others?

Upon running postconf -n, I get the following:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = example.com, Example, localhost.localdomain, localhost
myhostname = example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
share|improve this question
    
The message says there is no recipient named jake. –  Laurentiu Roescu Nov 27 '12 at 19:36
    
Can you send email to jake@example.com from your normal email client? And if so, does your server handle it or do you use a hosted service such as Google Apps? –  Ladadadada Nov 27 '12 at 19:37
    
so the email jake@example.com does in fact exist (I use it all the time), but when I try to send an email with the normal php "mail" function to jake@example.com it doesn't go through. So to answer your question, the server handles it (or at least that's what I'm trying to get to work). –  Jake Nov 28 '12 at 0:04
    
I wasn't very specific in my question so I will be now: do your domain's MX records point to your server? We're also quite likely to want the output of postconf -n. –  Ladadadada Nov 28 '12 at 0:53
    
Ah, yes the MX records point to gmail, not to our server. Above is my postconf -n results –  Jake Nov 28 '12 at 2:47

1 Answer 1

up vote 4 down vote accepted

When I send an email to jake@example.com, my client looks up your MX records, finds that you are using Google and then talks directly to Google's mail servers to send the email. My mail never ends up on your server.

When you send an email from your server to jake@example.com using PHP, PHP looks up its sendmail setting in php.ini and hands the mail off to that process to deliver. In your case, that is going to be Postfix. Since Postfix is capable of both accepting and sending emails (unlike a normal client or MUA), it first checks to see if it should accept this email itself or relay it on to some other server. It does this by comparing the domain after the @ symbol with the contents of the mydestinations config item. In your case, this is example.com and it matches so your Postfix decides to accept the mail itself instead of relaying it to Google. This is the root of where your problem lies.

After deciding to accept the mail itself, it then has to figure out where to put it. This can be a virtual user table or a real Unix user or an alias to delivers to a different user (virtual or real). In your server, none of these match. It looks like your user account is jakebuob, not jake and you don't have any virtual maps configured. So Postfix then bounces the message with a "User not found" message.

The easiest thing to change to fix this problem is to remove example.com from mydestination.

share|improve this answer
    
great, that worked! So if I'm not planning on receiving mail at all, can I just comment that line out in my postfix config file? –  Jake Nov 28 '12 at 19:00
    
No. Any line not in the config files gets the default value. The default value for mydestination includes $hostname. (see here). Best to leave it as it is now. You will probably want some entries in /etc/aliases as well to forward any local mail somewhere useful. –  Ladadadada Nov 28 '12 at 19:29

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.