On Oct 3, 2008, at 2:49 AM, Wietse Venema wrote:

Johan Ström:
Hi

I got a situation where I need to relay ALMOST all mail through
another mail server. The catch is that I want a few specific sender
mail addresses to send directly from the postfix itself (as if I
didn't have a relayhost directive). I've fooled around woth
sender_dependent_relayhost_maps and tried to get it to work, but I've
yet to hit a solution.

So, basically, I want something like this:

main.cf
relayhost = [mail.somehost.com]
sender_dependent_relayhost_maps = hash:mapmap

mapmap:
[EMAIL PROTECTED] <something here that makes it skip relayhost>


I've tried with using blank "smtp:" without success, also tried
skipping global relayhost, setting blank value for above and adding *
[mail.somehost.com] in the end of the file, bu tno succes..

Any hints?

See the mailing list welcome message:

TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail


Okay, sorry. I guess it was the config that was missing.
The system is configured for virtual accounts (mysql), and in the aliases file i only got a root: [EMAIL PROTECTED] All incomming mail goes to entrys in vmd/vmm maps (just regular mysql lookups), and currently all mails goes out from this machine too. What I'd like, as I said above, is to send MOST outgoing mails through one relay, but from a few specific senders I want this machine to keep sending them directly (using MX lookups etc).

# postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = DD.DD.DD.DD
local_recipient_maps = $alias_maps
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 20480000
mydestination = ns1.NNNNNNN.com,mail.NNNNNNN.com
mydomain = NNNNNNN.com
myhostname = mail. NNNNNNN.com
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /usr/local/etc/postfix/smtp.pub.pem
smtpd_tls_key_file = /usr/local/etc/postfix/smtp.key.pem
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:vam
virtual_gid_maps = static:340
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:vmd
virtual_mailbox_limit = 0
virtual_mailbox_maps = proxy:mysql:vmm
virtual_minimum_uid = 340
virtual_transport = dovecot
virtual_uid_maps = static:340
#

I hope this is enough informaiton. And again to clarify, I just want some pointers on how this could be solved.

Thanks!

--
Johan

Reply via email to