Hi, yesterday my provider complained about a wrongly set bounce address, so he received a lot of bounced email, due to my hit quota limit for the webspace...
At the same time he had the concern, my smtp server would be an open relay, which is why I set it more restrictive. However, I think I found the error at a different place, with some wrongly set aliases.
Now, I probably set either the limits to strict, or I really left my stmp server wide open...
This is what I want to do: - I have several virtual servers running, - for each virtual server I define an catchall adress which works as alias for an external email account on gmail, - email should arrive and directly go to where the virtual server specifies,
I read a lot in the past hours... Is this doable with virtualmin, or did it work before due to an openrelay smtp set up by mistake by me?
Well, it's not an open relay to have a catch-all that forwards all email to an account at another site.
That's not an open relay, that's forwarding email :-)
Of course, catch-alls will collect a lot of spam; in my opinion, catch-alls pull in so much spam that they are not worthwhile.
But that's much different than being an open relay -- which allow non-authenticated remote users to relay email through your server to any account on the Net.
So you can do that in Virtualmin, it's not hard to setup, and it's not being an open relay to do so. In fact, once you have it setup and working, go to Google and search for "open relay test". There's a number of services that will verify that you aren't an open relay.
To setup what you want, just go into Edit Email Aliases, select "Add an alias to this domain", choose the "All Mailboxes" radio button, and choose "Forward to other address".
That should be all you need!
-Eric
Mhmmm, as it was setup before... thanks for the confirmation, that it should work.
In my fear of becoming banned by my provider, I probably messed something up with the standard settings, as Postfix didn't want to accept / relay / forward any mail and directly to the external address...
Is there any place, where I can look up default settings, as from a fresh installed system?
P.S.: Catchall is definitely not the best, but my lowpowered vServer should not deal with spam fighting, I let gmail do it...
Hmm, I'm not sure what you're after in regards to settings, or default settings.
Though, the answer is that there probably isn't a way to see how things look when your system was first installed unless you happened to keep backups from way back then :-)
You can see what the Virtualmin installer sets, by looking at the settings it adds in the Postfix config:
http://software.virtualmin.com/lib/mail-setup.pl
Regarding a catch-all not being the best -- an alternate way of doing that, rather than using a catch-all, would be to create the aliases that you need, and forward them individually over to your other email account.
Have a good one,
-Eric
Very nice solution, very last question...
The error only became apparent, because when emails bounced because of wrong set alias, they then went to postmaster@VHOSTVENDOR.TLD automatically, instead of postmaster@MYID.VHOSTVENDOR.TLD
At which place would I need to make a clear statement, to prevent my system to assume the first one would be right?
mhm, some Virtualmin cronjob still sends mail to my email adresses @VHOSTVENDOR.TLD ...
At which places could it be set wrong?
That depends. cronjob run reports send to root at the hostname of your box. It has nothing to do with Virtualmin (yes, Virtualmin creates cronjobs, but it doesn't have any magical configuration about where it mails reports to).
There are also some tasks that Virtualmin can setup to run from cron which can optionally be configured to send to other email addresses you specify. You haven't told us what specific cronjobs you're talking about, so I can't say which one you would need to change (if any).
For cronjob reports:
If the hostname of your box is correct (when you type "hostname" it returns the name you expect), then you probably just need to restart the cron daemon.
/etc/init.d/crond restart
--
Check out the forum guidelines!
More details... the emails goes to postmaster@VHOSTVENDOR.TLD. The postfix configuration set the bounce_notice_recipient and 2bounce_notice_recipient to postmaster (default), but which service adds @VHOSTVENDOR.TLD ?
Found the reason:
/etc/postfix/main.cf didn't contain explicit statements for mydomain and myhostname ... and the defaults pointed to VHOSTVENDOR.TLD.
Where is this loaded from?
Its now fixed, through adding it.
Depends on your OS. On Ubuntu it's in /etc/mailname (which is stupid, IMHO, but I didn't get a vote). On most systems it comes straight from the /etc/hosts file.
--
Check out the forum guidelines!
Thanks for help... one more question.
I think I set all aliases correctly now in virtualmin for each server.
Still /etc/postfix/virtual contains additional entries, where I don't know where they come from.
Will this file be compiled by Virtualmin? If so from which ressources? Could I manually update /etc/postfix/virtual and it won't be overwritten by any other process?
virtual is the editable form. So, yes, you can edit it yourself outside of Virtualmin without fear of reprisals (generally). When you do, run this to generate the actual map db:
postmap hash:/etc/postfix/virtual
--
Check out the forum guidelines!
<div class='quote'>postmap hash:/etc/postfix/virtual</div>
is this the same action like the command:
newaliases ?
It accomplishes a similar task, but newaliases updates only the /etc/aliases file.
You could always create a Bash alias called, say, "newvirtual" by typing this on the command line:
alias newvirtual="postmap hash:/etc/postfix/virtual"
Now running "newvirtual" will execute the above postmap command.
And if you add that to your .bashrc file, it'll be run each time you log in.
-Eric
Okay, I checked it - its Debian and I found the reference in both places to: MYID.VHOSTVENDOR.TLD
However, as I understand mydomain will be defaulted to the hostname above minus the subdomain, if not set. In a virtual host environment on a virtual providers machine at a providers network, this causes the described problem. Because I don't own the toplevel domain, is defaults bounces etc. to the providers postmaster instead of mine...
Maybe this could be somehow mentioned while installation? Or mydomain should be set automatically correctly in postfix?
Or is it just me :-P
<div class='quote'>Or is it just me</div>
It's just you. ;-)
Your hostname needs to be set correctly to a fully qualified, resolving, domain name. That's it. Don't agonize over it. Just fix your system hostname. If Postfix is saying it is your hosting provider, than your hostname is not set correctly.
What do you get when you run:
hostname
And:
hostname -f
--
Check out the forum guidelines!
The hostname command shows my correct virtual server: MYID.VHOSTVENDOR.TLD
But, Virtualmin default settings in Module Postfix - Address Rewriting and Masquerading says:
Rewrite "user" to "user@$mydomain" X Yes No
Accordingly to http://www.postfix.org/postconf.5.html $mydomain is defined with $hostname minus subdomain.
$mydomain was not specified in /etc/postfix/main.cf and when checking it with postconf -d it would default to VHOSTVENDOR.TLD.
Although hostname is set correctly in the places you mentioned.
I did a workaround and specified $mydomain directly manual in /etc/postfix/main.cf
I think that I had at least one of the same issues as Dirk. My hosting comany wrote:
"
I added mydomain.tld...
"
Where mydomain.tld is the same as the answer from the hostname command.
This seemed to be a key step in enabling my VSes to receive mail.
Thanks, K