Hot answers tagged

67

Check if opendkim is running. (I assume it is as you saw the socket file.) Did you configure opendkim? The configuration file is /etc/opendkim.conf. You need to update the file to match your site/domain and dkim.key path. Add postfix to opendkim group If opendkim.sock permission is as follow $ ls -l /var/run/opendkim -rw-rw-r-- 1 opendkim opendkim 6 May ...


48

To disable the messsage, go to /etc/postfix/main.cf and change from: inet_protocols = all to: inet_protocols = ipv4 This will only use ipv4 and the warning message will go away. You will have to issue a stop and start for postfix to register the change. A simple reload will yield: mail postfix/master[8330]: reload -- version 2.9.6, configuration /etc/...


37

It's not actually a problem, just a warning that can seem alarming to new users. A NIS (Network Information System) allows "a group of machines within an NIS domain to share a common set of configuration files." Basically, if you're running email servers on more than one box, you can share config files between them. In this case, since you are just running ...


21

The myhostname should be set to the FQDN of your mail server. For example, if your server's hostname is "mail" and your domain is "example.com", your FQDN is "mail.example.com". The directive would look like this: myhostname = mail.example.com On a Linux system, you can get your FQDN using the hostname command: hostname --fqdn This should match the PTR ...


17

That error message is appearing because the mail client is sending only a bare hostname ("PLLAMNAZIFE") rather than a fully-qualified hostname (e.g. "PLLAMNAZIFE.example.com") in the HELO/EHLO part of the SMTP transaction, and your Postfix server is configured to reject such mail. Many mail client programs do not send correctly formatted, fully-qualified, ...


14

Quick summary that helped me to fix this warning on Ubuntu 16.04 LTS: Postfix version 3.1.0-3ubuntu0.2 Opendkim version 2.10.3-3build1 (I assume that Postfix and Opendkim are already installed, integrated with each other and the only warning you are getting is 'connect to Milter service local:/var/spool/postfix/opendkim/opendkim.sock: No such file or ...


14

WARNING: The request does not follow best security practice because you disable TLS (encryption) on your main mail relay port, exposing data sent through that port to third-party listeners and/or in-flight modification. The answer below satisfies the request, but best practice requires STARTTLS for the port 25 connection as well. The master.cf file (usually ...


12

Pravin offers some good general points, but doesn't really elaborate on any of them and doesn't address your likely actual problems. First, you need to find out how postfix is receiving those messages and why it's choosing to relay them (the two questions are very likely related). The best way to do it is by looking at the message ID of any one of the ...


12

Cristian's comment is correct: you need a trailing slash to make Postfix store incoming mail in Maildir format: home_mailbox = Maildir/ If you leave it off, it stores the mail in an mbox-style file of the same name. That is to say, this is not a setting where you are providing the name of a type of storage, you are providing the name of a file or ...


12

Have a look at the smtpd_sender_restrictions and smtpd_sender_login_maps settings. The former can prevent malformed from addresses, while the latter can force the sender address to match the login name. # Prevent malformed senders smtpd_sender_restrictions = reject_non_fqdn_sender # Ensure correct mail addresses reject_unknown_sender_domain # ...


11

When you delete mail.log file, rsyslog (on ubuntu) loose handle to file. To get it working back on Ubuntu, please give: sudo service rsyslog restart This will not only create new file but also start to write logs.


10

After much digging, I realized that the problem was that I always exited from mail using either exit or x. From the Ubuntu man page: exit (ex or x) Effects an immediate return to the shell without modifying the user's system mailbox, his mbox file, or his edit file in -f. So if you're trying to delete your emails and you use ...


10

I had similar problems with Thunderbird on Mac OSX and a new StartSSL cert. Thunderbird uses OCSP to validate the certificates and fails silently in this special case. Additionally the StartSSL OCSP server need some time to update the catalogue of known certificates (compare with https://forum.startcom.org/viewtopic.php?t=2654). To check if OCSP is the ...


10

Debian or Ubuntu sudo service postfix status


10

Best bet is to use a service like uptime robot. Free tier will cover less than 50 sites, pro plan is quite cheap. It'll do a simple ping check or even HTTP status code check The upshot of this is that you're not adding an additional point of failure (that you can control). You've no longer got to maintain and update a monitoring service


10

The formail tool from procmail (available in any distribution, it's a classic) is designed precisely for this purpose. Basic usage: formail -s myprogram --option runs myprogram --option on each mail in turn. The program receives each mail on its standard input.


9

You don't have IPv6 configured in your OS's network stack, but your mailer (presumably postfix) is configured to use IPv6. Since there is no IPv6 for your mailer to use, it's warning you that it's only going to use IPv4. From the postfix readme: if you see error messages like the following, then you're running Linux and need to turn on IPv6 in the kernel: ...


8

You can bypass HELO restrictions for authenticated users by inserting permit_sasl_authenticated before rejecting rules in the smtpd_helo_restrictions list: smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, permit


8

The first thing to do in case of SMTP problems where the configuration seems to be OK is that you can actually reach the SMTP server. Use: telnet gmail-smtp-in.l.google.com 25 you should see: Trying 173.194.69.27... Connected to gmail-smtp-in.l.google.com. Escape character is '^]'. 220 mx.google.com ESMTP lv5si9142984bkb.114 - gsmtp (after that type ...


8

The correct procedure to execute a script (I use a shell script) upon receipt of a mail message is the following. It involves modifying postfix's configuration file, master.cf (which, in my Debian, is located in /etc/postfix) by adding the following line: my_shell_script unix - n n - - pipe flags=F user=MY_USERNAME argv=/path/to/my/shell/script ${sender} ${...


7

Check out this tool Fail2Ban, it scans log files for malicious activity and fires off an event. There is bottled event handlers like creating a firewall to reject the offending IP, or you can make your own custom event handlers.


7

Unfortunately, this isn't super straightforward in postfix, but certainly doable. /etc/postfix/main.cf, set header_checks to: header_checks = regexp:/etc/postfix/my_custom_header Then create /etc/postfix/my_custom_header and put this regular expression in it: /^Content-Transfer-Encoding:/i PREPEND Precedence: bulk Then restart postfix - depends on your ...


7

Postfix has not been hacked. The vulnerability is in the isyfoyvr.php script, which has allowed a code injection. The injected code is sending emails, and since Postfix sees the emails sourced from localhost it accepts them as legitimate. Probable quick fix Remove the isyfoyvr.php script, or set its permissions so that the web server cannot execute it. ...


6

To do what OP need, we need a check at transport level, which turn out to be simple. Add following line to /etc/postfix/main.cf sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport_maps Create /etc/postfix/sender_transport_maps as follow user@local.domain discard Create postfix map file and restart postfix cd /etc/postfix ...


6

There are several ways to do this Using SSMTP: You can find a detailed article here. (Please consider Zulakis' comment below regarding security: I let ssmtp solution here for your knowledge, but prefer postfix solution) Install ssmtp sudo aptitude install ssmtp Edit the configuration file: sudo vim /etc/ssmtp/ssmtp.conf And configure it with your ...


6

The message "... is not yet authorized to deliver mail from ..." is similar to a greylist implementation described in Adding Greylisting Support. If the destination server implement similar script, you can send your mail by flushing your queue to retry sending soon. $ postqueue -f The greylist implementation works as follows; If a mail come from an ...


6

This was my final solution after research and help from @tarleb My mail delivery was happening over sendmail program, which was adding some additional headers to my email. I could use a mitter (mail filter) to filter incoming email and drop the sendmail usage, however I decided to change to Dovecot LDA for the delivery. My original filter was, at the ...


6

postfix uses procmail, to deliver email, and as postfix invokes procmail running as nobody for security reasons, emails sent to root will end up being sent to the nobody user. Debian mailing lists explain it better than me, and suggest a work around: postfix's own delivery agent can deliver to root's mailbox, but postfix will NEVER fork an external ...


6

procmail is considered problematical by Philip Guenther (and is quite possibly useless in this case, as .forward files or equivalent can send the mails directly to your program, skipping the thus needless complexity of procmail). Executive summary: delete the procmail port; the code is not safe and should not be used as a basis for any further work. ...


5

I used to have the same problem: root@medusa:~# postqueue -p -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 079AC700080B 357 Wed Apr 3 13:47:47 root@medusa.yyyy.cz (Host or domain name not found. Name service error for name=xxxx.cz type=MX: Host not found, try again) hmls@xxxx.cz .. root@...


Only top voted, non community-wiki answers of a minimum length are eligible