Tag Info

openDKIM and Postfix on Ubuntu Server 12.04LTS
I'll try to come back and format this better. But since there was a request to post my answer, I wanted to post it now rather than wait until I had time to format it properly. Due to lack of time, I wrapped my entire answer in a blockquote. I hope this solution is helpful.
These are my references:
man ...

They should be in /var/log/mail.log. However, it appears that your syslog facility configuration was changed by you (or your provider). Using the plain syslogd instead of rsyslogd is very much possible, but then you can expect things to work different to your expectation.
As already mentioned in the comments, by installing rsyslog, the files reappeared.

It would appear that you have configured smtp.gmail.com as your smarthost for the mail server. You need to remove the smarthost configuration or edit it so that your server is at all capable of sending mail to the outside world.
The configuration you have now for the mail forward appears to be working, but is failing because smtp.gmail.com is rejecting the ...

In your php.ini, this:
sendmail_path = /etc/postfix
Should be the path to the sendmail (or compatible) binary.
You've set it to the configuration directory of postfix which isn't right.
For historical reasons, usually /usr/bin/sendmail is maintained as a compatibility link.
sendmail was around first (I guess) and pretty much everything just assumes it is ...

There are a lot of guides online regarding the config and steps for 'hardening' postfix.
This one courtesy of http://security-24-7.com/hardening-guide-for-postfix-2-x/
Hardening guide for Postfix 2.x
Make sure the Postfix is running with non-root account:
ps aux | grep postfix | grep -v '^root'
Change permissions and ownership on the destinations ...

Postfix is a drop-in sendmail replacement that includes its own sendmail binary (see the foot of this post). I'm honestly surprised apt let you do this, I thought they were package conflicted.
Anyway, to fix:
sudo apt-get purge sendmail
sudo apt-get install --reinstall postfix
sudo /etc/init.d/postfix restart
Proof that sendmail on my system is ...

"Bounce" emails are sometimes part of a spam attack, though I doubt this is the case in your instance.
550-XX.XX.XX.XX blocked by ldap:ou=rblmx,dc=att,dc=net 550 Error - Blocked for abuse.
This leads me to believe that your server IP has made a blacklist - particularly one with att.net. I would check your domain on mxtoolbox.com and check that you're not ...

Postfix is started in init.d, so you can use update-rc.d to disable it on startup:
sudo update-rc.d postfix disable
When you want to enable it again:
sudo update-rc.d postfix enable
Even if it's disabled you can still start it manually with sudo service postfix start.
If update-rc.d is not in your system, you'll have to install the package ...

You can handle this with a transport map. First tell postfix to use a map, with the following in main.cf:
transport_maps = hash:/etc/postfix/transport
Then in /etc/postfix/transport add the custom route:
example.net smtp:example.net:26
Then build the map database:
sudo postmap /etc/postfix/transport

The standard solution is to use the header_checks option. This will work, however, if we filter received lines on all mail both incoming and outgoing (as this will do), we could potentially lose Received headers on mail sent to us, which can be important for troubleshooting. To get around this problem, we will apply the header_checks only to the mail that ...

For me the solituion was a variant of Oli answer in an Ubuntu13:
Error: fatal: bind 0.0.0.0 port 25: Address already in use
Sendmail purge didn't work:
Package 'sendmail' is not installed, so not removed
So I tried:
service sendmail stop
sudo apt-get install --reinstall postfix
and worked!

No. As default postfix is not configure as an open relay, it will only accept local mail.
And you don't want to configure it as an Open Relay. In a couple of days some spammer is going to find it and start using it. As a result:
Your computer is going to be bogged down sending thousands of emails.
Your server is going to be blocked by most other mail ...

You can send an email with one command like this:
mail -s 'Subject' you@example.com < log.txt
mail expects a stream of input, if there is none, it gets standard input (i.e. it let's you type something). The < operator (unix file-stream) tells mail to read the contents of the file, rather than /dev/stdin (which is just a file as well).
Adding an ...

I had the same issue and when I issued "postconf |grep smtp|grep CA" all the variables were empty:
smtp_tls_CAfile =
smtp_tls_CApath =
smtpd_tls_CAfile =
smtpd_tls_CApath =
Here's how I fixed it;
I assume your Ubuntu install created the CA path that contains all known CAs on the internet: /etc/ssl/certs, and Equifax is there.
All you're missing in ...

It seems very stupid but I have solved the problem. I hadn't noticed that a system administrator somehow blocked 3306 port for all hosts at the firewall, and therefore I couldn't connect to mysql. After removing that restriction I was able to connect to mysql without any problems. Thanks for your suggestions and help.

You need to enable TLS in Postfix's SMTP client, since Google requires it. This is indicated by them in the message "Must issue a STARTTLS command".
In /etc/postfix/main.cf, you want something like this:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
and then in /etc/postfix/tls_policy:
[smtp.gmail.com]:587 encrypt
The left hand side in ...

Beware of putting /var/spool/ on tmpfs!
User CRON JOBS are stored under /var/spool/ on Ubuntu!
If you put /var/spool/ on tmpfs you will not be able to have any user cron jobs because they will be erased on every shutdown.
The system crontab however is located in /etc/crontab and is edited directly NOT with the crontab -e command. found this out the hard ...

I guess you could use a virtual.
If example.com is your domain on postfix
on /etc/postfix/main.cf
virtual_alias_maps = hash:/etc/postfix/virtual
on /etc/postfix/virtual
root@example.com dave
after edit
postmap hash:/etc/postfix/virtual
Should be working.
If i understood right your question, know mails to root@example.com wil go to local ...

From [1] pg 832
Another parameter we should set is mydestination, which specifies the
mail domains that are local.
The changes which are relevant to my question:
Change the mydestination setting in /etc/postfix/main.cf to be blank.
mydestination =
run
sudo postfix reload
[1] Unix and Linux system administration handbook, 4ed, ...

Good! I figured this out from the post mentioned in the question. I made a kind of mix between the answer itself and the links provided in it. Specially the fourth link is the one I used.
So the thing goes like this. Suppose you've got a server or VPS and make one of your domains to be the main domain and be used as the server name (in my example: ...

Nuke it in orbit! Your server was compromised, I wouldn't try to "repair it" but plainly starting from 0 and then prevent it gets compromised again.
You can check our network paranoids security experts counsels at Information Security.
Related:
How do you know your server has been compromised?
Prevent from happening again:
Determining the point of ...

You need to quote the arguments to test to stop them 'breaking' on whitespace, i.e. if
$ var1="sudo apt-get install postfix"
then
$ if test $var1 = sudo apt-get install postfix; then echo "Match"; fi
bash: test: too many arguments
but
$ if test "$var1" = "sudo apt-get install postfix"; then echo "Match"; fi
Match
The same applies if you use the [ ...

You are right on both.
They are standard spam attempts, and postfix is denying relaying to them. If these are your full logs, then you are lucky if you are only seeing that few attempts per day.
You can still harden it quite a lot, using SSL for example, but it didn't look like you need it.
You can change this to main.cf to force all the clients that want ...

You can change it in postfix configuration file /etc/postfix/main.cf.
The helo line is controlled by the smtpd_banner parameter. It probably references the myhostname option. Put your server name there instead of localhost:
myhostname = server.example.com
smtpd_banner = myhostname
and restart postfix with sudo postfix reload.

To answer my own question, using postfix this is possible. You have to do two things:
Add the configuration options discussed in SMTP server to deliver ALL mail to user@localhost, add the following to your /etc/postfix/main.cf file:
luser_relay = MYLOCALUSER@localhost
local_recipient_maps =
Using the following answer on serverfault ( ...