• 0 Posts
  • 1 Comment
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle
  • I see several issues with your SMTP session.

    First, gmail.com will be protected by SPF and DKIM and your message will likely be flagged as spam (or outright rejected) because it’s clear that you’re not sending on behalf of the real gmail.com.

    Second, commands should be in all-caps. A server may accept or reject lowercase keywords.

    Third, you need to leave a blank line between the mail headers and the body, so that part of your session would look like so: …

    DATA
    354 Go ahead
    From: ...
    To: ...
    Subject: ...
    
    This is the first line of text.
    This is the second line.
    .
    250 Queued
    

    Having said that, many servers will require an encrypted connection (SMTPS), many ISPs will block port 25 for residential customers as an anti-spam measure (so your local mail server may accept the message from your script but be unable to forward it), ESMTP should be preferred over SMTP etc.
    If at all possible, you should use a full-featured mail library for this and use your ISP’s own mail server.

    Doesn’t Pop_OS come with a sendmail command?