I tried everything, I read online to test, and I can't get email to go out:
telnet <IP> 25 EHLO MAIL FROM: <from-email> RCPT TO: <recipient-email> DATA Type message here. . <Enter> =>
I even tried this, and when I type the period, I get nothing - but postfix is installed.
In this step, you'll test whether Postfix can send emails to an external email account using the mail command, which is part of the mailutils package that was installed in Step 1. To send a test email, type: echo "This is the body of the email" | mail -s "This is the subject line" your_email_address.
Postfix configuration. You can run command postconf -n and it will show postfix config in action!
Check configurationRun the postfix check command. It should output anything that you might have done wrong in a configuration file. To see all of your configs, type postconf . To see how you differ from the defaults, try postconf -n .
To check whether postfix is running or not
sudo postfix status
If it is not running, start it.
sudo postfix start
Then telnet to localhost port 25 to test the email id
ehlo localhost mail from: root@localhost rcpt to: your_email_id data Subject: My first mail on Postfix Hi, Are you there? regards, Admin .
Do not forget the . at the end, which indicates end of line
(I just got this working, with my main issue being that I don't have a real internet hostname, so answering this question in case it helps someone)
You need to specify a hostname with HELO. Even so, you should get an error, so Postfix is probably not running.
Also, the => is not a command. The '.' on a single line without any text around it is what tells Postfix that the entry is complete. Here are the entries I used:
telnet localhost 25 (says connected) EHLO howdy.com (returns a bunch of 250 codes) MAIL FROM: [email protected] RCPT TO: (use a real email address you want to send to) DATA (type whatever you want on muliple lines) . (this on a single line tells Postfix that the DATA is complete)
You should get a response like:
250 2.0.0 Ok: queued as 6E414C4643A
The email will probably end up in a junk folder. If it is not showing up, then you probably need to setup the 'Postfix on hosts without a real Internet hostname'. Here is the breakdown on how I completed that step on my Ubuntu box:
sudo vim /etc/postfix/main.cf smtp_generic_maps = hash:/etc/postfix/generic (add this line somewhere) (edit or create the file 'generic' if it doesn't exist) sudo vim /etc/postfix/generic (add these lines, I don't think it matters what names you use, at least to test) [email protected] [email protected] [email protected] [email protected] @localdomain.local [email protected] then run: postmap /etc/postfix/generic (this needs to be run whenever you change the generic file)
Happy Trails
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With