views:

833

answers:

2

Hi there,

I think the crux of this issue is that I'm a postfix neophyte, but here goes.

I'm using postfix's sendmail on a 1&1 VPS account to post messages from a webserver (through PHP; contact forms, password resets, etc.). It's working fine, except mail cannot be sent to the local domain. That is, if the host is example.com, any messages to [email protected] simply aren't delivered.

I've seen suggestions that this is due to the fact that the server recognizes that the mail is coming to itself, and shortcuts the outbound SMTP methods. Trouble is, we're using 1&1's email manager to assign forwarding addresses, so redirecting [email protected] to x's server account isn't good for our case (through the host's web interface, we can set [email protected] to forward to [email protected], which is what we're doing).

Thanks for the help.

+1  A: 

Take a look at the .Forward file http://www.feep.net/sendmail/tutorial/intro/forward.html

trent
If our email addresses are not associated with user accounts, this wouldn't work, correct? Would we need to create users to associate with each inbox address, then create a .forward file in their home directories?
kyle
you could create an alias file instead of creating users
trent
+1  A: 

Besides not being clear about whether you're running postfix or sendmail (and you can't run both, it doesn't work), you also aren't clear about where you want "example.com"'s email to go.

If you want it delivered to local accounts on that machine, then you have to tell postfix (assuming you really are running postfix) that you're the end point delivery for example.com. You do that in the /etc/postfix/main.cf file. I forget the exact name of the option, but it's pretty obvious when you see it.

Then if you want specific addresses forwarded elsewhere, you can forward them in /etc/postfix/aliases (sometimes /etc/aliases, depending on the setup) or /etc/postfix/virtual. Don't forget to run "postmap /etc/postfix/aliases; postfix reload" after updating that file.

Paul Tomblin
Apologies for my confusion, but it's got to be fairly evident how someone could mistake which system they're using. Why does every Linux mail server include a `sendmail` program? I'll try the `postmap` exercise.
kyle
Unfortunately back when "sendmail" was the only program, a lot of code got written that assumed that calling "/usr/lib/sendmail" was the way to send mail. So postfix and others provide it for that purpose.
Paul Tomblin
That is the first sensible explanation I've heard of this situation; very unfortunate for the uninformed. Still hacking through postmap, no luck thus far.
kyle
And I spoke a minute too soon. My file, in particular, was /etc/postfix/virtual, as you mentioned, but it looks like things wouldn't work until /etc/postfix/virtual was appended in the virtual_alias_maps parameter of /etc/postfix/main.cf.
kyle