Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Exim4 smarthost multiple senders

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Exim4 smarthost multiple senders

#1 Post by alvakoldo10 »

Hi, I am a bit new to Exim4. I have been reading a lot and I can't find a solution to my case.
I use gmail as smarthost thru one of my gmail accounts, so /etc/exim4/passwd.client has the right configuration of my default account.
Mail is sent Ok but, my application must send mail from different senders (ale...@mydomain.com, i...@mydomain.com ....) and I do not know how to do it; all it's been done thru my authtenticated gmail account and so always the same sender. has to do with aliases? rewriting headers? .....hooooow pleeeeeaaase
Please help getting nuts at the moment.

smallchange
Posts: 1740
Joined: 2009-05-04 15:56
Been thanked: 1 time

Re: Exim4 smarthost multiple senders

#2 Post by smallchange »

I wish I could help but I don't think there is any way to do what you are asking. I think you can set the reply to but it will always be from the gmail account that sends it. You could use multiple smarthosts but then they would be from different domains. If you do find a way to do this I would sure like to hear about it.

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#3 Post by alvakoldo10 »

i do not think it's something so unusual; I mean, if you have a web and you use smarthost for your mailing,
are you forced to always send from just one account? info, alerts and useful froms like that could never be used ......strange
of course I mean using just one domain.

smallchange
Posts: 1740
Joined: 2009-05-04 15:56
Been thanked: 1 time

Re: Exim4 smarthost multiple senders

#4 Post by smallchange »

I think it is possible to get a smarthost that allows unauthenticated forwarding so that your computer can send as multiple users, but gmail does not provide that. You might want to look at this and this but I think they only associate a user with a different smarthost. If you had multiple users@domain.com all hosted at gmail you might be able to select username and password this way.

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#5 Post by alvakoldo10 »

thank u smallchange, but having read such posts (your "this" links) I have not quite understood, I do not even have same configuration files (although unified) that such examples.
Is it to use different smarthosts and so different domains ??? that won't fit to me
other way, where do i put the auth for all different users ....all lines in passwd.client ?

completely lost

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#6 Post by alvakoldo10 »

Sorry for insisting but somehow this goal must be possible for sure, otherwise how do webadministrators set it all up to be able to send the tipical automated emails from info@mydomain, noreply@mydomain and so .... I do not think that accounts like noreply@mydomain are actual accounts.
Please anyone may help I am stuck with this

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#7 Post by alvakoldo10 »

Ok, one clue : may it be a google restriction ? right now I've setup my own server acting as smarthost and no problem at all. (I cannot afford a server of my own)

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Exim4 smarthost multiple senders

#8 Post by dilberts_left_nut »

alvakoldo10 wrote:Ok, one clue : may it be a google restriction ?
Yes. Check your gmail account settings.
AdrianTM wrote:There's no hacker in my grandma...

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#9 Post by alvakoldo10 »

mmmm sorry, i've been reading quite a lot of manual these days and mybe i missed the good one.
If you've got so clear the answer, wouldn't it be easy to say it ? does it take more words than the ones said (including the nasty signature RTFM) ?
I mean to say such a thing it may be better not to waste everyone's time.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Exim4 smarthost multiple senders

#10 Post by dilberts_left_nut »

:lol: OK ...
Yes.
It is a google setting. It is them that is denying you relaying via their servers with those MAIL FROM: addresses.
Their server needs to be told to allow them. Only google can do that. No changes you make to your server will make any difference.
Check your gmail account settings
It is in there somewhere. I don't know exactly where because I don't relay my mail via google, or use Gmail. Some people I know do, but I'm not going to ring them up to ask, or go and sign up to Gmail to go and look, just so I can solve your problem for you.

So instead, I just posted the simple answer to the question you asked and told you where to look for the solution to the problem.

... and my sig isn't intended to be nasty, it's a quote from an old forum thread that took my fancy, but take it however you like ...
Last edited by dilberts_left_nut on 2011-06-15 12:12, edited 1 time in total.
AdrianTM wrote:There's no hacker in my grandma...

alvakoldo10
Posts: 59
Joined: 2010-09-17 07:49

Re: Exim4 smarthost multiple senders

#11 Post by alvakoldo10 »

ok
tnx.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Exim4 smarthost multiple senders

#12 Post by dasein »

Postings like this one just set me off, so I'm going to rant for a moment.
alvakoldo10 wrote:If you've got so clear the answer, wouldn't it be easy to say it ?
Not necessarily, no. Average typing speed is more than four times slower than average reading speed. So at a minimum, you are asking someone to spend 4x as much effort solving your own damn problem than you're willing to invest in solving it yourself.
alvakoldo10 wrote:(including the nasty signature RTFM) ?
You think RTFM is rude? Remind yourself that DLN graciously took the time to point you in the right direction. And you have the nerve to come back and complain that he didn't spoon-feed you an answer? Now that's rude!
alvakoldo10 wrote:I mean to say such a thing it may be better not to waste everyone's time.
Everyone you're asking to help you is a volunteer. You want to be able to demand answers on your terms? Fine. Bring your checkbook.

DoubleHP
Posts: 72
Joined: 2016-10-09 08:55
Has thanked: 1 time

Re: Exim4 smarthost multiple senders

#13 Post by DoubleHP »

I have spent 3h on this topic, so let's share my solution.

Initially, my smarthost was sending all messages via Gmail, using always the same gmail-account. This means ... Gmail may accept sending all emails with a FROM:user field, as long as the user is know in the gmail-account, but, even then, it will ALWAYS add a RETURN-PATH:A. So, when sending messages with FROM:B, gmail will add a RETURN-PATH:A . For most people, this is harmless, because most MUA will use the FROM to reply to. BUT ... some MUA will use the RETURN, and messages sent from account B will get replies to account A.

This is a quick a dirty fix to handle only one specific account B, and will leave account A as fallback.

I got inspired from this page:
http://www.linuxer.onlinehome.de/apps/exim.htm
which in short states:

Code: Select all

# example for /etc/exim/passwd.client
# email@adr.se:email@adr.se:localuser:mail.server.net:loginname:password
#                   1           2          3              4        5
# route_list = "* ${extract{3}{:}{${lookup{$sender_address}lsearch{/etc/exim/passwd.client}{$value}fail}}} bydns_a"
In the RELAY section, I changed this:
< hide client_send = : Account : Apass
---
> hide client_send = ": ${if eq {$sender_address} {Baccount}{Baccount}{Aaccount} } : ${if eq {$sender_address} {Baccount}{Bpass}{Apass} }"

Account names and passwords are written in plain text in my exim.conf file. It works because I don't use nasty letters. I could not find a way to group the user and password in a single IF section.

This could be escaladed for a 3rd user, but it may become PITA to nest several IF. A cleaner solution for 3+ accounts would be to use {CONFDIR/passwd.client} , with one line per account, plus a fallback line.

But in my very specific case, I will stick to this dual acounts dirty solution for a few more years.

Post Reply