Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 6276  / 1 Year ago, thu, december 15, 2022, 10:17:33

I'm using the command:



echo "Test if email can be sent from server" | mail -s "Test" [email protected]



This is on an Ubuntu Server 12.04 completely up to date.



To catch you up on my troubleshooting:



1) I have installed mailutils with the "Internet Site" option (or whatever that internet option was; I can't remember exactly what it was called off the top of my head).



2) I have added myself to the group 'mail'.



3) I have checked that my ISP does, in fact, block port 25. I followed these instructions using port 587, which is unblocked (I'm not sure that this has an effect on outgoing mail; it looks like a mail server to me)



4) I've also tried echo "Test if email can be sent from server" | sendmail -f [email protected] [email protected], but this also appears to do nothing.



5) I am worried that gmail is receiving on port 587, but that it doesn't know what to do with the traffic. Is this an unfounded consideration?



6) My gmail user name contains a '.' before the '@gmail.com'. Is it possible that this is confusing the mail and sendmail commands? (edit: after some more experimenting, this is probably not the problem)


More From » server

 Answers
4

SMTP servers only accept incoming mail on TCP port 25. If they accept mail from other ports such as the submission port 587, that is only for the submission of new mail from known/authenticated clients sending mail. Incoming mail from an unknown client should only be accepted on port 25.



If your ISP is blocking outgoing connections on port 25 you will need to either




  • have them remove this block

  • relay the mail to a mail relay outside your local network which considers you a trusted client and let the relay forward it on. Speak to this relay on port 587.

  • authenticate as a client on the destination server using port 587 so the destination thinks of you as an authenticated client. I don't know if gmail allows this because the normal way they accept mail from clients is via web or their proprietary apps.



Edit: the OP pointed out in a commend that Gmail allows you to authenticate and submit mail by SMTP at smtp.gmail.com on port 465 (SMTP over SSL).


[#24481] Friday, December 16, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lassrake

Total Points: 400
Total Questions: 103
Total Answers: 98

Location: Netherlands
Member since Mon, Jun 22, 2020
4 Years ago
;