Postfix for BCC send emails? - email

I was wondering if its possible to forward all the sent emails using Postfix Forwarder package or is there another package that can do that?
I would like to use postfix forwarder on pfSense which already has the package version 2.4.6
Currently the company uses godaddy domain with the workspace emails and they use pop because it saves the pst files while IMAP saves the sent on the server, but there is limited space. And on the godaddy workspace email I can forward all the inbox emails to another email no issue just the sent part cannot. I also called godaddy to see if they could guide me though they did tell me i would need to add the mx records with the email and password of the account i would want to BCC the send emails on the configuration of postfix forwarder. While someone else on another forum did mention that i would need to change my mx records to point to my WAN ip (pfsense) but not sure why or am i understanding incorrectly?
See picture for example
Thank you
enter image description here

This isn't the place to post this kind of question, but look into the always_bcc option in Postfix.
http://www.postfix.org/ADDRESS_REWRITING_README.html#auto_bcc

Related

Email server to receive email from any account within domain and ideally alias

I'm currently testing some complicated functionality in a web app that involves multiple accounts within the app; each with its own unique email address. I have a few temp gmail accounts that I'm using for this purpose, but keep having to update email addresses in the database to something else for some accounts in order to reuse email addresses. It gets meesy very quickly.
My question is; is there a way I can setup an email server on my VPS (Ubuntu 16.04) that is able to accept all email addresses on a given domain without me having to define each one in advance? Ie; I'd like to be able to make up email addresses as I go; test1#mydomain.com, test2#mydomain.com, etc, and have the server receive AND store any incoming emails to those addresses. Emails include account verifications, notifications, etc, and I need to know what is being sent to each participant at each point in each workflow as I test.
Ideally I'd like some way to view all of these emails on the domain regardless of address. Perhaps setting up an alias using some kind of wildcard so that all incoming email go to a single address that I can configure in my email client on my dev machine.
Consider rewriting envelope recipient x#subdomain.example.net to handler+x#example.net
AFAIR sendmail, postfix and exim support such rewrites. AFAIR all three support passing +detail as parameter to procmail script (to ~handler/.procmailrc as $1).
WARNING: test handling message to multiple special recipients.
Post which specific SMTP/MTA server do you use if you want more hints.
Gmail also supports plussed addresses BUT you get reliable hint about original recipient only for message to single special/plussed recipient.
After a lot of research and messing about with different configurations, I found the best solution for me was PostFix with Dovecot.
I was able to set up virtual mailboxes in PostFix with virtual_mailbox_maps pointing to a file that contained this; #mydomain.com mydomain.com/catchall/
This allows mail to any email address within the domain to go to one mailbox. The mydomain.com/catchall/ is a location on the server where the mailbox is located. By convention, the domain is used in the path. Useful if you are hosting email on multiple domains. Dovecot supports variables in the config which allows you to point it to the correct mailbox.
I also found that the PostFix main.cf file must have mydestination = localhost for this configuration to work.
the following posts helped me getting this up and running;
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot
https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-14-04

Postfix Mail Relay - Only permit sending to specific emails

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

PHPMailer hosting site using 123-reg

basically I'm hosting my site on 123-reg and have a contact form on my site which i want people to send me emails to my live.co.uk email address, i was using the basic php mail() but found all emails are constantly going into junk folder which i rather it go into inbox so was told to use phpmailer
looking into phpmailer i get to the code which asks for smtp but I'm lost with this as I'm not sure what i should be putting for the host username and password as i want the website to send emails to a given email address , any advice on what i should be putting this and why would be great
Thank You
You don't need to use SMTP - you can use a local mail server and call isMail() instead of isSMTP() - though you don't even need to do that since it's the default. In the examples folder provided with PHPMailer, look at the one called mail.phps.

Mail sent from my website going to gmail spam folder when including a link

Whenever i try to send a mail from my website for email verification, the same is being received in a spam folder. I noticed that plain messages are being received in inbox, but whenever i try to include an ordinary http link[http://abcd.in/abcd/verify.php?key=2f27feb552c83c6c65b9bfc4d799e775], the mail goes to the spam folder. Cant point out the reason why this is happening. Please help me to resolve this issue.
Thanks All
From experience, I know that the spam score can be affected when hyperlinks have an alphanumeric argument tagged onto the end. I suggest trying to reformat the URL into something like;
http://abcd.in/abcd/f27feb552c83c6c65b9bfc4d799e775/verify.php
and extracting the reference using a Regex or Split()
Is your outgoing mail server configured to receive mail?
Are you using a proper mail server with proper setup at all or some bulk-mail-sending dud?
Are your mails sent with a real from address? And I don't mean the header-from that you can add in your software, but the protocol-from that is being used by sendmail
Do you have domain keys/dkim set up for your mail server?
Is the header OR the protocol from address from a different domain? Do they have set up domain keys allowing your mailserver?
Does your mail server feature the same domain name on the reverse lookup?
Does your mail server offer to receive mail for the user they are sending for?
Is your webhost using a smart relay? Do they rewrite the from: address?
Or do you send mails with internal mail address from?

Can't receive emails send from php

I have set up several email accounts on my vps hosting but I can't receive any emails that are send via php from another hosting. Everything works fine when I send emails from gmail for example, I receive them without a trouble. Does anyone know any reason why emails sent from php can't be received?
Try using phpmailer, it's a good mailing class which automatically sets well defined headers so that the mail is more likely to not land in the spam folder.
Sounds like a spam filter issue. Have you set up a proper Sender ID/SPF framework in your domain name service so that the host appears to be a valid MTA for this domain? Look here for a detailed explanation of Sender ID/SPF/DKIM, etc.
Check your spam folder.
GMail is able to differenciate if a mail has been sent from outlook for example or an automated application. (I dont know how, but they can). If i send an email from my work account to GMAil works, if its a web app or executable with the same email adress, it ends up on the spam folder.