On 2/2/2010 3:57 AM, Michele Carandente wrote:
Hi Noel,
I'll explain better my problem:
I've this mailserver under a slow dial-up connection.
To fetch email from the main mailserver I use some Perl scripts, and
they are working fine.
I use postfix to queue the emails that needs to be send and then with
the command "postqueue -i" I'll send the emails that I want(they will
be relayed with smtp to the correspondent smtp server).

In this mailserver I'll have most of the emails with a @mydomain.com,
but also few emails with @gmail.com or @hotmail.com
So if I add in mail_users the email u...@gmail.com and so in
mail_domains the gmail.com, everytime that from this mailserver I'll
send an email to any @gmail.com email, postfix think that it's an
internal email and try to delivery it as virtual(Recipient address
rejected: User unknown in virtual mailbox table).

Ah, I see.
Do not add gmail.com or hotmail.com to your mail_domains. Only real local domains go there.

To receive mail locally for y...@gmail.com, add an entry to virtual_alias_maps (NOT! virtual_alias_domains) like
y...@gmail.com  y...@localhost



To say to postfix which smtp server is related with the email, I've
used sender_dependent_relayhost_maps.
So the only issue that I've is just how to say to postfix which email
is an internal one, based on the full email address and not based on
just the domain.

So I think that the alias in not helping me (but if I'm wrong please
let me know :) ).

Anyway, this is the output of postconf -n:
mailbox_size_limit = 0
message_size_limit = 30720000

That seems awfully generous for a dialup. In particular, you should put something for mailbox_size_limit.

relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = hash:/etc/postfix/relay_recipient
relay_transport = virtual

This is wrong. The relay_* parameters are for relay domains. Don't abuse them by mixing in virtual domains.
http://www.postfix.org/ADDRESS_CLASS_README.html

smtp_tls_loglevel = 2

Using a TLS loglevel of 2 will give a lot of useless and confusing information. Use 1 or 0 unless you have some strange problem to track down and you understand what the detailed logs mean.

smtp_tls_scert_verifydepth = 5

The default is 9, why do you change it?

smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, permit_auth_destination,
reject_unauth_destination

Eh?  Remove the unneeded permit_auth_destination.

smtpd_tls_ask_ccert = yes

It's wrong to set this to "yes" unless you are using certificate based relaying on a dedicated port. Some mailers will choke on this.

virtual_alias_maps =
proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf,
mysql:/etc/postfix/mysql-virtual_email2email.cf

Add your "y...@gmail.com y...@localhost" entry to one of these virtual_alias_maps files.

virtual_gid_maps = static:5000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000

OK.


Thanks a lot
Michele


http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://www.postfix.org/SOHO_README.html
http://www.postfix.org/STANDARD_CONFIGURATION_README.html
http://www.postfix.org/VIRTUAL_README.html

  -- Noel Jones

Reply via email to