-3

I have a small server that is suposed configured to use my gmail account to send emails about the readings the borad takes I can send emails all right but I have noticed something strange - I specified in my /etc/aliases that all users should be routed to the same email address

/etc/aliases:

postmaster: mail@gmail.com
readings: mail@gmail.com
root: mail@gmail.com 

I get all the root mail all right, but nothing else. Seems like the system tries to run the mail, but with wrong address (no use of alias)

postfix/qmgr[1425]: 8732EC047D: from=<readings@gmail.com>, size=4740, nrcpt=1 (queue active)

I've stumbled upon information that postfix does not use aliase with account name - is it true? More importantly, how can I set the alises for other users so that all the mail is sent with the same gmail account?

sebix
  • 4,313
  • 2
  • 29
  • 47
user3002166
  • 144
  • 5

2 Answers2

2

Each time you have modified /etc/aliases you have to launch newaliases command.

Kondybas
  • 6,964
  • 2
  • 20
  • 24
  • just tried that - I logged in as readings and sent the mail all right with mail command. Seems like this solved my problem, thanks a lot! – user3002166 Jun 24 '15 at 09:08
1

The alias file is used for routing of incoming emails. It does not affect the envelope sender of outgoing emails. That's something you need to set in whatever it is you're using to send the emails.

Jenny D
  • 27,780
  • 21
  • 75
  • 114
  • As written in my post, I'm using postfix - I want to instruct it to always send the mail as mail@gmail.com where mail is my email address. Obviously when it tries to send from readings account readings@gmail.com is not going to work so I want it to know to send mail using my own email. Seems like Kondybas solution worked. – user3002166 Jun 24 '15 at 09:12
  • 1
    Postfix is used to transport the emails. It does not *generate* them. – Jenny D Jun 24 '15 at 09:19
  • in that case it's the mail command plus I followed [this tutorial](https://community.runabove.com/kb/en/instances/how-to-relay-postfix-mails-via-smtp.gmail.com-on-ubuntu-14.04.html) on how to make system mail to be sent to a custom gmail account and I simply saw that only root emails were reaching me and the log pointed out it was trying to make systemuser@gmail.com instead of mail@gmail.com – user3002166 Jun 24 '15 at 09:54
  • The log extract you included in your question only showed the sending address. Are you trying to say that it was the recipient address you were wanting to change? – Jenny D Jun 24 '15 at 10:51
  • the log is what the problem is. The sending address is wrong- it tries to send as a user I can not send as because I don't have the gmail username like that. I want every user to send as the same user - so root, readings, postmaster to send AS mymail@gmail.com being the sender - hence I specified the aliases for every user to be the same. – user3002166 Jun 24 '15 at 11:35
  • @JennyD _"Postfix is used to transport the emails. It does not generate them."_ ehhh... MDN/DSN? – Kondybas Jun 24 '15 at 12:25
  • 1
    @Kondybas I wrote "***the** emails*", not just "emails".The emails in the question aren't MDN:s/DSN:s. – Jenny D Jun 24 '15 at 12:32