I am trying to see if there is any way I can send email from external email address to Unix user account. I don't know if this at all possible or not.

For example, if my external email address is abc@xyz.com and unix user name is test@localhost on testserver.test.com then I would like send email from abc@xyz.com to test@localhost.

With mail command I know I can send email from Unix to my account on Gmail/Outlook but I would to know if any way exists to do reverse. Ultimately I want to have it available in /var/spool/mail/test account.

  • If you have some mail server, such as dovecot running on testserver.test.com, just send mail from abc@xyz.com to test@testserver.test.com. – user37607 Dec 17 '13 at 18:43

To do this you need to have your server 'known' to the internet so that the rest of the world (including google mail) knows where to push your emails. And then run an MTA on your server (like postfix) that the outside world can connect to, to deliver the email. The MTA is then responsible for delivering to the the spool directory.

I am pretty sure that requires a fixed IP address where your server can be reached, and a server that is online most of the time.

If this is only for a single account, it is much easier to create a special email account somewhere (e.g. gmail) and pick up that email with a cron job that call fetchmail and delivers to the local MTA. This does not require a fixed IP for the server, nor that the port for the MTA (25) on the server is reachable from the outside world.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.