The company gave the task:
1. There is an account anton9009@yandex.ru, through which you need to receive and send mail.
2. There are local user1@corporate.lan and user2@corporate.lan accounts.

You need to implement sending mail from for example user1@corporate.lan to some address at test@yandex.ru for example, and this letter should go from anton9009@yandex.ru. And when test@yandex.ru will respond to anton9009@yandex.ru, this email should come to user1@corporate.lan

Any ideas?

  • And what is the question? - aleksandr barakin
  • How to implement it? Now I’m reading about Postfix. I’m looking for a kind of relay from an ISP - Anton
  • and what exactly to implement? Do not "strain the entire hard drive"? please remove from the question that which does not apply to it. - aleksandr barakin
  • Implement sending from local mail user1@corporate.lan for example to the address test@yandex.ru, but so that the letter to test@yandex.ru came not from user1@corporate.lan, but from anton9009@yandex.ru. And when test@yandex.ru will respond to anton9009@yandex.ru, the letter should come to user1@corporate.lan - Anton
  • for mail pickup: google: // fetchmail + procmail + forward 1 , 2 , etc. etc. - aleksandr barakin

1 answer 1

The question actually consists of several very broad questions, therefore I give only a brief and superficial description of the necessary global steps.

Below I will use the abbreviations from the article Email agent (infrastructure) , in it you can find examples of implementations of certain agents in the links.

  1. In order to use mua to read the messages received by user user1@corporate.lan , you need to communicate with the configured maa (there are no articles on the mail access agent in Wikipedia; therefore, for descriptions and examples of implementations, see the articles about the protocols used for communication with maa : imap and pop )
  2. in order to send a message to user user1@corporate.lan using mua, you need a connection with the configured mta (using the smtp protocol)
  3. The corporate.lan domain in the mta settings should be described as localdomain so that the messages are stored locally, where maa can read them.
  4. so that messages addressed to users not from the local domain (s) are sent to a Yandex (or any other) server, you need to set this server as a smarthost with authorization (or, if the server allows, without one) in the mta settings, but the reverse one ( local) address must be replaced with a globally accessible (in your case - anton9009@yandex.ru )
  5. messages received by anton9009@yandex.ru will need to be retrieved from Yandex maa using mra , and redirected to user1@corporate.lan . often for these two tasks use a bunch of fetchmail + procmail ( example )

Considerations for different local senders and responses to their messages:

because when sending a smarthost (i.e., to the outside world), the return (non-existent to the outside world) address must be replaced with a workable (in your case, anton9009@yandex.ru ), the response messages can be forwarded only to some one local user.