Re: Transport mapping via mySQL?

2016-11-09 Thread Jan Johansson
>It's actually quite simple: >1) Create a file with the MySQL credentials and the query >2) Include the created file in transport_maps within main.cf > >/etc/postfix/mysql_relay_transport_maps.cf > user = dbuser > password = dbpass > dbname = maildb > hosts =

Transport mapping via mySQL?

2016-11-07 Thread Jan Johansson
Hello! problably a silly question, but I cannot seem to find an example of obtaining transport mapping via mySQL. Is that even possible? (CentOS 7 with 2:2.10.1-6.el7)

RE: "Simplest" approach to full-adress aliases?

2012-11-18 Thread Jan Johansson
>That has nothing to do with how postfix percieves the domain. Understood. As i stated in another reply, the box perceives them all as relay_domains.

RE: "Simplest" approach to full-adress aliases?

2012-11-18 Thread Jan Johansson
>I think you read too much into the question. The OP appeared to asking about >basic virtual_alias_maps use; nothing was said about how/whether to accept the >mail. Maybe it's already being accepted under >permit_mynetworks, or via >sendmail(1)? Basically the box is set up to relay to other box

RE: "Simplest" approach to full-adress aliases?

2012-11-18 Thread Jan Johansson
>NOTE that domainALPHA.com must be in an address class you control: >relay, local, or virtual_*. > >The presence of the alias alone does not mean mail for the domain is accepted. That I gathered. The box is a MX for the domains in question.

RE: "Simplest" approach to full-adress aliases?

2012-11-18 Thread Jan Johansson
>That's what $virtual_alias_maps [1] is for. > >Add the following line to main.cf: > >virtual_alias_maps = hash:/etc/postfix/virtual > >Create a file /etc/postfix/virtual with the mappings you need: That seem simple enough... Looks like I was over complicating the issue. Thanks!

"Simplest" approach to full-adress aliases?

2012-11-17 Thread Jan Johansson
Hello! Having mostly used Exim I am trying to sort out a few things with a postfix (2.8.5-2~build0.11.04 on Ubuntu) install. Basically, I want a forwarding mechanism that can map us...@domainalpha.com to anotheru...@anotherdomain.com

SV: Cleaning out certain 4xx-errors

2012-09-21 Thread Jan Johansson
>In a Postfix pcre_table(5) you must have a space between the >expression closing delimiter, "/" above, and the SMTP code (or >access(5) keyword). Your "551" would thus be misinterpreted as >unknown PCRE flags. Gotcha. Thanks. I read that slightyl backwards at first >You obviously must fix that p

RE: Cleaning out certain 4xx-errors

2012-09-20 Thread Jan Johansson
Jan Johansson: >> >/^451 PLESK reply text here/ 551 5.2.2 Mailbox full > ^SPACE HERE > >> >Make the PCRE pattern as specific as possible, so that it matches only >> >PLESK responses. >> >> I must be missing

RE: Cleaning out certain 4xx-errors

2012-09-20 Thread Jan Johansson
>>Make the PCRE pattern as specific as possible, so that it matches only PLESK >>responses. > >I must be missing something, but with the following pcre-entry > >/^451 4.5.1 Mailbox full/551 5.2.2 Mailbox full > >Everything gets rejected with: >Sep 20 23:19:03 laundromat postfix/smtpd[4083]: NOQUEU

RE: Cleaning out certain 4xx-errors

2012-09-20 Thread Jan Johansson
>Otherwise you can try to use the smtp_reply_filter feature. This is an >incedibly sharp knife for desperate situations. Use at your own risk. > >Untested example: > >/etc/postfix/main.cf: >smtp_reply_filter = /etc/postfix/smtp_reply_filter.pcre > >/etc/postfix/smtp_reply_filter.pcre: ># T

RE: Cleaning out certain 4xx-errors

2012-09-16 Thread Jan Johansson
>Maybe PLESK has an option to make "mailbox full" a hard error (to be honest, >Postfix's own "mailbox full" action is not configurable). No it appears from googling that this is a "know irk" of the PLESK-community. >Otherwise you can try to use the smtp_reply_filter feature. This is an >incedi

Cleaning out certain 4xx-errors

2012-09-15 Thread Jan Johansson
Ok, I am seeing a lot of mail on one of our machines. They are all headed for a few servers running PLESK. It appears that (from google'ing) that this software generates a 451 error when a recipients mailbox is full It is possible to have postfix kill of these messages and treat a 451 from cert

SV: Mysql alias and "loops back to myself".

2012-06-12 Thread Jan Johansson
>query = select forwards.destination,users.email from forwards,users where >(forwards.user_id = users.id) and forwards.active and forwards.destination = >'%s'; maayyyb because I was still selecting two fields ... *sigh* sorry.

Mysql alias and "loops back to myself".

2012-06-12 Thread Jan Johansson
Ok, I have a bit of a problem with mysql aliases... user = dbuser password = dbpass dbname = c1mailforwards query = select forwards.destination,users.email from forwards,users where (forwards.user_id = users.id) and forwards.active and forwards.destination = '%s'; select_field = forwards.desti

SV: SV: SV: "Redirecting" all, but two, domains.

2011-03-25 Thread Jan Johansson
>The "*" entry is not required, that's what "default_transport" is for. If >you want non-default nexthops for the relay_domains, just use the default >setting of "relay_transport = relay" without an explicit nexthop. Hello! Your original suggestion has now been tested, but there is some issue w

SV: "Redirecting" all, but two, domains.

2011-03-22 Thread Jan Johansson
>Everything I suggested is standard transport behaviour. Well, granted. Maybe i should have said "The rest is trivial". Your suggestion about the pcre/pot 10035 was definitely over _my_ Postfix horizon.

SV: SV: SV: "Redirecting" all, but two, domains.

2011-03-22 Thread Jan Johansson
>The "*" entry is not required, that's what "default_transport" is for. If >you want non-default nexthops for the relay_domains, just use the default >setting of "relay_transport = relay" without an explicit nexthop. So in other words I should say "Thanks for the rewrite-recepie, that one I would

SV: SV: "Redirecting" all, but two, domains.

2011-03-22 Thread Jan Johansson
A bit of a goof there... domain-a.se : domain-b.se : * smtp:[127.0.0.1]:10035 Från: owner-postfix-us...@postfix.org [owner-postfix-us...@postfix.org] för Jan Johansson [j...@mupp.net] Skickat: den 22 mars 2011 08:22 Till: postfix-users@postfix.org Ämne

SV: SV: "Redirecting" all, but two, domains.

2011-03-22 Thread Jan Johansson
>This is easy. > >How does Postfix decide the nexthop for a given domain? What controls >do you have? I suppose a transport map in the ways of .domain-a.se : .domain-b.se : * smtp:[127.0.0.1]:10035 In addition to your recepie should work? (Domain-a and domain-b being the "normal" domains?)

SV: "Redirecting" all, but two, domains.

2011-03-21 Thread Jan Johansson
>main.cf: > relay_domains = example.com > relay_transport = relay:[mail.example.com] > default_transport = smtp:[127.0.0.1]:10035 > smtpd_restriction_classes = redirect_all > > retable = pcre:${config_directory}/ > redirect_all = check_client_access ${retable

"Redirecting" all, but two, domains.

2011-03-21 Thread Jan Johansson
I've been playing around with this for a bit, but I cannot find a smooth'n'easy way to do it... Basically we have a server that is primarily a testing environment for a couple of web based applications. These applications send mail. (Big surprise) These applications have a config switch whic

SV: "Sorting" mail between different servers?

2011-01-10 Thread Jan Johansson
>It is best used that way, especially if per-user lookups involve LDAP, MySQL >or similar. A more complex, but more performant solution is to rewrite each >type of user to a suitable domain that is routed to the >r>ght place. Then, if >absolutely necessary use smtp_generic_maps to rewrite back t

SV: MS AD integration

2011-01-09 Thread Jan Johansson
>hi all >is there any way to postfix could query the mail users directly from Active >Directory? >what is required for this >Thanks Sure, plenty of ways, but do you _really_ want this? The reason I myself prefer to periodically transfer a dump of all proxy-addresses from the AD/Exchange enviro

SV: Evaluation order of transport_maps?

2011-01-09 Thread Jan Johansson
>By definition you can't have that in a hashed file, *SQL database, or LDAP. >Other Postfix lookup tables such as regexp or pcre will return the first >match, as documented. Come to think about it. That makes sense. Sorry about that. So, in the meantime, a dirty workaround is to do it like this

Evaluation order of transport_maps?

2011-01-09 Thread Jan Johansson
Let's say that for various reasons a system ends up having two identical entries in transport maps. Is there a fixed logic as to which takes precedence? As an example (I entered my own address instead of the address in question): j...@mupp.net smtp:mail.kontinuitet.com j...@mu

Order of policies?

2011-01-09 Thread Jan Johansson
I have the following config: smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination check_policy_service inet:127.0.0.1:10031 I assumed that it would mean that any attempt to send a mail to a recipient that is not a valid destination would be immediately rejected, and if the

RE: "Sorting" mail between different servers?

2011-01-08 Thread Jan Johansson
>/etc/postfix/main.cf: >transport_maps = hash:/etc/postfix/transport > >/etc/postfix/transport: >someu...@example.com smtp:[172.31.254.160] >otheru...@example.com smtp:[172.31.254.150] > ># postmap /etc/postfix/transports ># postfix reload Thanks. I got the answer a bit ear

RE: another stupid question about exporting valid users from windows 2008 domain to postfix valid users map

2011-01-08 Thread Jan Johansson
>Does this still works for windows 2008 ad? : >http://postfix.state-of-mind.de/patrick.koetter/mailrelay/#d0e149 > >or is there better way to do it? It does not work with Exchange 2010SP1 in a 2008R2 environment at least. I use a slightly modified version of https://exchangepedia.com/blog/stuff/

RE: "Sorting" mail between different servers?

2011-01-08 Thread Jan Johansson
>You could possibly use transports for this: > >http://www.postfix.org/transport.5.html I have looked at that, but I was not aware that you could enter complete mail addresses there, I thought it was (sub) domain only. But, the documentation seem to be pretty clear. :) I will look closer into

"Sorting" mail between different servers?

2011-01-08 Thread Jan Johansson
A customer is migrating their mail environment, and in the interim a bit of trickery is needed. They are currently using a Postfix+Mailscanner machine as a gateway per the http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall Now, how would I realize a scenario where SOME users of