LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Send email from server failure (https://www.linuxquestions.org/questions/linux-newbie-8/send-email-from-server-failure-4175669019/)

hatfani 02-05-2020 04:59 AM

Send email from server failure
 
Dear all,

I am trying to send an email to my gmail account by this command
Code:

sendmail user@example.com  < /wall.txt
wall.txt input:
Hi it's me
bye

anyhow, at first it gave me this error:
postconf: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol.
So I change inet protocols in /etc/postfix/main.cf from "all" to "ipv4" and ran a restart
Code:

service postfix restart
After the restart, I used my sendmail command again and it didn't give any error but I also didn't receive any email.
I tried to use other commands like mail, mailx to no avail.
Any help?
Thank you.

berndbausch 02-05-2020 05:49 AM

On my server, the log file is /var/log/maillog. Could be configured differently on yours, but it should be your first step to check the mail log. Perhaps also the system log.

EDIT: Debugging guide http://www.postfix.org/DEBUG_README.html. Also: Did you follow one of the setup guides, such as the standard setup http://www.postfix.org/STANDARD_CONF...N_README.html?

TB0ne 02-05-2020 09:15 AM

Quote:

Originally Posted by hatfani (Post 6086420)
Dear all,
I am trying to send an email to my gmail account by this command
Code:

sendmail user@example.com  < /wall.txt
wall.txt input:
Hi it's me
bye

anyhow, at first it gave me this error:
postconf: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol.
So I change inet protocols in /etc/postfix/main.cf from "all" to "ipv4" and ran a restart
Code:

service postfix restart
After the restart, I used my sendmail command again and it didn't give any error but I also didn't receive any email.
I tried to use other commands like mail, mailx to no avail.

Have you ever been able to send mail from this server?? How do you have postfix configured to relay mail upstream to another server/host? Because unless you're running your own mail server (which is an ENORMOUSLY complicated task), you need to tell postfix to send mail onwards to another system that can handle and deliver it. Otherwise, mail won't go anywhere.

You don't tell us anything about your environment, what other servers are in play, your network, etc., so there's not a lot we can tell you. There are many how-to guides on how to easily configure Postfix to use Gmail as a relay host as well. But if you're in a business environment, chances are they already have an internal relay server that you can point systems to.

hatfani 02-13-2020 06:41 AM

Quote:

Originally Posted by TB0ne (Post 6086501)
Have you ever been able to send mail from this server?? How do you have postfix configured to relay mail upstream to another server/host? Because unless you're running your own mail server (which is an ENORMOUSLY complicated task), you need to tell postfix to send mail onwards to another system that can handle and deliver it. Otherwise, mail won't go anywhere.

You don't tell us anything about your environment, what other servers are in play, your network, etc., so there's not a lot we can tell you. There are many how-to guides on how to easily configure Postfix to use Gmail as a relay host as well. But if you're in a business environment, chances are they already have an internal relay server that you can point systems to.

Apparently every thing worked properly, the emails were recieved in my spam folder but I didn't pay attention.

Anyway,
Thank you.


All times are GMT -5. The time now is 10:09 AM.