LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-05-2009, 03:36 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
Configuring Mutt to receive and send from multiple accounts.


Hi!
Since a couple of days, I am trying to configure Mutt to be able to receive and to send mails from two e-mail accounts (one of them from Gmail and the other is a standard POP one).

I use:

Quote:
msmtp
fetchmail
procmail
and mutt
Configuration files are as follows:

a) .msmtprc

Quote:
account default
host smtp.gmail.com
port 587
from xxx@gmail.com
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user xxx@gmail.com
password lalala
logfile ~/.msmtp.log

#---Second Account. It doesn't work------#
account fiber
host smtp.fibertel.com.ar
from yyy.fibertel.com.ar
auth on --> Don't know how to say authentication login
user yyy
password blablabla
The second account (Fiber) needs authentication login but don't know how to do that.

2) .fetchmailrc:

Quote:
#Correo Gmail.
poll pop.gmail.com
with proto POP3
user 'xxx@gmail.com'
there with password 'lalala'
is 'user' here
mda "/usr/bin/procmail -d %T"
options
no keep
ssl
sslcertck
sslcertpath /etc/ssl/certs

#Correo Fibertel.
poll pop3.fibertel.com.ar
with proto POP3
user 'yyy'
there with password 'blablabla'
is 'user' here
mda "/usr/bin/procmail -d %T"
options
no keep
3) .procmailrc

Quote:
# Environment variable assignments
PATH=/bin:/usr/bin:/usr/local/bin
VERBOSE=off # Turn on for verbose log
MAILDIR=$HOME/Mail # Where Procmail recipes deliver
LOGFILE=$HOME/.procmaillog # Keep a log for troubleshooting.
# Recipes
:0:
* ^TOmutt-user
mutt
4) .muttrc:

Quote:
# Boring details
set realname = "Germán"
# set from = "xxx@gmail.com"
set from = "Germán"
set use_from = yes
set envelope_from ="yes"

set reverse_name=yes --> I don't know what this means.

alternates "xxx@gmail.com| yyy@fibertel.com.ar"

set sendmail="/usr/bin/msmtp"

# If not set in environment variables:
set spoolfile = /var/spool/mail/lacalga

#======================================================#
# Folders
set folder="~/Mail"
set record="+sent" # where to store sent messages
set postponed="+postponed" # where to store draft messages
set move=no # Don't move mail from the spool.

#======================================================#
# Watch these mailboxes for new mail:
mailboxes ! +Fetchmail +slrn +mutt
set sort_browser=alpha # Sort mailboxes by alpha(bet)

#======================================================#
# Order of headers and what to show
hdr_order Date: From: User-Agent: X-Mailer \
To: Cc: Reply-To: Subject:
ignore *
unignore Date: From: User-Agent: X-Mailer \
To: Cc: Reply-To: Subject:

#======================================================#
#---Editor----
set edit_headers # See the headers when editing

#======================================================#
# Aliases

set sort_alias=alias # sort aliases in alpha order by alias name

# Macro to check mail by pressing I.

macro index,pager I '<shell-escape> fetchmail -v<enter>'

#=======================================================#
# To view HTML messages.

auto_view text/html

#Macros to change accounts by pressing Alt+1 or Alt+2.
#They go in a line but they split here.

macro index \e1 ":set signature=~/.sign\n:set from=xxx@gmail.com\n:set status_format=\"-%r-Gmail: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---\"\n"

macro index \e2 ":set signature=~/.sign2\n:set from=yyy@fibertel.com.ar\n:set realname=Germán\n:set status_format=\"-%r-yyy: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---\"\n"

Until now, I can check mails from both accounts but I can only send from one of them (gmail). I would like to be able to choose between the two smtps to send my messages.
With the macros in .muttrc I can change the sender from account1 to account2 and it shows the change in the From: field but mails are always sent from account1 (gmail). ¿?


Any help will be appreciated
. Thanks in advance,

Last edited by glore2002; 10-05-2009 at 03:39 PM.
 
Old 10-23-2009, 03:20 AM   #2
cseanburns
Member
 
Registered: Nov 2003
Distribution: Fedora, Debian, Ubuntu, FreeBSD
Posts: 129

Rep: Reputation: 23
Those macros don't change accounts, they only alter the header.

The first thing you want to do is make sure your 'fiber' account in .msmptrc is working -- that you've configured it correctly. I can't tell from your post if you've confirmed that. So, comment out the gmail settings in .msmtprc and configure mutt to use msmtp with your 'fiber' account. Once you've confirmed that you can at least send emails using the 'fiber' smtp server, then you have a variety of options. You can use muttprofile, available via apt-get, to switch accounts within a single instance of mutt. I never bothered with it so I can't tell you how to set it up. Or you can simply create two .muttrc files and call them different names and configure them to each use the appropriate account in .msmtprc. E.g., one could be called .gmailrc and one could be called .fiberrc. Then create an aliases, in .bashrc for instance, like so:

alias gmail='mutt -F /home/you/.gmailrc'
alias fiber='mutt -F /home/you/.fiberrc'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring Mutt to receive pop3 mail. glore2002 Debian 5 10-04-2009 08:24 PM
Configuring necessary items so MUTT can send email nigma Linux - Networking 0 01-17-2005 12:07 PM
Multiple POP3 accounts with mutt?? febuiles Linux - Software 0 09-27-2004 09:08 PM
Multiple POP3 accounts with mutt febuiles Linux - Software 0 09-21-2004 11:37 PM
mutt - managing multiple accounts nic_d Linux - Newbie 0 02-14-2002 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration