I've been pulling my hair getting this to work but i have a problem with the sender_dependent_default_transport_maps:
Sending a mail via the specific postfix works like it should the correct outgoing transport is used. But when the situation is as follows:
externally received mail from somewhere (external#gmail.com) to my local (virtual) address (local#local.com) which should forward to i.e. final-destination#gmail.com doesnt get routed using the sender_dependent_default_transport_maps...
i.e. i've configured local.com to use a specific IP. Logging into the server and sending it directly works... BUT when when deliverying a relayed mail the transport is ignored...
Is there a way to adhere to the sender_dependent_default_transport_maps when relaying?
I've worked around my question: by rearranging the eth-configs i've managed to change the default outgoing IP for relayed mail...
Sigh...
Related
I am learning how to configure postfix. I would like to setup a mail relay to only forward emails for specific recipients email addresses and block, or even better redirect to the block addresses to generic account for investigation.
The relay will be used in a development environment and I want to ensure that production emails addresses are not accidentally used in development or testing. As a specific example I would like to create a list of emails address recipients that mail is permitted to be forwarded to eg:
dev#example.com
test#example.com
Block any other address that the relay is asked to forward for example.com. Ideally I would like to forward all blocked to an account check#example.com to investigate.
Could some one point me to the section of the postfix configuration file I should look into?
Thanks
Densha
You'll have to do a couple parts to the setup.
Part 1 is your allowed list. What emails are allowed to be sent out. If this list will change frequently you'll want to look into using an external lookup like mysql for this. If you use flat files in the postfix configuration directory then you'll have to restart postfix for each change. With mysql it will perform a new lookup each time, no restart. Postfixadmin is a tool that may help in this case.
For your 2nd problem of redirecting all mail to another account for investigation see this other solution.
https://serverfault.com/questions/144325/how-to-redirect-all-postfix-emails-to-one-external-email-address
Problem;
I have setup Gmail split delivery; one address stays at Gmail while all other addresses for my domain go to my hosting provider. So far so good.
MX records point to Gmail.
The hosting provider uses exim and all mail coming (routed) from Gmail is being routed back to Gmail (by the hosting provider), ultimately resulting in this error: Diagnostic-Code: smtp; A delivery loop was detected which causes this email to be undeliverable.
What I need to do is simply disable this "feature" in exim, so all incoming mail is routed to the corresponding, local, mailbox and not bounced back to Gmail.
I have been researching for a while now and I simply can't find anything to get the job done.
Ideas, suggestions, input would be greatly appreciated.
Thank you!
You must add your domain as local at hosting provider's side.
If hosting management panel has a facility to add mail domains, just use it.
I am sending email from application. My problem is when your type email address means format is correct but it may be not available anywhere.so when I am trying send such email address using SMTP through application, so how to track fail-over notification if intended recipient not found.
please suggest any approach.
There is no standard way of doing this. You might be able to make it work in some cases by parsing incoming email looking for delivery failure notices but it'll be a lot of work to keep that parsing code up to date. So at best you'll only get some of the notices. If you get a notice at all. The recipient's SMTP server may not send you anything, or the notice might get lost on it's way back to you.
The only way you are reliably get this sort of information is to host the SMTP server yourself, and deliver directly to the recipients SMTP server. In that case the SMTP server knows the status of the email's delivery and could report that to your email client via some non-standard back channel.
Note: Hosting your own SMTP server is non-trivial. And you will probably need to be on a fixed IP otherwise external SMTP servers will treat your email as spam. In case you're thinking of running one over a home connection or something.
Am developing and newsletter email software in vb.net for a friend, and he has asked me to add option to send email using dns servers,
How do i send an emai using dns server without smtp or imap?
Send email "using DNS servers" still uses SMTP. And it's generally a bad idea. Here's what it's about:
Usually, an email app (your own, Outlook, etc.) send mail using SMTP or similar protocol to a configured mail server. It could be a company's own server, or an ISP's server, or something like that. The mail may pass through various outgoing mail servers on its way out of an organisation, but at some point it hits a "boundary server" (There are pretty names for all these different types of server, but they're not important right now.)
This boundary server uses DNS to find the recipient's mail server and then sends the message (using SMTP) to that server. (I have omitted the details on purpose)
Sending email "using DNS" means that your app acts as a boundary server. It uses DNS to find the recipient's mail server and then sends the mail directly - rather than using any outgoing servers.
It's a bad idea for two reasons.
More and more ISPs block SMTP traffic that doesn't pass through their outgoing servers
More and more incoming servers validate the boundary server using various techniques. Your app is not likely to be accepted by these servers
Both of these issues are anti-spam countermeasures, so using this technique makes you look like a spammer, leaves many of your messages blocked, and is likely to get your IP address blacklisted.
Hopefully you can explain this to your friend so that they will understand that the "normal" way of sending mail is the only way to ensure that they don't get listed as a spammer.
I'm setting up an app to preform mailhooks. You create an account, assign a callback url, and a pattern to match. Then you get a subdomain that you can send email to. Something like accountname.mail.appdomain.com.
This is how it might work.
Pattern: ^(?P\w+)-reply$
Account: accountname
Callback: http://www.someotherapp.com/reply/create/
If someone sends an email to 12345-reply#accountname.mail.appdomain.com I need to be able to collect that email in I guess a catch all mailbox. Then have a background job that fetches mail and routes them based on the TO address and custom domain.
The problem I am running into is how to get the email server to accept these incoming emails. Right now I have a MX record set up that points from *.mail.appdomain.com to mx1.emailsrvr.com and mx2. When I "dig" I get the correct routing however I don't think the email server is set up to accept the incoming mail.
If this is not possible another option I have been playing with is creating a python smtp server using the built-in smtp lib. All this server would do is accept incoming requests to port 25 and place the mail in a queue. I have that working fine I'm just worried that not using a real smtp server might create problems.
BTW: The main server will be running on slicehost, if that matters.
ALSO: This server is not going to be sending email from these custom domain, if that matters.
What you need is a dynamic configuration of your mail server, right? Then this depends on your mail server capabilities.
If you use Postfix then you could add virtual domain setup being configured in MySQL tables. Or other databases. From within your application you then only need to add/remove rows in these tables to accept only the valid domains.
Same goes for Exim which is even more extensible.