1

I have a database (proprietary software wrapping postgres) running on a Ubuntu 20.04 VM, which comes with a python API to read and write into the database. For technical reasons, it's better to use the python API for read/write, and not direct SQL statements. Say there's only 1 table consisting of people and their birthdays:

id,name,birthday 1,sarah,21-10-2000 2,john,31-7-1998 3,elizabeth,18-3-2001 ... 

I'm able to use the python API + a cronjob that runs everyday to see whose birthday is upcoming in, say, 7 days. Here's the rub: the VM sits within a private corporate network, and I have the name of the mail server which is able to send but not receive, but no user or password associated with this VM (e.g. such as how devices like printers can be setup to send emails, but the printer will have no email address itself to send the email from).

I can easily find smtp setups like the one from here which work fine when tested with throwaway gmail accounts, but seem to require non-empty AuthUser and AuthPass fields. I get dead.letter appearing in the /home/<USER> when I try to do ssmtp [email protected] < test_email.txt.

Fairly new to this, so I might not be using the correct vocabulary, but hopefully I've adequately described the desired behaviour.

I'm not married to ssmtp either; any other lightweight MTA will do just fine.

6
  • Why don't you ask for an application username/password to authenticate to the corporate mail server? If you start sending emails via Gmail, (a) this could be blocked without warning, (b) you've potentially got personal information leakage in contravention of local data protection laws Commented Feb 17, 2021 at 7:37
  • 1
    Already asked for that, we're trying directly sending from mail server first. I'm not sure why they're reluctant to generate [email protected] emails; might be some security issue itself in and of itself. Commented Feb 17, 2021 at 9:24
  • I believe that msmtp replaced ssmtp but either should work for you. You will need authentication to use Gmail as a relay to an external-to-Gmail address. Please don't take this as rudeness by saying "Just Google", but this search will help you identify some possible solutions for your situation Commented Feb 17, 2021 at 9:31
  • Thanks for your msmtp idea, I'll look into that. However, my question was not about relaying through gmail servers using a gmail account, it was about relaying through company servers without a company email (odd, I know). I tried it out with throwaway gmails just for core functionality testing. Commented Feb 17, 2021 at 22:39
  • Oh ok. I misunderstood that. If I was running these servers I would probably allow you to deliver to a local (corporate) account but not off-site. Reading man msmtp it looks like it's simply a case of not enabling authentication, and omitting the user/pass parameters. Commented Feb 17, 2021 at 22:50

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.