kandi background
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
Explore all Telnet open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Telnet

0.2.22-beta-release-prebuild

v1.5.1

pcsc-1.9.1

Final 4.11 Demo Release

0.8.0-beta2

sshwifty

0.2.22-beta-release-prebuild

shellz

v1.5.1

PCSC

pcsc-1.9.1

EtherTerm

Final 4.11 Demo Release

tn5250j

0.8.0-beta2

Popular Libraries in Telnet

Trending New libraries in Telnet

Top Authors in Telnet

1

23 Libraries

1227

2

4 Libraries

10

3

2 Libraries

18

4

2 Libraries

7

5

2 Libraries

15

6

2 Libraries

4

7

2 Libraries

10

8

2 Libraries

173

9

1 Libraries

2

10

1 Libraries

2

1

23 Libraries

1227

2

4 Libraries

10

3

2 Libraries

18

4

2 Libraries

7

5

2 Libraries

15

6

2 Libraries

4

7

2 Libraries

10

8

2 Libraries

173

9

1 Libraries

2

10

1 Libraries

2

Trending Kits in Telnet

No Trending Kits are available at this moment for Telnet

Trending Discussions on Telnet

    How to setup minimal smtp server on localhost to send messages to other smtp servers
    loop through multiple URLs to scrape from a CSV file in Scrapy is not working
    kubelet won't start after kuberntes/manifest update
    Git clone error: RPC failed - curl 28 Operation too slow
    Connection refused when HornetQ runs in Docker
    Cannot connect to kafka from ourside of its docker container
    Connection timeout using local kafka-connect cluster to connect on a remote database
    codecov fails in github actions
    Recognize telnet protocol with Scapy python
    Ruby: BUILD FAILED (macOS 11.2 using ruby-build 20210119) Mac Big Sur

QUESTION

How to setup minimal smtp server on localhost to send messages to other smtp servers

Asked 2022-Feb-05 at 07:42

Honestly, I think I have a fundamental gap in understanding how SMTP works. I can't seem to find a good explanation of what is happening behind the scenes and I think this is preventing me from being able to do what I am attempting to do.

To explain, I'm trying to setup an application which sends notifications to users by connecting to an SMTP server. Fair enough. I figure, since I'm using my own domain, I have SPF/DKIM/DMARC configured, I can add an MX record for the host I set the application up on (my SPF record has the mx keyword to authorize any hosts in my MX records to send/receive mails). Then, I can have that same host run a super lightweight SMTP server that can accept mails from the application, and send them on to recipients.

Almost crucially, I want this server to basically just run on localhost so that only this application can connect and send mails through it, but so that it can't really "receive" mails sent to my domain (I have set the MX priority very low (well, a high number) for this app server). I figure since I'm running my own SMTP server, that I don't really need to authenticate against it (it's running on localhost), just take in any mail and send it on to recipient domains.

When sending on to recipient domains... does the SMTP server need to authenticate to say, the gmail SMTP server as a user in order to send mails over there? That seems weird, since it's not a user logging into gmail to send mails, it's an SMTP server that is authorized within SPF sending mail from my domain (From address from my domain as well) to where ever the app server user's email is based (in this example, the user would be e.g., some_user@gmail.com).

I tried using python's aiosmtpd command-line and telnet to send a mail from test@MY_DOMAIN.TLD to test@MY_DOMAIN.TLD and it didn't seem to deliver the message; I figured aiosmtpd would connect to the preferred MX servers for my domain (my "real" MX's) to transfer the message, which would then put it in my inbox. That didn't seem to be the case, and I'm not sure why.

Exact repro steps, where example.com is my domain, and terminals are running on a box with a hostname listed in my MX records.

Terminal A:

1$ aiosmtpd -n
2

Terminal B:

1$ aiosmtpd -n
2$ telnet localhost 8025
3EHLO <example.com>
4MAIL FROM: test@example.com
5RCPT TO: test@example.com
6DATA
7FROM: Application Notifications <test@example.com>
8TO: User Name <test@example.com>
9SUBJECT: App Notify Test
10
11This is a test!
12.
13QUIT
14

How do SMTP servers normally send mail between each other? Do they each get some login to each other's SMTP servers to authenticate with, and since I'm not doing that, this is a problem? Can I run a SMTP server on localhost and have it send mail out of the network without receiving mails (a no-reply service)? Is there something obvious that I'm just missing here that solves all my problems?

Thanks

ANSWER

Answered 2022-Jan-25 at 18:18

It sounds like you want to run a mail transfer agent (MTA) that relays email to remote SMTP servers. An MTA will typically act as an SMTP server to receive messages, and then it will act as an SMTP client when it relays the messages to remote hosts.

MTAs generally operate in two different modes: (1) They will relay messages from authenticated users to remote hosts, and (2) they will receive messages from remote hosts to its users and store them somehow. The combination of those two modes - where the MTA will accept messages from remote hosts and relay them to different remote hosts - is called an open relay and is sure to attract spammers and place your server on spam blacklists.

aiosmtpd is not an MTA or an email relay out of the box - it is merely an SMTP server that will receive messages and do whatever with the messages you program it to do. By default it will do nothing - that is, it will receive the messages and throw them away. If you want to implement an email relay in aiosmtpd, then you need to implement the SMTP client portion of the MTA, e.g. by implementing an aiosmtpd handler that instantiates smtplib.SMTP to connect to remote hosts.

However, if all you want is an email relay, then you most likely don't need aiosmtpd at all - postfix is probably a better choice.

aiosmtpd can be a good choice if you need to implement mailing list software or perform some automation tasks based on incoming emails from e.g. cameras or scanners.

If you want to implement an email relay in aiosmtpd, then you need to ensure that both the software and your server are configured in a way that you don't relay unauthenticated messages from the outside internet.

See also: Python aiosmtpd - what is missing for an Mail-Transfer-Agent (MTA)?

Source https://stackoverflow.com/questions/70781775

Community Discussions contain sources that include Stack Exchange Network

    How to setup minimal smtp server on localhost to send messages to other smtp servers
    loop through multiple URLs to scrape from a CSV file in Scrapy is not working
    kubelet won't start after kuberntes/manifest update
    Git clone error: RPC failed - curl 28 Operation too slow
    Connection refused when HornetQ runs in Docker
    Cannot connect to kafka from ourside of its docker container
    Connection timeout using local kafka-connect cluster to connect on a remote database
    codecov fails in github actions
    Recognize telnet protocol with Scapy python
    Ruby: BUILD FAILED (macOS 11.2 using ruby-build 20210119) Mac Big Sur

QUESTION

How to setup minimal smtp server on localhost to send messages to other smtp servers

Asked 2022-Feb-05 at 07:42

Honestly, I think I have a fundamental gap in understanding how SMTP works. I can't seem to find a good explanation of what is happening behind the scenes and I think this is preventing me from being able to do what I am attempting to do.

To explain, I'm trying to setup an application which sends notifications to users by connecting to an SMTP server. Fair enough. I figure, since I'm using my own domain, I have SPF/DKIM/DMARC configured, I can add an MX record for the host I set the application up on (my SPF record has the mx keyword to authorize any hosts in my MX records to send/receive mails). Then, I can have that same host run a super lightweight SMTP server that can accept mails from the application, and send them on to recipients.

Almost crucially, I want this server to basically just run on localhost so that only this application can connect and send mails through it, but so that it can't really "receive" mails sent to my domain (I have set the MX priority very low (well, a high number) for this app server). I figure since I'm running my own SMTP server, that I don't really need to authenticate against it (it's running on localhost), just take in any mail and send it on to recipient domains.

When sending on to recipient domains... does the SMTP server need to authenticate to say, the gmail SMTP server as a user in order to send mails over there? That seems weird, since it's not a user logging into gmail to send mails, it's an SMTP server that is authorized within SPF sending mail from my domain (From address from my domain as well) to where ever the app server user's email is based (in this example, the user would be e.g., some_user@gmail.com).

I tried using python's aiosmtpd command-line and telnet to send a mail from test@MY_DOMAIN.TLD to test@MY_DOMAIN.TLD and it didn't seem to deliver the message; I figured aiosmtpd would connect to the preferred MX servers for my domain (my "real" MX's) to transfer the message, which would then put it in my inbox. That didn't seem to be the case, and I'm not sure why.

Exact repro steps, where example.com is my domain, and terminals are running on a box with a hostname listed in my MX records.

Terminal A:

1$ aiosmtpd -n
2

Terminal B:

1$ aiosmtpd -n
2$ telnet localhost 8025
3EHLO <example.com>
4MAIL FROM: test@example.com
5RCPT TO: test@example.com
6DATA
7FROM: Application Notifications <test@example.com>
8TO: User Name <test@example.com>
9SUBJECT: App Notify Test
10
11This is a test!
12.
13QUIT
14

How do SMTP servers normally send mail between each other? Do they each get some login to each other's SMTP servers to authenticate with, and since I'm not doing that, this is a problem? Can I run a SMTP server on localhost and have it send mail out of the network without receiving mails (a no-reply service)? Is there something obvious that I'm just missing here that solves all my problems?

Thanks

ANSWER

Answered 2022-Jan-25 at 18:18

It sounds like you want to run a mail transfer agent (MTA) that relays email to remote SMTP servers. An MTA will typically act as an SMTP server to receive messages, and then it will act as an SMTP client when it relays the messages to remote hosts.

MTAs generally operate in two different modes: (1) They will relay messages from authenticated users to remote hosts, and (2) they will receive messages from remote hosts to its users and store them somehow. The combination of those two modes - where the MTA will accept messages from remote hosts and relay them to different remote hosts - is called an open relay and is sure to attract spammers and place your server on spam blacklists.

aiosmtpd is not an MTA or an email relay out of the box - it is merely an SMTP server that will receive messages and do whatever with the messages you program it to do. By default it will do nothing - that is, it will receive the messages and throw them away. If you want to implement an email relay in aiosmtpd, then you need to implement the SMTP client portion of the MTA, e.g. by implementing an aiosmtpd handler that instantiates smtplib.SMTP to connect to remote hosts.

However, if all you want is an email relay, then you most likely don't need aiosmtpd at all - postfix is probably a better choice.

aiosmtpd can be a good choice if you need to implement mailing list software or perform some automation tasks based on incoming emails from e.g. cameras or scanners.

If you want to implement an email relay in aiosmtpd, then you need to ensure that both the software and your server are configured in a way that you don't relay unauthenticated messages from the outside internet.

See also: Python aiosmtpd - what is missing for an Mail-Transfer-Agent (MTA)?

Source https://stackoverflow.com/questions/70781775